mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
moving code
This commit is contained in:
parent
1e663fa2ab
commit
11a0145f26
1 changed files with 0 additions and 15 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Reference in a new issue