{"id":16473426,"url":"https://github.com/vikpe/chromato","last_synced_at":"2026-06-08T13:32:11.977Z","repository":{"id":46657576,"uuid":"413088219","full_name":"vikpe/chromato","owner":"vikpe","description":"Color utilities for Python.","archived":false,"fork":false,"pushed_at":"2022-07-18T19:07:52.000Z","size":116,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-05T06:07:12.523Z","etag":null,"topics":["cmyk","colors","hex","hls","hsv","python","rgb"],"latest_commit_sha":null,"homepage":"","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/vikpe.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}},"created_at":"2021-10-03T13:38:58.000Z","updated_at":"2022-07-19T08:50:41.000Z","dependencies_parsed_at":"2022-08-19T05:01:42.995Z","dependency_job_id":null,"html_url":"https://github.com/vikpe/chromato","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vikpe/chromato","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikpe%2Fchromato","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikpe%2Fchromato/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikpe%2Fchromato/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikpe%2Fchromato/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vikpe","download_url":"https://codeload.github.com/vikpe/chromato/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikpe%2Fchromato/sbom","scorecard":{"id":921515,"data":{"date":"2025-08-11","repo":{"name":"github.com/vikpe/chromato","commit":"7c501a84489e53c6daf7c7260b674b3654d4a645"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"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":"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":10,"reason":"no dangerous workflow patterns detected","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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/vikpe/chromato/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/vikpe/chromato/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/vikpe/chromato/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/vikpe/chromato/test.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:27","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT 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":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"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"}}]},"last_synced_at":"2025-08-25T03:50:40.179Z","repository_id":46657576,"created_at":"2025-08-25T03:50:40.179Z","updated_at":"2025-08-25T03:50:40.179Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34065349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"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":["cmyk","colors","hex","hls","hsv","python","rgb"],"created_at":"2024-10-11T12:26:55.569Z","updated_at":"2026-06-08T13:32:11.956Z","avatar_url":"https://github.com/vikpe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003e🍅 chromato\u003c/h1\u003e\n    \u003cp\u003e\n        \u003cb\u003eFresh color utilities for Python\u003c/b\u003e\n    \u003c/p\u003e\n\n\u003c!--[![PyPI version](https://badge.fury.io/py/chromato.svg)](https://pypi.org/project/chromato/) --\u003e\n[![test](https://github.com/vikpe/chromato/actions/workflows/test.yml/badge.svg)](https://github.com/vikpe/chromato/actions/workflows/test.yml) [![codecov](https://codecov.io/gh/vikpe/chromato/branch/main/graph/badge.svg)](https://codecov.io/gh/vikpe/chromato)\n\n\u003cbr\u003e\n\n\u003c/div\u003e\n\n* [**Color spaces**](#color-spaces): CMYK, HEX, RGB, HSL, HSV\n* [**Color class**](#color-class): Convenience class for color manipulation\n* [**Operations**](#operations): shade, tone, tint, grayscale, invert, complement, add, subtract, multiply\n* [**Conversion**](#conversion): Convert any color space to any color space\n* [Parsing](#parsing)\n* [Validation](#validation)\n* (zero dependecies!)\n\n\u003cbr\u003e\n\n# Install\n\n```shell\npip install chromato\n```\n\n\u003cbr\u003e\n\n# Example usage\n\n**Color class**\n\n```python\nfrom chromato.spaces import Color\n\nred = Color(255, 0, 0)\n\nred.cmyk  # CMYK(c=0, m=100, y=100, k=0)\nred.hex   # HEX(ff0000)\nred.rgb   # RGB(r=255, g=0, b=0)\nred.hsl   # HSL(h=0, s=1, l=0.5)\nred.hsv   # HSV(h=0, s=1, v=1)\n```\n\n**Operations**\n\n```python\nfrom chromato import operations\nfrom chromato.spaces import RGB\n\nred = RGB(255, 0, 0)\nblue = RGB(0, 0, 255)\n\noperations.add(red, blue)        # RGB(r=255, g=0, b=255)\noperations.blend(red, blue).rgb  # RGB(r=128, g=0, b=128)\noperations.invert(red).rgb       # RGB(r=0, g=255, b=255)\noperations.tint(red, 0.1).rgb    # RGB(r=255, g=26, b=26)\n```\n\n**Conversion**\n\n```python\nfrom chromato import convert\n\nconvert.rgb_to_hex(255, 0, 0)  # HEX(ff0000)\nconvert.hex_to_rgb(\"ff0000\")   # RGB(r=255, g=0, b=0)\nconvert.hex_to_cmyk(\"f0f\")     # CMYK(c=0, m=100, y=0, k=0)\n```\n\n\u003cbr\u003e\n\n# API\n\n## Color spaces\n\nName | Properties | Range\n---|---|---\nCMYK | `c`, `m`, `y`, `k` | `0-100`, `0-100`, `0-100`, `0-100`\nHEX | (is a string) | `000000-ffffff`\nHSL | `h`, `s`, `l` |  `0-1`, `0-1`, `0-1`\nHSV | `h`, `s`, `v` |  `0-1`, `0-1`, `0-1`\nRGB | `r`, `g`, `b` | `0-255`, `0-255`, `0-255`\n\n```python\nfrom chromato.spaces import CMYK, HEX, HSL, HSV, RGB\n\nred_cmyk = CMYK(0, 100, 100, 0)\nred_hex  = HEX(\"ff0000\")\nred_hsl  = HSL(0, 1, 0.5)\nred_hsv  = HSV(0, 1, 1)\nred_rgb  = RGB(255, 0, 0)\n```\n\n## Color class\n\n**Properties**\n\n```python\nfrom chromato.spaces import Color\n\nred = Color(255, 0, 0)\n\nred.cmyk  # CMYK(c=0, m=100, y=100, k=0)\nred.hex   # HEX(ff0000)\nred.hsl   # HSL(h=0, s=1, l=0.5)\nred.hsv   # HSV(h=0, s=1, v=1)\nred.rgb   # RGB(r=255, g=0, b=0)\n```\n\n**Construct**\n\n```python\n# examples below are equal\nColor(255, 0, 0)\nColor((255, 0, 0))\nColor([255, 0, 0])\nColor({\"r\": 255, \"g\": 0, \"b\": 0})\nColor(\"ff0000\")\nColor(\"ff0\")\nColor(Color(255, 0, 0))\nColor(RGB(255, 0, 0))\nColor(HEX(\"ff0\"))\nColor(HSV(0, 1, 1))\nColor(HSL(0, 1, 0.5))\nColor(CMYK(0, 100, 100, 0))\n```\n\n## Operations\n\nEach operation take one or several color values and returns a `Color` instance.\n\nOperation | Description\n--- | ---\n**`add`**`(color1, color2)` | Add colors\n**`blend`**`(color1, color2, factor)` | Blend/mix colors\n**`complement`**`(color)` | Complementary color\n**`hsv_mod`**`(color, hue_shift, saturation_shift, value_shift)` | HSV modification\n**`invert`**`(color)` | Invert color\n**`multiply`**`(color1, color2)` | Multiply colors\n**`shade`**`(color, factor)` | Increase darkness (blend with black)\n**`subtract`**`(color1, color2)` | Subtract colors\n**`tint`**`(color, factor)` | Increase lightness (blend with white)\n**`tone`**`(color, factor)` | Reduce colorfullness (blend with gray)\n\n* **Arguments**: `color\u003cany\u003e`, `factor \u003cfloat\u003e [0-1]`\n* **Returns**: instance of `Color`\n\n**Example**\n\n```python\nfrom chromato.spaces import RGB\nfrom chromato.operations import blend, invert\n\nwhite = RGB(255, 255, 255)\nblack = RGB(0, 0, 0)\n\nblend(white, black).rgb       # RGB(r=128, g=128, b=128)\nblend(white, black, 0.2).rgb  # RGB(r=204, g=204, b=204)\nblend(white, black, 0.8).rgb  # RGB(r=51, g=51, b=51)\n\ninvert(black).rgb             # RGB(r=255, g=255, b=255)\ninvert((255, 0, 0)).cmyk      # CMYK(c=0, m=100, y=100, k=0)\ninvert(\"ff0000\").hex          # HEX(00ffff)\n```\n\n## Conversion\n\nConvert any color space to any color space.\n\n🔀 | RGB | HEX | CMYK | HSL | HSV\n--- | --- | --- | --- | --- | ---\nRGB | \u003c!-- null --\u003e | `hex_to_rgb` | `cmyk_to_rgb` | `hsl_to_rgb` | `hsv_to_rgb`\nHEX | `rgb_to_hex` | \u003c!-- null --\u003e | `cmyk_to_hex` | `hsl_to_hex` | `hsv_to_hex`\nCMYK | `rgb_to_cmyk` | `hex_to_cmyk` | \u003c!-- null --\u003e | `hsl_to_cmyk` | `hsv_to_cmyk`\nHSL | `rgb_to_hsl` | `hex_to_hsl` | `cmyk_to_hsl` | \u003c!-- null --\u003e | `hsv_to_hsl`\nHSV | `rgb_to_hsv` | `hex_to_hsv` | `cmyk_to_hsv` | `hsl_to_hsv` | \u003c!-- null --\u003e\n\n**Example**\n\n```python\nfrom chromato import convert\n\nconvert.rgb_to_cmyk(255, 0, 0)  # CMYK(c=0, m=100, y=100, k=0)\nconvert.rgb_to_hex(255, 0, 0)   # HEX(ff0000)\nconvert.rgb_to_hex(255, 0, 0)   # HEX(ff0000)\nconvert.rgb_to_hsl(255, 0, 0)   # HSL(h=0, s=1, l=0.5)\nconvert.rgb_to_hsv(255, 0, 0)   # HSV(h=0, s=1, v=1)\n```\n\n## Parsing\n\nEach parse function takes any kind of value and tries to parse it.\n\nFunction | Returns | Description\n--- | --- | ---\n**`parse_cmyk`**`(value)` | `tuple(c,m,y,k)` |  Parse value as CMYK\n**`parse_hex`**`(value)` | `str(hex)` |  Parse value as HEX\n**`parse_hsl`**`(value)` | `tuple(h,l,s)` |  Parse value as HSL\n**`parse_hsv`**`(value)` | `tuple(h,s,v)` |  Parse value as HSV\n**`parse_rgb`**`(value)` | `tuple(r,g,b)` |  Parse value as RGB\n\n**Example**\n\n```python\nfrom chromato import parse\nfrom chromato.spaces import Color, HEX, RGB\n\nparse.parse_hex(\"f\")                 # \"ffffff\"\nparse.parse_hex(\"f60\")               # \"ff6600\"\nparse.parse_hex(\"ff6600\")            # \"ff6600\"\nparse.parse_hex(\" #ff6600 \")         # \"ff6600\"\nparse.parse_hex(333)                 # \"333333\"\nparse.parse_hex(HEX(\"ff6600\"))       # \"ff6600\"\nparse.parse_hex(RGB(255, 102, 0))    # \"ff6600\"\nparse.parse_hex(Color(255, 102, 0))  # \"ff6600\"\n```\n\n## Validation\n\nEach validation function validates type and range. Returns `True`/`False`.\n\n```python\nfrom chromato import validation\n\nvalidation.is_cmyk(c, m, y, k)\nvalidation.is_hex(hex)\nvalidation.is_hsl(h, s, l)\nvalidation.is_hsv(h, s, v)\nvalidation.is_rgb(r, g, b)\n```\n\n\u003cbr\u003e\n\n# Development\n\n**Setup**\n\n1. Install [poetry](https://github.com/python-poetry/poetry)\n2. `poetry install`\n\n**Tests**\n\nRun tests on changes in source code or tests.\n\n```shell\npoetry run ptw --clear --runner \"poetry run pytest --cov -vv\" \n```\n\n**Code formatting (black)**\n\n```shell\npoetry run black . \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvikpe%2Fchromato","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvikpe%2Fchromato","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvikpe%2Fchromato/lists"}