mirror of
https://github.com/3b1b/manim.git
synced 2025-07-30 21:44:19 +08:00
moving code
This commit is contained in:
@ -10,21 +10,6 @@ GRADE_COLOR_1 = RED
|
||||
GRADE_COLOR_2 = BLUE
|
||||
|
||||
|
||||
def rainbow_color(alpha):
|
||||
nb_colors = 100
|
||||
rainbow = color_gradient([RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE], nb_colors)
|
||||
rainbow = np.append(rainbow,PURPLE)
|
||||
index = int(alpha * nb_colors)
|
||||
return rainbow[index]
|
||||
|
||||
def graded_color(n,k):
|
||||
if n != 0:
|
||||
alpha = float(k)/n
|
||||
else:
|
||||
alpha = 0.5
|
||||
color = interpolate_color(GRADE_COLOR_1, GRADE_COLOR_2, alpha)
|
||||
return color
|
||||
|
||||
|
||||
def graded_square(n,k):
|
||||
return Square(
|
||||
|
Reference in New Issue
Block a user