colorzero


Namecolorzero JSON
Version 2.0 PyPI version JSON
download
home_page
SummaryYet another Python color library
upload_time2021-03-15 23:42:23
maintainer
docs_urlNone
authorDave Jones
requires_python
licenseBSD-3-Clause
keywords color
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. -*- rst -*-

=========
colorzero
=========

colorzero is a color manipulation library for Python (yes, *another* one) which
aims to be reasonably simple to use and "pythonic" in nature.

It does *not* aim to be as comprehensive, powerful, or that matter as *correct*
as, say, `colormath`_.  colorzero originally grew out of work on my `picamera`_
project, hence it's intended to be sufficiently simple that school children can
use it without having to explain color spaces and illuminants. However, it does
aim to be useful to a wide range of skills, hence it does include basic
facilities for `CIE Lab`_ representations, and `Delta-E`_ calculations should
you need them.

The major difference between colorzero and other libraries (`grapefruit`_,
`colormath`_, etc.) is that its ``Color`` class is a ``namedtuple`` descendent.
This means it is immutable; you cannot *directly* change the attributes of a
``Color`` instance. The major advantage of this is that instances can be used
as keys in dictionaries (for simple `LUTs`_), or placed in sets.

Manipulation of ``Color`` instances is done by typical operations with other
classes the result of which is a new ``Color`` instance. For example::

    >>> Color('red') + Color('blue')
    <Color html='#ff00ff' rgb=(1, 0, 1)>
    >>> Color('magenta') - Color('red')
    <Color html='#0000ff' rgb=(0, 0, 1)>
    >>> Color('red') - Red(0.5)
    <Color html='#800000' rgb=(0.5, 0, 0)>
    >>> Color('green') + Color('grey').red
    <Color html='#808000' rgb=(0.501961, 0.501961, 0)>
    >>> Color.from_hls(0.5, 0.5, 1.0)
    <Color html='#00ffff' rgb=(0, 1, 1)>
    >>> Color.from_hls(0.5, 0.5, 1.0) * Lightness(0.8)
    <Color html='#00cccc' rgb=(0, 0.8, 0.8)>
    >>> (Color.from_hls(0.5, 0.5, 1.0) * Lightness(0.8)).hls
    HLS(h=0.5, l=0.4, s=1.0)

Links
=====

* The code is licensed under the `BSD license`_
* The `source code`_ can be obtained from GitHub, which also hosts the `bug
  tracker`_
* The `documentation`_ (which includes installation, quick-start examples, and
  lots of code recipes) can be read on ReadTheDocs
* Packages can be downloaded from `PyPI`_, but reading the installation
  instructions is more likely to be useful


