{"id":13501806,"url":"https://github.com/vaab/colour","last_synced_at":"2025-12-11T22:45:20.464Z","repository":{"id":3565010,"uuid":"4626852","full_name":"vaab/colour","owner":"vaab","description":"Python color representations manipulation library (RGB, HSL, web, ...)","archived":false,"fork":false,"pushed_at":"2023-07-30T17:24:17.000Z","size":123,"stargazers_count":330,"open_issues_count":35,"forks_count":41,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-12-10T23:46:49.033Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vaab.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2012-06-11T15:42:13.000Z","updated_at":"2025-10-14T18:23:56.000Z","dependencies_parsed_at":"2024-01-16T10:37:38.487Z","dependency_job_id":"aaee1fba-4492-478c-8b11-d5a2622340b2","html_url":"https://github.com/vaab/colour","commit_stats":{"total_commits":49,"total_committers":10,"mean_commits":4.9,"dds":"0.24489795918367352","last_synced_commit":"11f138eb7841d2045160b378a2eec0c2321144c0"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/vaab/colour","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaab%2Fcolour","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaab%2Fcolour/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaab%2Fcolour/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaab%2Fcolour/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vaab","download_url":"https://codeload.github.com/vaab/colour/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaab%2Fcolour/sbom","scorecard":{"id":914139,"data":{"date":"2025-08-11","repo":{"name":"github.com/vaab/colour","commit":"11f138eb7841d2045160b378a2eec0c2321144c0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 2-Clause \"Simplified\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T20:22:00.721Z","repository_id":3565010,"created_at":"2025-08-24T20:22:00.721Z","updated_at":"2025-08-24T20:22:00.721Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27653652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-11T02:00:11.302Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T22:01:51.088Z","updated_at":"2025-12-11T22:45:20.424Z","avatar_url":"https://github.com/vaab.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"======\nColour\n======\n\n.. image:: http://img.shields.io/pypi/v/colour.svg?style=flat\n   :target: https://pypi.python.org/pypi/colour/\n   :alt: Latest PyPI version\n\n.. image:: https://img.shields.io/pypi/l/gitchangelog.svg?style=flat\n   :target: https://github.com/vaab/gitchangelog/blob/master/LICENSE\n   :alt: License\n\n.. image:: https://img.shields.io/pypi/pyversions/gitchangelog.svg?style=flat\n   :target: https://pypi.python.org/pypi/gitchangelog/\n   :alt: Compatible python versions\n\n.. image:: http://img.shields.io/pypi/dm/colour.svg?style=flat\n   :target: https://pypi.python.org/pypi/colour/\n   :alt: Number of PyPI downloads\n\n.. image:: http://img.shields.io/travis/vaab/colour/master.svg?style=flat\n   :target: https://travis-ci.org/vaab/colour/\n   :alt: Travis CI build status\n\n.. image:: https://img.shields.io/appveyor/ci/vaab/colour.svg\n   :target: https://ci.appveyor.com/project/vaab/colour/branch/master\n   :alt: Appveyor CI build status\n\n.. image:: http://img.shields.io/codecov/c/github/vaab/colour.svg?style=flat\n   :target: https://codecov.io/gh/vaab/colour/\n   :alt: Test coverage\n\n\nConverts and manipulates common color representation (RGB, HSL, web, ...)\n\n\nFeature\n=======\n\n- Damn simple and pythonic way to manipulate color representation (see\n  examples below)\n\n- Full conversion between RGB, HSL, 6-digit hex, 3-digit hex, human color\n\n- One object (``Color``) or bunch of single purpose function (``rgb2hex``,\n  ``hsl2rgb`` ...)\n\n- ``web`` format that use the smallest representation between\n  6-digit (e.g. ``#fa3b2c``), 3-digit (e.g. ``#fbb``), fully spelled\n  color (e.g. ``white``), following `W3C color naming`_ for compatible\n  CSS or HTML color specifications.\n\n- smooth intuitive color scale generation choosing N color gradients.\n\n- can pick colors for you to identify objects of your application.\n\n\n.. _W3C color naming: http://www.w3.org/TR/css3-color/#svg-color\n\n\nInstallation\n============\n\nYou don't need to download the GIT version of the code as ``colour`` is\navailable on the PyPI. So you should be able to run::\n\n    pip install colour\n\nIf you have downloaded the GIT sources, then you could add the ``colour.py``\ndirectly to one of your ``site-packages`` (thanks to a symlink). Or install\nthe current version via traditional::\n\n    python setup.py install\n\nAnd if you don't have the GIT sources but would like to get the latest\nmaster or branch from github, you could also::\n\n    pip install git+https://github.com/vaab/colour\n\nOr even select a specific revision (branch/tag/commit)::\n\n    pip install git+https://github.com/vaab/colour@master\n\n\nUsage\n=====\n\nTo get complete demo of each function, please read the source code which is\nheavily documented and provide a lot of examples in doctest format.\n\nHere is a reduced sample of a common usage scenario:\n\n\nInstantiation\n-------------\n\nLet's create blue color::\n\n    \u003e\u003e\u003e from colour import Color\n    \u003e\u003e\u003e c = Color(\"blue\")\n    \u003e\u003e\u003e c\n    \u003cColor blue\u003e\n\nPlease note that all of these are equivalent examples to create the red color::\n\n    Color(\"red\")           ## human, web compatible representation\n    Color(red=1)           ## default amount of blue and green is 0.0\n    Color(\"blue\", hue=0)   ## hue of blue is 0.66, hue of red is 0.0\n    Color(\"#f00\")          ## standard 3 hex digit web compatible representation\n    Color(\"#ff0000\")       ## standard 6 hex digit web compatible representation\n    Color(hue=0, saturation=1, luminance=0.5)\n    Color(hsl=(0, 1, 0.5)) ## full 3-uple HSL specification\n    Color(rgb=(1, 0, 0))   ## full 3-uple RGB specification\n    Color(Color(\"red\"))    ## recursion doesn't break object\n\n\nReading values\n--------------\n\nSeveral representations are accessible::\n\n    \u003e\u003e\u003e c.hex\n    '#00f'\n    \u003e\u003e\u003e c.hsl  # doctest: +ELLIPSIS\n    (0.66..., 1.0, 0.5)\n    \u003e\u003e\u003e c.rgb\n    (0.0, 0.0, 1.0)\n\nAnd their different parts are also independently accessible, as the different\namount of red, blue, green, in the RGB format::\n\n    \u003e\u003e\u003e c.red\n    0.0\n    \u003e\u003e\u003e c.blue\n    1.0\n    \u003e\u003e\u003e c.green\n    0.0\n\nOr the hue, saturation and luminance of the HSL representation::\n\n    \u003e\u003e\u003e c.hue  # doctest: +ELLIPSIS\n    0.66...\n    \u003e\u003e\u003e c.saturation\n    1.0\n    \u003e\u003e\u003e c.luminance\n    0.5\n\nA note on the ``.hex`` property, it'll return the smallest valid value\nwhen possible. If you are only interested by the long value, use\n``.hex_l``::\n\n    \u003e\u003e\u003e c.hex_l\n    '#0000ff'\n\n\nModifying color objects\n-----------------------\n\nAll of these properties are read/write, so let's add some red to this color::\n\n    \u003e\u003e\u003e c.red = 1\n    \u003e\u003e\u003e c\n    \u003cColor magenta\u003e\n\nWe might want to de-saturate this color::\n\n    \u003e\u003e\u003e c.saturation = 0.5\n    \u003e\u003e\u003e c\n    \u003cColor #bf40bf\u003e\n\nAnd of course, the string conversion will give the web representation which is\nhuman, or 3-digit, or 6-digit hex representation depending which is usable::\n\n    \u003e\u003e\u003e \"%s\" % c\n    '#bf40bf'\n\n    \u003e\u003e\u003e c.luminance = 1\n    \u003e\u003e\u003e \"%s\" % c\n    'white'\n\n\nRanges of colors\n----------------\n\nYou can get some color scale of variation between two ``Color`` objects quite\neasily. Here, is the color scale of the rainbow between red and blue::\n\n    \u003e\u003e\u003e red = Color(\"red\")\n    \u003e\u003e\u003e blue = Color(\"blue\")\n    \u003e\u003e\u003e list(red.range_to(blue, 5))\n    [\u003cColor red\u003e, \u003cColor yellow\u003e, \u003cColor lime\u003e, \u003cColor cyan\u003e, \u003cColor blue\u003e]\n\nOr the different amount of gray between black and white::\n\n    \u003e\u003e\u003e black = Color(\"black\")\n    \u003e\u003e\u003e white = Color(\"white\")\n    \u003e\u003e\u003e list(black.range_to(white, 6))\n    [\u003cColor black\u003e, \u003cColor #333\u003e, \u003cColor #666\u003e, \u003cColor #999\u003e, \u003cColor #ccc\u003e, \u003cColor white\u003e]\n\n\nIf you have to create graphical representation with color scale\nbetween red and green ('lime' color is full green)::\n\n    \u003e\u003e\u003e lime = Color(\"lime\")\n    \u003e\u003e\u003e list(red.range_to(lime, 5))\n    [\u003cColor red\u003e, \u003cColor #ff7f00\u003e, \u003cColor yellow\u003e, \u003cColor chartreuse\u003e, \u003cColor lime\u003e]\n\nNotice how naturally, the yellow is displayed in human format and in\nthe middle of the scale. And that the quite unusual (but compatible)\n'chartreuse' color specification has been used in place of the\nhexadecimal representation.\n\n\nColor comparison\n----------------\n\nSane default\n~~~~~~~~~~~~\n\nColor comparison is a vast subject. However, it might seem quite straightforward for\nyou. ``Colour`` uses a configurable default way of comparing color that might suit\nyour needs::\n\n    \u003e\u003e\u003e Color(\"red\") == Color(\"#f00\") == Color(\"blue\", hue=0)\n    True\n\nThe default comparison algorithm focuses only on the \"web\" representation which is\nequivalent to comparing the long hex representation (e.g. #FF0000) or to be more\nspecific, it is equivalent to compare the amount of red, green, and blue composition\nof the RGB representation, each of these value being quantized to a 256 value scale.\n\nThis default comparison is a practical and convenient way to measure the actual\ncolor equivalence on your screen, or in your video card memory.\n\nBut this comparison wouldn't make the difference between a black red, and a\nblack blue, which both are black::\n\n   \u003e\u003e\u003e black_red = Color(\"red\", luminance=0)\n   \u003e\u003e\u003e black_blue = Color(\"blue\", luminance=0)\n\n   \u003e\u003e\u003e black_red == black_blue\n   True\n\n\nCustomization\n~~~~~~~~~~~~~\n\nBut, this is not the sole way to compare two colors. As I'm quite lazy, I'm providing\nyou a way to customize it to your needs. Thus::\n\n   \u003e\u003e\u003e from colour import RGB_equivalence, HSL_equivalence\n   \u003e\u003e\u003e black_red = Color(\"red\", luminance=0, equality=HSL_equivalence)\n   \u003e\u003e\u003e black_blue = Color(\"blue\", luminance=0, equality=HSL_equivalence)\n\n   \u003e\u003e\u003e black_red == black_blue\n   False\n\nAs you might have already guessed, the sane default is ``RGB_equivalence``, so::\n\n   \u003e\u003e\u003e black_red = Color(\"red\", luminance=0, equality=RGB_equivalence)\n   \u003e\u003e\u003e black_blue = Color(\"blue\", luminance=0, equality=RGB_equivalence)\n\n   \u003e\u003e\u003e black_red == black_blue\n   True\n\nHere's how you could implement your unique comparison function::\n\n   \u003e\u003e\u003e saturation_equivalence = lambda c1, c2: c1.saturation == c2.saturation\n   \u003e\u003e\u003e red = Color(\"red\", equality=saturation_equivalence)\n   \u003e\u003e\u003e blue = Color(\"blue\", equality=saturation_equivalence)\n   \u003e\u003e\u003e white = Color(\"white\", equality=saturation_equivalence)\n\n   \u003e\u003e\u003e red == blue\n   True\n   \u003e\u003e\u003e white == red\n   False\n\nNote: When comparing 2 colors, *only* the equality function *of the first\ncolor will be used*. Thus::\n\n   \u003e\u003e\u003e black_red = Color(\"red\", luminance=0, equality=RGB_equivalence)\n   \u003e\u003e\u003e black_blue = Color(\"blue\", luminance=0, equality=HSL_equivalence)\n\n   \u003e\u003e\u003e black_red == black_blue\n   True\n\nBut reverse operation is not equivalent !::\n\n   \u003e\u003e\u003e black_blue == black_red\n   False\n\n\nEquality to non-Colour objects\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nAs a side note, whatever your custom equality function is, it won't be\nused if you compare to anything else than a ``Colour`` instance::\n\n    \u003e\u003e\u003e red = Color(\"red\", equality=lambda c1, c2: True)\n    \u003e\u003e\u003e blue = Color(\"blue\", equality=lambda c1, c2: True)\n\nNote that these instances would compare as equal to any other color::\n\n    \u003e\u003e\u003e red == blue\n    True\n\nBut on another non-Colour object::\n\n    \u003e\u003e\u003e red == None\n    False\n    \u003e\u003e\u003e red != None\n    True\n\nActually, ``Colour`` instances will, politely enough, leave\nthe other side of the equality have a chance to decide of the output,\n(by executing its own ``__eq__``), so::\n\n    \u003e\u003e\u003e class OtherColorImplem(object):\n    ...     def __init__(self, color):\n    ...         self.color = color\n    ...     def __eq__(self, other):\n    ...         return self.color == other.web\n\n    \u003e\u003e\u003e alien_red = OtherColorImplem(\"red\")\n    \u003e\u003e\u003e red == alien_red\n    True\n    \u003e\u003e\u003e blue == alien_red\n    False\n\nAnd inequality (using ``__ne__``) are also polite::\n\n    \u003e\u003e\u003e class AnotherColorImplem(OtherColorImplem):\n    ...     def __ne__(self, other):\n    ...         return self.color != other.web\n\n    \u003e\u003e\u003e new_alien_red = AnotherColorImplem(\"red\")\n    \u003e\u003e\u003e red != new_alien_red\n    False\n    \u003e\u003e\u003e blue != new_alien_red\n    True\n\n\nPicking arbitrary color for a python object\n-------------------------------------------\n\nBasic Usage\n~~~~~~~~~~~\n\nSometimes, you just want to pick a color for an object in your application\noften to visually identify this object. Thus, the picked color should be the\nsame for same objects, and different for different object::\n\n    \u003e\u003e\u003e foo = object()\n    \u003e\u003e\u003e bar = object()\n\n    \u003e\u003e\u003e Color(pick_for=foo)  # doctest: +ELLIPSIS\n    \u003cColor ...\u003e\n    \u003e\u003e\u003e Color(pick_for=foo) == Color(pick_for=foo)\n    True\n    \u003e\u003e\u003e Color(pick_for=foo) == Color(pick_for=bar)\n    False\n\nOf course, although there's a tiny probability that different strings yield the\nsame color, most of the time, different inputs will produce different colors.\n\nAdvanced Usage\n~~~~~~~~~~~~~~\n\nYou can customize your color picking algorithm by providing a ``picker``. A\n``picker`` is a callable that takes an object, and returns something that can\nbe instantiated as a color by ``Color``::\n\n    \u003e\u003e\u003e my_picker = lambda obj: \"red\" if isinstance(obj, int) else \"blue\"\n    \u003e\u003e\u003e Color(pick_for=3, picker=my_picker, pick_key=None)\n    \u003cColor red\u003e\n    \u003e\u003e\u003e Color(pick_for=\"foo\", picker=my_picker, pick_key=None)\n    \u003cColor blue\u003e\n\nYou might want to use a particular picker, but enforce how the picker will\nidentify two object as the same (or not). So there's a ``pick_key`` attribute\nthat is provided and defaults as equivalent of ``hash`` method and if hash is\nnot supported by your object, it'll default to the ``str`` of your object salted\nwith the class name.\n\nThus::\n\n    \u003e\u003e\u003e class MyObj(str): pass\n    \u003e\u003e\u003e my_obj_color = Color(pick_for=MyObj(\"foo\"))\n    \u003e\u003e\u003e my_str_color = Color(pick_for=\"foo\")\n    \u003e\u003e\u003e my_obj_color == my_str_color\n    False\n\nPlease make sure your object is hashable or \"stringable\" before using the\n``RGB_color_picker`` picking mechanism or provide another color picker. Nearly\nall python object are hashable by default so this shouldn't be an issue (e.g. \ninstances of ``object`` and subclasses are hashable).\n\nNeither ``hash`` nor ``str`` are perfect solution. So feel free to use\n``pick_key`` at ``Color`` instantiation time to set your way to identify\nobjects, for instance::\n\n    \u003e\u003e\u003e a = object()\n    \u003e\u003e\u003e b = object()\n    \u003e\u003e\u003e Color(pick_for=a, pick_key=id) == Color(pick_for=b, pick_key=id)\n    False\n\nWhen choosing a pick key, you should closely consider if you want your color\nto be consistent between runs (this is NOT the case with the last example),\nor consistent with the content of your object if it is a mutable object.\n\nDefault value of ``pick_key`` and ``picker`` ensures that the same color will\nbe attributed to same object between different run on different computer for\nmost python object.\n\n\nColor factory\n-------------\n\nAs you might have noticed, there are few attributes that you might want to see\nattached to all of your colors as ``equality`` for equality comparison support,\nor ``picker``, ``pick_key`` to configure your object color picker.\n\nYou can create a customized ``Color`` factory thanks to the ``make_color_factory``::\n\n    \u003e\u003e\u003e from colour import make_color_factory, HSL_equivalence, RGB_color_picker\n\n    \u003e\u003e\u003e get_color = make_color_factory(\n    ...    equality=HSL_equivalence,\n    ...    picker=RGB_color_picker,\n    ...    pick_key=str,\n    ... )\n\nAll color created thanks to ``CustomColor`` class instead of the default one\nwould get the specified attributes by default::\n\n    \u003e\u003e\u003e black_red = get_color(\"red\", luminance=0)\n    \u003e\u003e\u003e black_blue = get_color(\"blue\", luminance=0)\n\nOf course, these are always instances of ``Color`` class::\n\n    \u003e\u003e\u003e isinstance(black_red, Color)\n    True\n\nEquality was changed from normal defaults, so::\n\n    \u003e\u003e\u003e black_red == black_blue\n    False\n\nThis because the default equivalence of ``Color`` was set to\n``HSL_equivalence``.\n\n\nContributing\n============\n\nAny suggestion or issue is welcome. Push request are very welcome,\nplease check out the guidelines.\n\n\nPush Request Guidelines\n-----------------------\n\nYou can send any code. I'll look at it and will integrate it myself in\nthe code base and leave you as the author. This process can take time and\nit'll take less time if you follow the following guidelines:\n\n- check your code with PEP8 or pylint. Try to stick to 80 columns wide.\n- separate your commits per smallest concern.\n- each commit should pass the tests (to allow easy bisect)\n- each functionality/bugfix commit should contain the code, tests,\n  and doc.\n- prior minor commit with typographic or code cosmetic changes are\n  very welcome. These should be tagged in their commit summary with\n  ``!minor``.\n- the commit message should follow gitchangelog rules (check the git\n  log to get examples)\n- if the commit fixes an issue or finished the implementation of a\n  feature, please mention it in the summary.\n\nIf you have some questions about guidelines which is not answered here,\nplease check the current ``git log``, you might find previous commit that\nwould show you how to deal with your issue.\n\n\nLicense\n=======\n\nCopyright (c) 2012-2017 Valentin Lab.\n\nLicensed under the `BSD License`_.\n\n.. _BSD License: http://raw.github.com/vaab/colour/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaab%2Fcolour","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaab%2Fcolour","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaab%2Fcolour/lists"}