Sha256: d460afc9b2f8d72724482ae03959604928d5cc52a007b33854fc1bbf9d209ca3

Contents?: true

Size: 624 Bytes

Versions: 17

Compression:

Stored size: 624 Bytes

Contents

import colorsys  # It turns out Python already does HSL -> RGB!
trim = lambda s: s if not s.endswith('.0') else s[:-2]
print('[')
print(',\n'.join(
    '"hsl%s(%s, %s%%, %s%%%s)", [%s, %s, %s, %s]' % (
        ('a' if a is not None else '', h, trim(str(s/10.)), trim(str(l/10.)),
         ', %s' % a if a is not None else '')
        + tuple(trim(str(round(v, 10)))
                for v in colorsys.hls_to_rgb(h/360., l/1000., s/1000.))
        + (a if a is not None else 1,)
    )
    for a in [None, 1, .2, 0]
    for l in range(0, 1001, 125)
    for s in range(0, 1001, 125)
    for h in range(0, 360, 30)
))
print(']')

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/crass-1.0.4/test/css-parsing-tests/make_color3_hsl.py
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/crass-1.0.4/test/css-parsing-tests/make_color3_hsl.py
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/crass-1.0.4/test/css-parsing-tests/make_color3_hsl.py
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/crass-1.0.4/test/css-parsing-tests/make_color3_hsl.py
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/crass-1.0.4/test/css-parsing-tests/make_color3_hsl.py
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/crass-1.0.4/test/css-parsing-tests/make_color3_hsl.py
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/crass-1.0.4/test/css-parsing-tests/make_color3_hsl.py
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/crass-1.0.4/test/css-parsing-tests/make_color3_hsl.py
spiral_form-0.1.1 vendor/bundle/gems/crass-1.0.4/test/css-parsing-tests/make_color3_hsl.py
spiral_form-0.1.0 vendor/bundle/gems/crass-1.0.4/test/css-parsing-tests/make_color3_hsl.py
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/crass-1.0.4/test/css-parsing-tests/make_color3_hsl.py
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/crass-1.0.4/test/css-parsing-tests/make_color3_hsl.py
crass-1.0.4 test/css-parsing-tests/make_color3_hsl.py
crass-1.0.3 test/css-parsing-tests/make_color3_hsl.py
crass-1.0.2 test/css-parsing-tests/make_color3_hsl.py
crass-1.0.1 test/css-parsing-tests/make_color3_hsl.py
crass-1.0.0 test/css-parsing-tests/make_color3_hsl.py