{"id":31540056,"url":"https://github.com/trinitronx/python-color-match","last_synced_at":"2025-10-04T09:51:23.769Z","repository":{"id":305499500,"uuid":"1021460504","full_name":"trinitronx/python-color-match","owner":"trinitronx","description":"Find color match based on CIE 2000 Delta E","archived":false,"fork":false,"pushed_at":"2025-07-20T12:02:52.000Z","size":89,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-20T14:17:31.071Z","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":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trinitronx.png","metadata":{"files":{"readme":"README.md","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,"zenodo":null}},"created_at":"2025-07-17T12:34:13.000Z","updated_at":"2025-07-20T12:02:56.000Z","dependencies_parsed_at":"2025-07-20T14:17:35.247Z","dependency_job_id":"4b6ed6e3-7b79-4895-b9e7-1931b4a983e4","html_url":"https://github.com/trinitronx/python-color-match","commit_stats":null,"previous_names":["trinitronx/python-color-match"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/trinitronx/python-color-match","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinitronx%2Fpython-color-match","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinitronx%2Fpython-color-match/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinitronx%2Fpython-color-match/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinitronx%2Fpython-color-match/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trinitronx","download_url":"https://codeload.github.com/trinitronx/python-color-match/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinitronx%2Fpython-color-match/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278295840,"owners_count":25963427,"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-10-04T02:00:05.491Z","response_time":63,"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":"2025-10-04T09:51:17.325Z","updated_at":"2025-10-04T09:51:23.763Z","avatar_url":"https://github.com/trinitronx.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Color Match\n\nPython Color Match is a library designed to help you compare and match colors\nusing the CIE 2000 Delta E formula. It provides a command-line utility to\ncalculate the perceived difference between target colors and find the closest\nmatches from a provided palette.\n\n## Features\n\n- **Delta E Calculation**: Uses the CIE 2000 Delta E formula to compute the\n  perceptual difference between two colors.\n- **Hex Color Support**: Accepts hex color strings as input, making it easy to\n  integrate with web or graphic design workflows.\n- **Palette Matching**: Finds the closest color matches from a palette of\n  user-provided colors.\n- **CLI Interface**: Includes a command-line interface for quick and easy batch\n  color matching.\n- **Unit Tests**: Comprehensive test coverage to ensure correctness and\n  reliability.\n\n## Installation\n\nThe command-line utility is currently available in pre-release or beta status.\nTo install the library, clone the repository and install the dependencies:\n\n```bash\ngit clone https://github.com/trinitronx/python-color-match.git\ncd python-color-match\npip install .\n```\n\n## Usage\n\n### CLI Usage\n\nRun the CLI to match colors from two files (one containing target colors and the\nother containing the palette):\n\n```bash\npython -m color_match target_colors.txt palette_colors.txt\n```\n\nExample output:\n\n```text\nTarget colors: ['#eb0028']\nPalette colors: ['#cd3f45', '#d70000', '#ff0000', '#c70039', '#ff5733']\nClosest matches for #eb0028:\n  #cd3f45 with Delta E: 7.03\n  #d70000 with Delta E: 7.35\n  #ff0000 with Delta E: 7.78\n  #c70039 with Delta E: 10.44\n  #ff5733 with Delta E: 12.45\nColor matching completed successfully.\n```\n\n### Library Usage\n\nWhile this project is primarily designed as a CLI utility, it's possible to use\nthe library in your Python code:\n\n```python\nfrom color_match.util.color import calculate_delta_e\n\ndelta_e = calculate_delta_e(\"#eb0028\", \"#d70000\")\nprint(f\"Delta E: {delta_e:.2f}\")\n```\n\nCurrently, this is a convenience wrapper around the `basic_colormath` library,\nwhich provides many more color math functions.\n\n## Development\n\nThe project includes a `Makefile` with targets for dependency installation,\ntesting, build, and release.\n\n### Install Dependencies\n\nIt's recommended to use a `virtualenv` tool such as `pyenv-virtualenv`,\n`virtualenvwrapper`, `venv`, `conda`, or similar.  Instructions for using such a\ntool is outside the scope of this documentation, so refer to the chosen tool's\ndocs for that prerequisite.  To install this project's dependencies \u0026 module in\n[editable / development mode][2]:\n\n```bash\nmake install-dev\n```\n\nThis installs both `test` and `build` dependencies along with the module.\n\nAlternatively, the `build` and `test` dependencies can be installed separately,\nbut still alongside the module with:\n\n- `make install-build`, or\n- `make install-test`\n\nAn `install` target also exists that installs just the module in editable\ndevelopment mode.  The `install-*` targets are setup to depend on this one.\n\n### Testing\n\nRun the tests to verify the functionality:\n\n```bash\nmake test\n```\n\nTo run the tests in CI mode and generate an XML code coverage report:\n\n```bash\nmake test-ci\n```\n\nTo just run the `codecov` tool:\n\n```bash\nmake report\n```\n\nRun the linter tools (`ruff`, `mypy`) with the `lint` target:\n\n```bash\nmake lint\n```\n\nThere is also a `fix` target to automatically fix all supported style warnings\nfrom the Ruff linter:\n\n```bash\nmake fix\n```\n\nTo build a source distribution \u0026 wheel:\n\n```bash\nmake build\n```\n\nTo publish via `twine`:\n\n```bash\nmake publish\n```\n\nTo clean up build files:\n\n```bash\nmake clean\n```\n\nFinally, there are some targets to build the C sub-project test fixtures:\n\n- `make test-fixtures`: Just builds the sub-project with `meson` \u0026 `ninja`\n- `make test-fixtures-install`: Installs the built binaries into\n  `test/fixtures/bin` for use in development.\n\n### Project Structure\n\nThis project uses the [`src` layout][1] structure.  Tests are located under\n`test`, and the python module's code is located under `src`:\n\n```text\n LICENSE\n Makefile\n pyproject.toml\n󰂺 README.md\n src/\n└──  color_match/\n    ├──  __init__.py\n    ├──  __main__.py\n    ├──  color_match.py\n    └──  util/\n        ├──  __init__.py\n        ├──  color.py\n        └──  monkeypatch/\n            └──  numpy_asscalar.py\n test/\n├──  fixtures/\n│   ├── 󰝴 build.ninja\n│   ├──  foot-default-colors.c\n│   ├──  foot-extra-theme-manjaro-sway-default-256color-palette.txt\n│   ├──  Makefile\n│   ├──  meson.build\n│   └──  print-xterm-256-colors.c\n├──  test_color_match.py\n└──  util/\n    └──  color_test.py\n```\n\nThe sub-project under `test/fixtures` provides some examples for hexidecimal\ncolor palette generation for `xterm-256color` terminals, and an example terminal\ntheme file.  These are currently unused in the test cases, but are provided as\nexamples for hex color file input for the `color_matcher` CLI.  They are not\nincluded in the built \u0026 distributed wheel, but are included in the source\ndistribution for development purposes.\n\n### Dependencies\n\n- **basic_colormath**: For color space conversions and Delta E calculations.\n- **~~numpy~~**: ~~For numerical operations~~ (only used indirectly via\n  `basic_colormath[vectorize]`).\n  - This project was refactored to use `basic_colormath` rather than `colormath`\n    or `colormath2`\n  - It does not yet use the `vectorize` optional feature, thus this dependency\n    is unneeded.\n- **pytest**: For running unit tests.\n\n### License\n\nThis project is licensed under the [AGPLv3 License](LICENSE).\n\n---\n\nFeel free to contribute!\n\n[1]: https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/\n[2]: https://setuptools.pypa.io/en/latest/userguide/development_mode.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinitronx%2Fpython-color-match","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrinitronx%2Fpython-color-match","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinitronx%2Fpython-color-match/lists"}