webcolors


Namewebcolors JSON
Version 24.11.1 PyPI version JSON
download
home_pageNone
SummaryA library for working with the color formats defined by HTML and CSS.
upload_time2024-11-11 07:43:24
maintainerNone
docs_urlNone
authorJames Bennett
requires_python>=3.9
licenseBSD-3-Clause
keywords color css html web
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. -*-restructuredtext-*-

.. image:: https://github.com/ubernostrum/webcolors/workflows/CI/badge.svg
   :alt: CI status image
   :target: https://github.com/ubernostrum/webcolors/actions?query=workflow%3ACI

``webcolors`` is a module for working with and converting between the
various HTML/CSS color formats.

Support is included for normalizing and converting between the
following formats (RGB colorspace only; conversion to/from HSL can be
handled by the ``colorsys`` module in the Python standard library):

* Specification-defined color names

* Six-digit hexadecimal

* Three-digit hexadecimal

* Integer ``rgb()`` triplet

* Percentage ``rgb()`` triplet

For example:

.. code-block:: python

    >>> import webcolors
    >>> webcolors.hex_to_name("#daa520")
    'goldenrod'

Implementations are also provided for the HTML5 color parsing and
serialization algorithms. For example, parsing the infamous
"chucknorris" string into an ``rgb()`` triplet:

.. code-block:: python

    >>> import webcolors
    >>> webcolors.html5_parse_legacy_color("chucknorris")
    HTML5SimpleColor(red=192, green=0, blue=0)

Full documentation is `available online <https://webcolors.readthedocs.io/>`_.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "webcolors",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "color, css, html, web",
    "author": "James Bennett",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/7b/29/061ec845fb58521848f3739e466efd8250b4b7b98c1b6c5bf4d40b419b7e/webcolors-24.11.1.tar.gz",
    "platform": null,
    "description": ".. -*-restructuredtext-*-\n\n.. image:: https://github.com/ubernostrum/webcolors/workflows/CI/badge.svg\n   :alt: CI status image\n   :target: https://github.com/ubernostrum/webcolors/actions?query=workflow%3ACI\n\n``webcolors`` is a module for working with and converting between the\nvarious HTML/CSS color formats.\n\nSupport is included for normalizing and converting between the\nfollowing formats (RGB colorspace only; conversion to/from HSL can be\nhandled by the ``colorsys`` module in the Python standard library):\n\n* Specification-defined color names\n\n* Six-digit hexadecimal\n\n* Three-digit hexadecimal\n\n* Integer ``rgb()`` triplet\n\n* Percentage ``rgb()`` triplet\n\nFor example:\n\n.. code-block:: python\n\n    >>> import webcolors\n    >>> webcolors.hex_to_name(\"#daa520\")\n    'goldenrod'\n\nImplementations are also provided for the HTML5 color parsing and\nserialization algorithms. For example, parsing the infamous\n\"chucknorris\" string into an ``rgb()`` triplet:\n\n.. code-block:: python\n\n    >>> import webcolors\n    >>> webcolors.html5_parse_legacy_color(\"chucknorris\")\n    HTML5SimpleColor(red=192, green=0, blue=0)\n\nFull documentation is `available online <https://webcolors.readthedocs.io/>`_.\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "A library for working with the color formats defined by HTML and CSS.",
    "version": "24.11.1",
    "project_urls": {
        "Documentation": "https://webcolors.readthedocs.io",
        "Source Code": "https://github.com/ubernostrum/webcolors"
    },
    "split_keywords": [
        "color",
        " css",
        " html",
        " web"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "60e8c0e05e4684d13459f93d312077a9a2efbe04d59c393bc2b8802248c908d4",
                "md5": "0c77d42f8d3362064ea0439528affdcf",
                "sha256": "515291393b4cdf0eb19c155749a096f779f7d909f7cceea072791cb9095b92e9"
            },
            "downloads": -1,
            "filename": "webcolors-24.11.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0c77d42f8d3362064ea0439528affdcf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 14934,
            "upload_time": "2024-11-11T07:43:22",
            "upload_time_iso_8601": "2024-11-11T07:43:22.529489Z",
            "url": "https://files.pythonhosted.org/packages/60/e8/c0e05e4684d13459f93d312077a9a2efbe04d59c393bc2b8802248c908d4/webcolors-24.11.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7b29061ec845fb58521848f3739e466efd8250b4b7b98c1b6c5bf4d40b419b7e",
                "md5": "f348b16613d82426ae01e62375158a1a",
                "sha256": "ecb3d768f32202af770477b8b65f318fa4f566c22948673a977b00d589dd80f6"
            },
            "downloads": -1,
            "filename": "webcolors-24.11.1.tar.gz",
            "has_sig": false,
            "md5_digest": "f348b16613d82426ae01e62375158a1a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 45064,
            "upload_time": "2024-11-11T07:43:24",
            "upload_time_iso_8601": "2024-11-11T07:43:24.224216Z",
            "url": "https://files.pythonhosted.org/packages/7b/29/061ec845fb58521848f3739e466efd8250b4b7b98c1b6c5bf4d40b419b7e/webcolors-24.11.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-11 07:43:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ubernostrum",
    "github_project": "webcolors",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "webcolors"
}
        
Elapsed time: 0.46698s