dotfiles/.local/bin/hsv2rgb

14 lines
229 B
Text
Raw Normal View History

2021-01-15 21:59:21 +01:00
#!/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)))