mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Fix rgb_to_hex bug
This commit is contained in:
parent
3bc4416655
commit
4e54c6de54
1 changed files with 5 additions and 1 deletions
|
@ -35,7 +35,11 @@ def rgba_to_color(rgba):
|
||||||
|
|
||||||
|
|
||||||
def rgb_to_hex(rgb):
|
def rgb_to_hex(rgb):
|
||||||
return "#" + "".join(hex(int(255 * x))[2:] for x in rgb)
|
return "#" + "".join(
|
||||||
|
hex(int_x // 16)[2] + hex(int_x % 16)[2]
|
||||||
|
for x in rgb
|
||||||
|
for int_x in [int(255 * x)]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def hex_to_rgb(hex_code):
|
def hex_to_rgb(hex_code):
|
||||||
|
|
Loading…
Add table
Reference in a new issue