Skip to content

Commit 310d881

Browse files
committed
added import statement and fixed missing lines
1 parent 4e745e2 commit 310d881

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

manim/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565

6666
from .utils.bezier import *
6767
from .utils.color import *
68+
from .utils import color as color
6869
from .utils.config_ops import *
6970
from .utils.debug import *
7071
from .utils.images import *

manim/utils/color.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,41 +22,49 @@
2222
"BLUE_E",
2323
"BLUE_D",
2424
"BLUE_C",
25+
"BLUE",
2526
"BLUE_B",
2627
"BLUE_A",
2728
"TEAL_E",
2829
"TEAL_D",
2930
"TEAL_C",
31+
"TEAL",
3032
"TEAL_B",
3133
"TEAL_A",
3234
"GREEN_E",
3335
"GREEN_D",
3436
"GREEN_C",
37+
"GREEN",
3538
"GREEN_B",
3639
"GREEN_A",
3740
"YELLOW_E",
3841
"YELLOW_D",
3942
"YELLOW_C",
43+
"YELLOW",
4044
"YELLOW_B",
4145
"YELLOW_A",
4246
"GOLD_E",
4347
"GOLD_D",
4448
"GOLD_C",
49+
"GOLD",
4550
"GOLD_B",
4651
"GOLD_A",
4752
"RED_E",
4853
"RED_D",
4954
"RED_C",
55+
"RED",
5056
"RED_B",
5157
"RED_A",
5258
"MAROON_E",
5359
"MAROON_D",
5460
"MAROON_C",
61+
"MAROON",
5562
"MAROON_B",
5663
"MAROON_A",
5764
"PURPLE_E",
5865
"PURPLE_D",
5966
"PURPLE_C",
67+
"PURPLE",
6068
"PURPLE_B",
6169
"PURPLE_A",
6270
"WHITE",
@@ -82,7 +90,6 @@
8290
from colour import Color
8391
import numpy as np
8492

85-
from ..constants import COLOR_MAP
8693
from ..utils.bezier import interpolate
8794
from ..utils.simple_functions import clip_in_place
8895
from ..utils.space_ops import normalize
@@ -179,41 +186,49 @@ class Colors(Enum):
179186
BLUE_E = Colors.blue_e.value
180187
BLUE_D = Colors.blue_d.value
181188
BLUE_C = Colors.blue_c.value
189+
BLUE = Colors.blue.value
182190
BLUE_B = Colors.blue_b.value
183191
BLUE_A = Colors.blue_a.value
184192
TEAL_E = Colors.teal_e.value
185193
TEAL_D = Colors.teal_d.value
186194
TEAL_C = Colors.teal_c.value
195+
TEAL = Colors.teal.value
187196
TEAL_B = Colors.teal_b.value
188197
TEAL_A = Colors.teal_a.value
189198
GREEN_E = Colors.green_e.value
190199
GREEN_D = Colors.green_d.value
191200
GREEN_C = Colors.green_c.value
201+
GREEN = Colors.green.value
192202
GREEN_B = Colors.green_b.value
193203
GREEN_A = Colors.green_a.value
194204
YELLOW_E = Colors.yellow_e.value
195205
YELLOW_D = Colors.yellow_d.value
196206
YELLOW_C = Colors.yellow_c.value
207+
YELLOW = Colors.yellow.value
197208
YELLOW_B = Colors.yellow_b.value
198209
YELLOW_A = Colors.yellow_a.value
199210
GOLD_E = Colors.gold_e.value
200211
GOLD_D = Colors.gold_d.value
201212
GOLD_C = Colors.gold_c.value
213+
GOLD = Colors.gold.value
202214
GOLD_B = Colors.gold_b.value
203215
GOLD_A = Colors.gold_a.value
204216
RED_E = Colors.red_e.value
205217
RED_D = Colors.red_d.value
206218
RED_C = Colors.red_c.value
219+
RED = Colors.red.value
207220
RED_B = Colors.red_b.value
208221
RED_A = Colors.red_a.value
209222
MAROON_E = Colors.maroon_e.value
210223
MAROON_D = Colors.maroon_d.value
211224
MAROON_C = Colors.maroon_c.value
225+
MAROON = Colors.maroon.value
212226
MAROON_B = Colors.maroon_b.value
213227
MAROON_A = Colors.maroon_a.value
214228
PURPLE_E = Colors.purple_e.value
215229
PURPLE_D = Colors.purple_d.value
216230
PURPLE_C = Colors.purple_c.value
231+
PURPLE = Colors.purple.value
217232
PURPLE_B = Colors.purple_b.value
218233
PURPLE_A = Colors.purple_a.value
219234
WHITE = Colors.white.value
@@ -265,7 +280,7 @@ def hex_to_rgb(hex_code):
265280
hex_part = hex_code[1:]
266281
if len(hex_part) == 3:
267282
"".join([2 * c for c in hex_part])
268-
return np.array([int(hex_part[i : i + 2], 16) / 255 for i in range(0, 6, 2)])
283+
return np.array([int(hex_part[i: i + 2], 16) / 255 for i in range(0, 6, 2)])
269284

270285

271286
def invert_color(color):
@@ -326,4 +341,4 @@ def get_shaded_rgb(rgb, point, unit_normal_vect, light_source):
326341
factor *= 0.5
327342
result = rgb + factor
328343
clip_in_place(rgb + factor, 0, 1)
329-
return result
344+
return result

0 commit comments

Comments
 (0)