コード例 #1
0
ファイル: util.py プロジェクト: wroldwiedbwe/wpgtk
def hls_to_hex(hls):
    """convert a hls coordinate to hex code"""
    h, l, s = hls
    r, g, b = hls_to_rgb(h, l, s)
    rgb_int = [max(min(int(elem), 255), 0) for elem in [r, g, b]]

    return rgb_to_hex(rgb_int)
コード例 #2
0
def hls_to_hex(hls):
    h, l, s = hls
    r, g, b = hls_to_rgb(h, l, s)
    rgb_int = [max(min(int(elem), 255), 0) for elem in [r, g, b]]

    return rgb_to_hex(rgb_int)
コード例 #3
0
 def test_rgb_to_hex(self):
     """> Convert 152,174,194 to HEX."""
     result = util.rgb_to_hex((152, 174, 194))
     self.assertEqual(result, "#98aec2")