Find color values for standard W3C colors.
Project description
This package provides an API for looking up hex, rgb, hsv, or hsl values of
W3C-recognized colors. The Color class, when initialized with a valid
identifier, will have as its attributes components of the various color model
representations.
Example:
To retrieve the numeric representations of the color brown as defined by
the W3C::
.. code:: python3
>>> from colorlookup import Color
>>>
>>> brown = Color('brown')
>>>
>>> print(brown)
Color: Brown
hex: #a52a2a
rgb: (165, 42, 42)
>>>
>>> brown.hex
'#a52a2a'
>>> brown.rgb
(165, 42, 42)
>>> brown.r
165
>>> brown.g
42
>>> brown.b
42
>>> brown.rgb_f
(0.65, 0.16, 0.16)
>>> brown.r_f
0.65
>>> brown.g_f
0.16
>>> brown.b_f
0.6
>>> brown.hsl_sat
0.59
>>> brown.hsl_light
0.41
>>> brown.hsv_sat
0.75
>>> brown.hsv_val
0.65
W3C-recognized colors. The Color class, when initialized with a valid
identifier, will have as its attributes components of the various color model
representations.
Example:
To retrieve the numeric representations of the color brown as defined by
the W3C::
.. code:: python3
>>> from colorlookup import Color
>>>
>>> brown = Color('brown')
>>>
>>> print(brown)
Color: Brown
hex: #a52a2a
rgb: (165, 42, 42)
>>>
>>> brown.hex
'#a52a2a'
>>> brown.rgb
(165, 42, 42)
>>> brown.r
165
>>> brown.g
42
>>> brown.b
42
>>> brown.rgb_f
(0.65, 0.16, 0.16)
>>> brown.r_f
0.65
>>> brown.g_f
0.16
>>> brown.b_f
0.6
>>> brown.hsl_sat
0.59
>>> brown.hsl_light
0.41
>>> brown.hsv_sat
0.75
>>> brown.hsv_val
0.65
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for colorlookup-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f7f132f157aaebf42e551aadb2b450b3e642f69503a9779bd2f2501f82565fc |
|
MD5 | 55c0b77114b01598ca53763a2ae074e2 |
|
BLAKE2b-256 | c05f69a39f9faa8bbd2e3f44d2d06ee305de8021b8b2bed52fc774c63c206197 |