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)
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)
def test_rgb_to_hex(self): """> Convert 152,174,194 to HEX.""" result = util.rgb_to_hex((152, 174, 194)) self.assertEqual(result, "#98aec2")