{"id":21451860,"url":"https://github.com/dyuri/repacolors","last_synced_at":"2025-07-14T22:30:43.959Z","repository":{"id":57461168,"uuid":"230329309","full_name":"dyuri/repacolors","owner":"dyuri","description":"Small library for color conversion, manipulation, etc.","archived":false,"fork":false,"pushed_at":"2021-09-15T09:25:00.000Z","size":304,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-12T07:45:22.162Z","etag":null,"topics":["colors","colorspaces"],"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/dyuri.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":"2019-12-26T21:18:01.000Z","updated_at":"2022-10-24T17:16:06.000Z","dependencies_parsed_at":"2022-09-17T08:11:10.799Z","dependency_job_id":null,"html_url":"https://github.com/dyuri/repacolors","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyuri%2Frepacolors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyuri%2Frepacolors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyuri%2Frepacolors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyuri%2Frepacolors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dyuri","download_url":"https://codeload.github.com/dyuri/repacolors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226001056,"owners_count":17557893,"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":["colors","colorspaces"],"created_at":"2024-11-23T04:26:25.121Z","updated_at":"2024-11-23T04:26:25.705Z","avatar_url":"https://github.com/dyuri.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# repacolors\n\nSmall library for color conversion, manipulation, etc.\n\n[![Build Status](https://travis-ci.com/dyuri/repacolors.svg?branch=master)](https://travis-ci.com/dyuri/repacolors)\n\n![demo](./demo.svg)\n\n## Install\n\n```shell\n$ pip install repacolors\n```\n\nTo get the colors from `Xrdb`, install it with the `xextras` extras:\n\n```shell\n$ pip install repacolors[xextras]\n```\n\n## `repacolor` command\n\n```shell\n$ repacolor --help\nUsage: repacolor [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  adjust-contrast  Adjust the colors to match required contrast ratio.\n  colorwheel       Display colorwheel defined by `name` or created by the...\n  display          Display information about the provided colors.\n  palette          Get colors of given palette\n  pick             Pick colors from your desktop.\n  scale            Display color scale defined by the colors provided.\n```\n\n### `display`\n\nDisplay color information in the terminal.\n\n```shell\n$ repacolor display red\n\n+--------+ red - #ff0000\n|  BIG   | rgb(255, 0, 0)\n|  RED   | hsl(0, 100%, 50%)\n| SQUARE | lab(53.24% 80.09 67.2)\n+--------+\n\n$ repacolor display \"#ffaad5\" \"rgb(128, 12, 46, .8)\"\n... (displays both colors)\n$ echo \"#ffffff\" | repacolor display\n... (displays `white`)\n```\n\n### `pick`\n\nExecutes color picker and displays the picked color.\n\n```shell\n$ repacolor pick\n```\n\nThe integrated color picker works under _X11/linux_ if installed with *xextras*. If you want to use an external color picker, set the `COLORPICKER` environment variable:\n\n```shell\n$ export COLORPICKER=xcolor\n$ repacolor pick\n```\n\nIf a color scheme is provided via the `-s` option, a color wheel for that scheme is drawn to pick a color from.\n\n### `palette`\n\nDisplay the colors of the palette. If no palette name provided, it shows the palettes available.\n\n```shell\n$ repacolor palette\nList of available palette names:\nryb, rybw3, orrd, pubu, ...\n\n$ repacolor palette viridis\n#440154\n#482777\n...\n```\n\n### `scale`\n\nDisplay a color scale defined by the input colors.\n\n```shell\n$ repacolor scale red white\n[colors from red to white]\n$ repacolor palette viridis | repacolor scale\n[color scale defined by `viridis` colors]\n```\n\n### `colorwheel`\n\nDisplay a color wheel.\n\nPre defined color wheels:\n\n- `ryb` - The RYB color wheel\n- `rgb` or `hsl` - The RGB color wheel\n- `lab` or `lch` - CIELAB color wheel\n\nIf no color wheel name provided, it will create one from the colors provided on `stdin`.\n\n```shell\n$ repacolor colorwheel rgb\n[RGB color wheel]\n$ repacolor scale red white black red | repacolor colorwheel\n[red - white - black color wheel]\n```\n\n### `adjust-contrast`\n\nAdjust the colors to match required contrast ratio.\n\nIf only one color is provided, chooses black or white based on the color's luminance.\n\nIf two colors are provided, tries to lighten/darken them to fulfill the contrast requirement. Starts to adjust the first color, then if it's not enough continues with the other.\n\nDefault contrast is 4.5 (WCAG AA). [More info on MDN.](https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_WCAG/Perceivable/Color_contrast)\n\n```shell\n$ repacolor adjust-contrast red --format=lhex\n#ff0000\n#000000  # chooses black for red\n$ repacolor adjust-contrast \"#555\" \"#5e8d87\" --format=lhex\n#1d1d1d  # #555 adjusted to be darker\n#5e8d87\n$ repacolor adjust-contrast \"#5e8d87\" \"#555\" --format=lhex\n#b6cfcc  # #5e8d87 lightened\n#555555\n$ repacolor adjust-contrast \"#5e8d87\" \"#555\" -v\nColors adjusted. (2.0007 =\u003e 4.5224)\n  #5e8d87   =\u003e   #b6cfcc\n  #555555   =\u003e   #555555\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyuri%2Frepacolors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdyuri%2Frepacolors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyuri%2Frepacolors/lists"}