Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
docs/ | H | 12-Feb-2018 | - | 1,597 | 1,163 | |
tests/ | H | 12-Feb-2018 | - | 1,136 | 940 | |
webcolors.egg-info/ | H | 03-May-2022 | - | 65 | 48 | |
LICENSE | H A D | 11-Feb-2018 | 1.5 KiB | 29 | 25 | |
MANIFEST.in | H A D | 11-Mar-2017 | 144 | 7 | 7 | |
PKG-INFO | H A D | 12-Feb-2018 | 2.3 KiB | 65 | 48 | |
README.rst | H A D | 08-Feb-2018 | 1.1 KiB | 42 | 26 | |
setup.cfg | H A D | 12-Feb-2018 | 1 KiB | 50 | 40 | |
setup.py | H A D | 11-Mar-2017 | 275 | 9 | 2 | |
webcolors.py | H A D | 12-Feb-2018 | 28.4 KiB | 902 | 559 |
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