Files
RustPython/Lib/colorsys.py
2018-07-12 20:38:53 +02:00

11 lines
187 B
Python

# TODO: implement standard library here
def rgb_to_yiq(r, g, b):
y = 0.30*r + 0.59*g + 0.11*b
i = 0.74*(r-y) - 0.27*(b-y)
q = 0.48*(r-y) + 0.41*(b-y)
return (y, i, q)