.. _picamera: https://picamera.readthedocs.io/
.. _colormath: https://python-colormath.readthedocs.io/
.. _grapefruit: https://grapefruit.readthedocs.io/
.. _CIE Lab: https://en.wikipedia.org/wiki/Lab_color_space
.. _Delta-E: https://en.wikipedia.org/wiki/Color_difference
.. _PyPI: http://pypi.python.org/pypi/colorzero/
.. _documentation: http://colorzero.readthedocs.io/
.. _source code: https://github.com/waveform80/colorzero
.. _bug tracker: https://github.com/waveform80/colorzero/issues
.. _BSD license: http://opensource.org/licenses/BSD-3-Clause
.. _LUTs: https://en.wikipedia.org/wiki/Lookup_table#Lookup_tables_in_image_processing



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "colorzero",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "color",
    "author": "Dave Jones",
    "author_email": "dave@waveform.org.uk",
    "download_url": "https://files.pythonhosted.org/packages/b3/ca/688824a06e8c4d04c7d2fd2af2d8da27bed51af20ee5f094154e1d680334/colorzero-2.0.tar.gz",
    "platform": "",
    "description": ".. -*- rst -*-\n\n=========\ncolorzero\n=========\n\ncolorzero is a color manipulation library for Python (yes, *another* one) which\naims to be reasonably simple to use and \"pythonic\" in nature.\n\nIt does *not* aim to be as comprehensive, powerful, or that matter as *correct*\nas, say, `colormath`_.  colorzero originally grew out of work on my `picamera`_\nproject, hence it's intended to be sufficiently simple that school children can\nuse it without having to explain color spaces and illuminants. However, it does\naim to be useful to a wide range of skills, hence it does include basic\nfacilities for `CIE Lab`_ representations, and `Delta-E`_ calculations should\nyou need them.\n\nThe major difference between colorzero and other libraries (`grapefruit`_,\n`colormath`_, etc.) is that its ``Color`` class is a ``namedtuple`` descendent.\nThis means it is immutable; you cannot *directly* change the attributes of a\n``Color`` instance. The major advantage of this is that instances can be used\nas keys in dictionaries (for simple `LUTs`_), or placed in sets.\n\nManipulation of ``Color`` instances is done by typical operations with other\nclasses the result of which is a new ``Color`` instance. For example::\n\n    >>> Color('red') + Color('blue')\n    <Color html='#ff00ff' rgb=(1, 0, 1)>\n    >>> Color('magenta') - Color('red')\n    <Color html='#0000ff' rgb=(0, 0, 1)>\n    >>> Color('red') - Red(0.5)\n    <Color html='#800000' rgb=(0.5, 0, 0)>\n    >>> Color('green') + Color('grey').red\n    <Color html='#808000' rgb=(0.501961, 0.501961, 0)>\n    >>> Color.from_hls(0.5, 0.5, 1.0)\n    <Color html='#00ffff' rgb=(0, 1, 1)>\n    >>> Color.from_hls(0.5, 0.5, 1.0) * Lightness(0.8)\n    <Color html='#00cccc' rgb=(0, 0.8, 0.8)>\n    >>> (Color.from_hls(0.5, 0.5, 1.0) * Lightness(0.8)).hls\n    HLS(h=0.5, l=0.4, s=1.0)\n\nLinks\n=====\n\n* The code is licensed under the `BSD license`_\n* The `source code`_ can be obtained from GitHub, which also hosts the `bug\n  tracker`_\n* The `documentation`_ (which includes installation, quick-start examples, and\n  lots of code recipes) can be read on ReadTheDocs\n* Packages can be downloaded from `PyPI`_, but reading the installation\n  instructions is more likely to be useful\n\n\n.. _picamera: https://picamera.readthedocs.io/\n.. _colormath: https://python-colormath.readthedocs.io/\n.. _grapefruit: https://grapefruit.readthedocs.io/\n.. _CIE Lab: https://en.wikipedia.org/wiki/Lab_color_space\n.. _Delta-E: https://en.wikipedia.org/wiki/Color_difference\n.. _PyPI: http://pypi.python.org/pypi/colorzero/\n.. _documentation: http://colorzero.readthedocs.io/\n.. _source code: https://github.com/waveform80/colorzero\n.. _bug tracker: https://github.com/waveform80/colorzero/issues\n.. _BSD license: http://opensource.org/licenses/BSD-3-Clause\n.. _LUTs: https://en.wikipedia.org/wiki/Lookup_table#Lookup_tables_in_image_processing\n\n\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Yet another Python color library",
    "version": "2.0",
    "project_urls": {
        "Documentation": "https://colorzero.readthedocs.io/",
        "Issue Tracker": "https://github.com/waveform80/colorzero/issues",
        "Source Code": "https://github.com/waveform80/colorzero/"
    },
    "split_keywords": [
        "color"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7ea6ddd0f130e44a7593ac6c55aa93f6e256d2270fd88e9d1b64ab7f22ab8fde",
                "md5": "4968a244470e83be63d5034ec0dee797",
                "sha256": "0e60d743a6b8071498a56465f7719c96a5e92928f858bab1be2a0d606c9aa0f8"
            },
            "downloads": -1,
            "filename": "colorzero-2.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4968a244470e83be63d5034ec0dee797",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 26573,
            "upload_time": "2021-03-15T23:42:21",
            "upload_time_iso_8601": "2021-03-15T23:42:21.757777Z",
            "url": "https://files.pythonhosted.org/packages/7e/a6/ddd0f130e44a7593ac6c55aa93f6e256d2270fd88e9d1b64ab7f22ab8fde/colorzero-2.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b3ca688824a06e8c4d04c7d2fd2af2d8da27bed51af20ee5f094154e1d680334",
                "md5": "e7f71e181b94754bcc5ca7c92c52c0d7",
                "sha256": "e7d5a5c26cd0dc37b164ebefc609f388de24f8593b659191e12d85f8f9d5eb58"
            },
            "downloads": -1,
            "filename": "colorzero-2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e7f71e181b94754bcc5ca7c92c52c0d7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 25382,
            "upload_time": "2021-03-15T23:42:23",
            "upload_time_iso_8601": "2021-03-15T23:42:23.261534Z",
            "url": "https://files.pythonhosted.org/packages/b3/ca/688824a06e8c4d04c7d2fd2af2d8da27bed51af20ee5f094154e1d680334/colorzero-2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-03-15 23:42:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "waveform80",
    "github_project": "colorzero",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "colorzero"
}
        
Elapsed time: 0.12073s