dotfiles/.local/bin/hsv2rgb
2021-01-15 22:14:51 +01:00

13 lines
228 B
Python
Executable file

#!/usr/bin/python3
import colorsys
import sys
h, s, v = map(float, sys.argv[1:])
h /= 360
s /= 100
v /= 100
r, g, b = colorsys.hsv_to_rgb(h, s, v)
print("{:02x}{:02x}{:02x}".format(round(255*r), round(255*g), round(255*b)))