{"id":37074513,"url":"https://github.com/prdx23/acrylic","last_synced_at":"2026-01-14T08:47:13.017Z","repository":{"id":57408017,"uuid":"272536338","full_name":"prdx23/acrylic","owner":"prdx23","description":"Acrylic is a simple and intuitive library to work with colors in python","archived":false,"fork":false,"pushed_at":"2022-06-03T08:48:03.000Z","size":67,"stargazers_count":18,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-31T19:32:59.695Z","etag":null,"topics":["color","color-palette","color-scheme","color-schemes","colors","colour","colours","hsl","hsv","palettes","rgb","ryb"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/acrylic/","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/prdx23.png","metadata":{"files":{"readme":"README.md","changelog":"changelog","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-15T20:23:24.000Z","updated_at":"2024-05-23T21:46:33.000Z","dependencies_parsed_at":"2022-09-26T17:10:48.135Z","dependency_job_id":null,"html_url":"https://github.com/prdx23/acrylic","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/prdx23/acrylic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prdx23%2Facrylic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prdx23%2Facrylic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prdx23%2Facrylic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prdx23%2Facrylic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prdx23","download_url":"https://codeload.github.com/prdx23/acrylic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prdx23%2Facrylic/sbom","scorecard":{"id":744232,"data":{"date":"2025-08-11","repo":{"name":"github.com/prdx23/acrylic","commit":"6bf062192914eaa864c5ce11d7a36c1f75ac5c9b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"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":-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":"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.3.1 not signed: https://api.github.com/repos/prdx23/acrylic/releases/68527537","Warn: release artifact v0.3.0 not signed: https://api.github.com/repos/prdx23/acrylic/releases/49706498","Warn: release artifact v0.2.1 not signed: https://api.github.com/repos/prdx23/acrylic/releases/27690554","Warn: release artifact v0.2 not signed: https://api.github.com/repos/prdx23/acrylic/releases/27575512","Warn: release artifact v0.3.1 does not have provenance: https://api.github.com/repos/prdx23/acrylic/releases/68527537","Warn: release artifact v0.3.0 does not have provenance: https://api.github.com/repos/prdx23/acrylic/releases/49706498","Warn: release artifact v0.2.1 does not have provenance: https://api.github.com/repos/prdx23/acrylic/releases/27690554","Warn: release artifact v0.2 does not have provenance: https://api.github.com/repos/prdx23/acrylic/releases/27575512"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: tests/Dockerfile:1: pin your Docker image by updating ubuntu:20.04 to ubuntu:20.04@sha256:8feb4d8ca5354def3d8fce243717141ce31e2c428701f6682bd2fafe15388214","Warn: pipCommand not pinned by hash: tests/Dockerfile:3-7","Info:   0 out of   1 containerImage 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":"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"}}]},"last_synced_at":"2025-08-22T18:17:46.936Z","repository_id":57408017,"created_at":"2025-08-22T18:17:46.937Z","updated_at":"2025-08-22T18:17:46.937Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414693,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["color","color-palette","color-scheme","color-schemes","colors","colour","colours","hsl","hsv","palettes","rgb","ryb"],"created_at":"2026-01-14T08:47:11.969Z","updated_at":"2026-01-14T08:47:12.988Z","avatar_url":"https://github.com/prdx23.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://user-images.githubusercontent.com/15089721/85012237-5cdae100-b180-11ea-8fc2-9946de05653b.png\" alt=\"logo\" width=70% /\u003e\n\n![PyPI](https://img.shields.io/pypi/v/acrylic)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/acrylic)\n![PyPI - License](https://img.shields.io/pypi/l/acrylic)\n\nHave you ever wanted a simple and intuitive way to work with colors in python? Then this library is for you! `acrylic` is a python package that you can use to manage colors, convert between different color formats, and work with color schemes and palettes.\n\nCurrently supported color formats are:  \n`rgb`, `hsl`, `hsv`, `ryb`, `hex`, `name`\n\nSmall example:  \n```python\nfrom acrylic import Color, RANDOM\n\n#  Define a color using rgb values\norange = Color(rgb=[247, 177, 79])\n\n#  Use saturation from that color to create a new random color with hsv\nrandom_color = Color(hsv=[RANDOM, orange.hsv.s, 98])\n\n#  Print the random color's value in hex\nprint(random_color.hex)  # Output: '#50FAF0'\n```\ncheck out [more examples](https://github.com/prdx23/acrylic#example-usecases)\nbelow.\n\n`acrylic` also has support for [color\nschemes](https://github.com/prdx23/acrylic/wiki/Color-Schemes), support for more\ncolor schemes and functions to generate color palettes will be added in the\nfuture.\n```python\ncomplementary = cyan.scheme(Schemes.COMPLEMENTARY)\nshades = cyan.scheme(Schemes.SHADES)\ncolor_palette = [cyan, *complementary, *shades]\n```\nMore about color schemes [here](https://github.com/prdx23/acrylic/wiki/Color-Schemes)\n\n## How to Install\n`acrylic` can be installed using pip:\n```shell\npip install acrylic\n```\nIt has no dependencies and works with Python \u003e=3.6\n\n## Documentation\n\n### Defining Colors\n\nYou can create a new color like this:\n```python\nfrom acrylic import Color\ncyan = Color(rgb=[83, 237, 229])\n```\n\nThe same syntax can be used to give input in any of the supported color formats. Currently supported formats are `rgb`, `hsv`, `hsl`, `hex` and `ryb`. Example:\n```python\ncolor = Color(rgb=[127, 255, 212])\ncolor = Color(hsl=[160, 100, 75])\ncolor = Color(hsv=[160, 50, 100])\ncolor = Color(hex='#7fffd4')\ncolor = Color(name='aquamarine')\ncolor = Color(ryb=[0, 77, 128])\n```\n- All values for `rgb` and `ryb` should be between `0` - `255`  \n- The value of hue for `hsv` and `hsl` should be between `0.0` - `360.0` and the other two components should be between `0.0` - `100.0`.  \n- Values for `hex` should be a string representing 6-digit hex number  \n- Values for `name` should be a string representing a valid CSS3 color name  \n\n### Converting between color formats\n\nAny instance of `Color()` is automatically converted to every supported color format when its created, so there is no need to manually convert from one format to another. For any color, no matter how it was created, you can get its value in any format like this:\n\n```python\ncyan = Color(rgb=[83, 237, 229])\nprint(cyan.rgb)\nprint(cyan.hsv)\nprint(cyan.hsl)\nprint(cyan.hex)\nprint(cyan.name)\nprint(cyan.ryb)\n```\n\nThis makes converting from say `rgb` to `hsl` as easy as doing:\n```python\nhsl_values = Color(rgb=[83, 237, 229]).hsl\n```\n\n### Accessing values of colors\n\nWhen accessing these attributes for a color, it returns the values back as a `namedtuple` instance. This behaves exactly as a normal `tuple` would, but has an added benefit that its values can be accessed directly via the dot notation. Example:\n```python\n\u003e\u003e\u003e cyan = Color(rgb=[83, 237, 229])\n\u003e\u003e\u003e cyan.rgb  # returns a namedtuple containing the values\nRgb(r=83, g=237, b=229)\n\u003e\u003e\u003e [x for x in cyan.rgb]  # can be iterated over like a normal tuple\n[83, 237, 229]\n\u003e\u003e\u003e cyan.rgb[1]  # items can be accessed via index\n237\n\u003e\u003e\u003e r, g, b = cyan.rgb  # items can be unpacked\n\u003e\u003e\u003e cyan.rgb.r, cyan.rgb.g  # items can also be accessed via their name\n(83, 237)\n```\n\n\n### Additional ways to define a color\n\nIn addition to the default way to create a color, `Color()` offers additional methods that would enhance your ability to create colors. \n\nFor example, to create a random color:\n```python\nfrom acrylic import Color, RANDOM\nrandom_color = Color(rgb=RANDOM)\n```\n\nCreating a color with a random hue, but fixed saturation and value:\n```python\nrandom_hue = Color(hsv=[RANDOM, 65, 95])\n```\n(for aesthetically pleasing random colors, check [example 2](https://github.com/prdx23/acrylic#example-usecases) below)\n\nAny of the components can be given as a list of 2 values like `[a, b]` instead of a single value. When given a range, a value `a \u003c= value \u003c= b` will randomly be picked for that component. For example to create a cyan color where saturation is randomly picked between 30 to 70:\n```python\nrandom_cyan = Color(hsv=[176, (30, 70), 95])\n```\n\nGiving both values for a range isn't required, you can use this to just set the upper or lower limit by setting the other half to `RANDOM`:\n```python\nrandom_cyan = Color(hsv=[176, (RANDOM, 70), 95])\nrandom_cyan = Color(hsv=[176, (30, RANDOM), 95])\n```\n\n### Note: Immutability and Hashibility\n\n- All instances of colors are immutable, meaning their values can't be changed once they are defined. This means that each instance of `Color()` represents a specific color and will always represent that color. If you feel the need to modify a color, this can easily be done as:\n  ```python\n  old_color = Color(rgb=[83, 237, 229])\n  #  change hue, but not saturation or value\n  new_color = Color(hsv=[230, old_color.hsv.s, old_color.hsv.v])\n  ```\n- All instances of colors are also hashable. They can be safely used as keys for `dict()`s and can be added to `set()` to efficiently find unique colors or to test membership.\n  ```python\n  \u003e\u003e\u003e colors = {Color(hex='#7fffd4'): 'Can be used in dict() keys!'}\n  \u003e\u003e\u003e Color(name='aquamarine') in colors\n  True\n  \u003e\u003e\u003e colors[Color(rgb=[127, 255, 212])]\n  'Can be used in dict() keys!'\n  ```\n- As a result of colors being immutable and hashable, colors that represent the same `RGB` values will always be unambiguously equal to each other. This prevents a lot of bugs that can randomly appear when working with float `hsv`/`hsl` values and removes the inconsistencies in the conversion algorithm that converts between `rgb` and `hsv`/`hsl`. An example that demonstrates this:\n  ```python\n  \u003e\u003e\u003e Color(hsl=[236.94, 9.29, 84.54]) == Color(hsl=[240.0, 8.86, 84.51])\n  True\n  ```\n  This results in `True` because both of these `hsl` values map to the same `rgb` value `(212, 212, 219)` and thus represent the same color.\n\n### Color schemes\n\nThe `Color()` class also provides some convenience functions to work with color schemes. In the future, these would also be used to build color palettes. For now, the corresponding colors from a color scheme for a specific color can be generated like this:\n```python\nfrom acrylic import Color, Schemes\ncyan = Color(rgb=[83, 237, 229])\n\ncomplementary_color = cyan.scheme(Schemes.COMPLEMENTARY)\ncyan_triads = cyan.scheme(Schemes.TRIADIC)\ncyan_shades = cyan.scheme(Schemes.SHADES)\n```\n\nTaking inspiration from traditional art where most of these color schemes originated from, these are calculated using the `ryb`(red-yellow-blue) color wheel by default. To use the `rgb`(red-green-blue) color wheel instead you can pass `in_rgb=True` to the `.scheme()` function. \n\nFor a list of all the available color schemes and their explanations, check **[this page](https://github.com/prdx23/acrylic/wiki/Color-Schemes)**.\n\n## Example Usecases\n\n1. Create a color using `RGB`, use its saturation to create a new color, and print its value as a hex string:\n    ```python\n    orange = Color(rgb=[247, 177, 79])\n    cyan = Color(hsv=[176.5, orange.hsv.s, 98])\n    print(cyan.hex)  # Output: '#50FAF0'\n    ```\n\n2. Generating random aesthetically pleasing colors, which for example can be used to color the default profile pictures for users of an app\n    ```python\n    def aesthetic_color():\n        return Color(hsl=[RANDOM, (65, RANDOM), (60, 75)])\n    ```\n    (If you have ever tried generating random colors by randomizing `rgb` values, you would know how badly that works)\n\n3. Finding unique colors:\n    ```python\n    test_set = set([\n        Color(rgb=[61, 245, 245]), Color(hex='#3DF5F5'),\n        Color(hsl=[180, 89.8, 60]), Color(hsl=[179.8, 90.2, 60.1]) \n    ])\n    print(test_set)  # Output: {Color(rgb=(61, 245, 245))}\n    ```\n    The set contains only one color as all those colors map to the same `rgb` values.\n\n4. Sorting all the pixels in an image horizontally by hue: \n    ```python\n    from acrylic import Color\n    from PIL import Image\n\n    orignal_image = Image.open('test.jpg')\n    sorted_img = orignal_image.copy()\n    pixels = orignal_image.load()\n\n    for y in range(sorted_image.height):\n          row = [Color(rgb=pixels[n, y]) for n in range(sorted_image.width)]\n          sorted_row = sorted(row, key=lambda c: c.hsl.h)\n          for x, c in enumerate(sorted_row):\n              sorted_image.putpixel((x, y), c.rgb)\n    ```\n    This example also illustrates how easy it is to integrate `acrylic` with other libraries and seamlessly switch between `rgb` and `hsl`\n\n## Contributions\nAll contributions to `acrylic` are welcome and appreciated! Ways in which you can contribute are:\n- Report an issue ([here](https://github.com/prdx23/acrylic/issues))\n- Raise a pull request ([here](https://github.com/prdx23/acrylic/pulls))\n- Request new features\n- Spread the word about `acrylic`!\n\n## License\n**MIT License**: Copyright (c) 2020 - 2022 Arsh  \n[License.txt](https://github.com/prdx23/acrylic/blob/master/LICENSE.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprdx23%2Facrylic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprdx23%2Facrylic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprdx23%2Facrylic/lists"}