mirror of
https://github.com/3b1b/manim.git
synced 2025-07-31 22:13:30 +08:00
[HELPER] Add a color helper function.
This commit is contained in:
@ -125,6 +125,9 @@ def rgb_to_color(rgb):
|
||||
def rgba_to_color(rgba):
|
||||
return rgb_to_color(rgba[:3])
|
||||
|
||||
def rgb_to_hex(rgb):
|
||||
return Color(rgb = rgb).get_hex_l()
|
||||
|
||||
def invert_color(color):
|
||||
return rgb_to_color(1.0 - color_to_rgb(color))
|
||||
|
||||
|
Reference in New Issue
Block a user