• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

docs/H12-Feb-2018-1,5971,163

tests/H12-Feb-2018-1,136940

webcolors.egg-info/H03-May-2022-6548

LICENSEH A D11-Feb-20181.5 KiB2925

MANIFEST.inH A D11-Mar-2017144 77

PKG-INFOH A D12-Feb-20182.3 KiB6548

README.rstH A D08-Feb-20181.1 KiB4226

setup.cfgH A D12-Feb-20181 KiB5040

setup.pyH A D11-Mar-2017275 92

webcolors.pyH A D12-Feb-201828.4 KiB902559

README.rst

1.. -*-restructuredtext-*-
2
3.. image:: https://travis-ci.org/ubernostrum/webcolors.svg?branch=master
4    :target: https://travis-ci.org/ubernostrum/webcolors
5
6``webcolors`` is a Python (2.7, 3.4+) module for working with HTML/CSS
7color definitions.
8
9Support is included for normalizing and converting between the
10following formats (RGB colorspace only; conversion to/from HSL can be
11handled by the ``colorsys`` module in the Python standard library):
12
13* Specification-defined color names
14
15* Six-digit hexadecimal
16
17* Three-digit hexadecimal
18
19* Integer ``rgb()`` triplet
20
21* Percentage ``rgb()`` triplet
22
23For example:
24
25.. code-block:: python
26
27    >>> import webcolors
28    >>> webcolors.hex_to_name(u'#daa520')
29    u'goldenrod'
30
31Implementations are also provided for the HTML5 color parsing and
32serialization algorithms. For example, parsing the infamous
33"chucknorris" string into an rgb() triplet:
34
35.. code-block:: python
36
37    >>> import webcolors
38    >>> webcolors.html5_parse_legacy_color(u'chucknorris')
39    HTML5SimpleColor(192, 0, 0)
40
41Full documentation is `available online <https://webcolors.readthedocs.io/>`_.
42