Fix rgb_to_hex bug

This commit is contained in:
Grant Sanderson 2020-11-24 13:29:27 -08:00
parent 3bc4416655
commit 4e54c6de54

View file

@ -35,7 +35,11 @@ def rgba_to_color(rgba):
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):