{"id":13688889,"url":"https://github.com/lmcinnes/glasbey","last_synced_at":"2025-04-05T14:03:08.012Z","repository":{"id":62949042,"uuid":"561966507","full_name":"lmcinnes/glasbey","owner":"lmcinnes","description":"Algorithmically create or extend categorical colour palettes","archived":false,"fork":false,"pushed_at":"2024-06-18T17:45:39.000Z","size":194,"stargazers_count":195,"open_issues_count":3,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-14T15:41:39.487Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lmcinnes.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-04T23:06:55.000Z","updated_at":"2024-10-02T21:05:52.000Z","dependencies_parsed_at":"2024-06-18T20:44:10.792Z","dependency_job_id":"37b59a39-0033-4eb8-bb64-29c3d8daf335","html_url":"https://github.com/lmcinnes/glasbey","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmcinnes%2Fglasbey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmcinnes%2Fglasbey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmcinnes%2Fglasbey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmcinnes%2Fglasbey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lmcinnes","download_url":"https://codeload.github.com/lmcinnes/glasbey/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345849,"owners_count":20924102,"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","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-08-02T15:01:26.594Z","updated_at":"2025-04-05T14:03:07.997Z","avatar_url":"https://github.com/lmcinnes.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":".. -*- mode: rst -*-\n\n.. image:: doc/glasbey_logo.png\n  :width: 600\n  :alt: Glasbey logo\n  :align: center\n\n|pypi_version|_ |License|_ |build_status|_ |Coverage|_ |Docs|_\n\n.. |pypi_version| image:: https://img.shields.io/pypi/v/glasbey.svg\n.. _pypi_version: https://pypi.python.org/pypi/glasbey/\n\n.. |License| image:: https://img.shields.io/pypi/l/glasbey\n.. _License: https://github.com/lmcinnes/glasbey/blob/main/LICENSE\n\n.. |build_status| image:: https://dev.azure.com/lelandmcinnes/Glasbey%20builds/_apis/build/status/lmcinnes.glasbey?branchName=main\n.. _build_status: https://dev.azure.com/lelandmcinnes/Glasbey%20builds/_build/latest?definitionId=2\u0026branchName=main\n\n.. |Coverage| image:: https://coveralls.io/repos/github/lmcinnes/glasbey/badge.svg?branch=HEAD\n.. _Coverage: https://coveralls.io/github/lmcinnes/glasbey\n\n.. |Docs| image:: https://readthedocs.org/projects/glasbey/badge/?version=latest\n.. _Docs: https://glasbey.readthedocs.io/en/latest/?badge=latest\n\n\n=======================================\nGlasbey Categorical Color Palette Tools\n=======================================\n\nThe glasbey library allows for the algorithmic creation of colour palettes designed for use with categorical data\nusing techniques from the paper Colour Displays for Categorical Images by Glasbey, Heijden, Toh and Gray. You don't\nneed to worry about the technical details however -- the glasbey library is easy to use.\n\nIt is quite common to require a colour palette for some categorical data such that each category has a visually\ndistinctive colour. Usually one relies upon predefined colour palettes such as those from\n`ColorBrewer \u003chttps://colorbrewer2.org/#type=qualitative\u0026scheme=Accent\u0026n=3\u003e`_, or provided by your plotting library of\nchoice. Unfortunately such palettes do not always meet your needs: perhaps they don't have enough distinct colours and\nyou don't want to re-use or cycle the palette; perhaps you have specific constraints you want to apply to get a\ncertain look to your palette. Fortunately we can use math and perceptual colour spaces to create new palettes that\nmaximize the perceptual visual distinctiveness of colours within constraints. It is also easy to extend an\nexisting palette, or seed a created palette with some initial colours (perhaps your company or institutions colours).\nLastly, glasbey makes it easy to generate block palettes, suitable for working with hierarchical categories.\n\nCreate categorical palettes\n\n.. image:: doc/glasbey_basic_palette.png\n  :width: 600\n  :alt: Glasbey basic palette example\n  :align: center\n\nor constrain the palette options (e.g. to muted colours)\n\n.. image:: doc/glasbey_muted_palette.png\n  :width: 600\n  :alt: Glasbey muted palette example\n  :align: center\n\nor extend existing palettes\n\n.. image:: doc/glasbey_tab10_palette.png\n  :width: 600\n  :alt: Glasbey extending tab10 example\n  :align: center\n\nor create block categorical palettes\n\n.. image:: doc/glasbey_block_palette.png\n  :width: 600\n  :alt: Glasbey block palette example\n  :align: center\n\n-----------\nBasic Usage\n-----------\n\nCreating new categorical colour palettes is as easy as single function call.\n\n.. code:: python3\n\n    import glasbey\n\n    # Create a categorical palette with 15 colours\n    glasbey.create_palette(palette_size=15)\n    # Create a muted palette with 12 colours\n    glasbey.create_palette(palette_size=12, lightness_bounds=(20, 40), chroma_bounds=(40, 50))\n\nIt is also easy to extend an existing palette, or create a new palette from some seed colours.\n\n.. code:: python3\n\n    import glasbey\n\n    # Add an extra 5 colours to matplotlib's tab10 palette\n    glasbey.extend_palette(\"tab10\", palette_size=15)\n    # Seed a palette with some initial colours\n    glasbey.extend_palette([\"#2a3e63\", \"#7088b8\", \"#fcaf3e\", \"#b87088\"], palette_size=8)\n\n------------\nInstallation\n------------\n\nGlasbey requires:\n\n * numba\n * numpy\n * colorspacious\n * matplotlib\n\nGlasbey can be installed via pip:\n\n.. code:: bash\n\n    pip install glasbey\n\nTo manually install this package:\n\n.. code:: bash\n\n    wget https://github.com/lmcinnes/glasbey/archive/main.zip\n    unzip main.zip\n    rm main.zip\n    cd glasbey-main\n    python setup.py install\n\n----------------\nAcknowledgements\n----------------\n\nThis library is heavily indebted to the `original glasbey library  \u003chttps://github.com/taketwo/glasbey\u003e`_ by Sergey Alexandrov.\n\n----------\nReferences\n----------\n\n1) Glasbey, C., van der Heijden, G., Toh, V. F. K. and Gray, A. (2007),\n   `Colour Displays for Categorical Images \u003chttp://onlinelibrary.wiley.com/doi/10.1002/col.20327/abstract\u003e`_.\n   Color Research and Application, 32: 304-309\n\n2) Luo, M. R., Cui, G. and Li, C. (2006), `Uniform Colour Spaces Based on CIECAM02 Colour Appearance Model \u003chttp://onlinelibrary.wiley.com/doi/10.1002/col.20227/abstract\u003e`_.\n   Color Research and Application, 31: 320–330\n\n-------\nLicense\n-------\n\nGlasbey is MIT licensed. See the LICENSE file for details.\n\n------------\nContributing\n------------\n\nContributions are more than welcome! If you have ideas for features of projects please get in touch. Everything from\ncode to notebooks to examples and documentation are all *equally valuable* so please don't feel you can't contribute.\nTo contribute please `fork the project \u003chttps://github.com/lmcinnes/glasbey/issues#fork-destination-box\u003e`_ make your\nchanges and submit a pull request. We will do our best to work through any issues with you and get your code merged in.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmcinnes%2Fglasbey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmcinnes%2Fglasbey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmcinnes%2Fglasbey/lists"}