{"id":16338340,"url":"https://github.com/neeasade/colort","last_synced_at":"2025-03-22T23:32:32.825Z","repository":{"id":79962223,"uuid":"49753786","full_name":"neeasade/colort","owner":"neeasade","description":"colort[int]","archived":false,"fork":false,"pushed_at":"2020-02-04T22:12:13.000Z","size":31,"stargazers_count":29,"open_issues_count":0,"forks_count":2,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-18T15:48:39.242Z","etag":null,"topics":["c","colors","rice"],"latest_commit_sha":null,"homepage":"","language":"C","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/neeasade.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}},"created_at":"2016-01-16T01:22:18.000Z","updated_at":"2023-10-26T02:40:03.000Z","dependencies_parsed_at":"2023-03-26T14:17:56.831Z","dependency_job_id":null,"html_url":"https://github.com/neeasade/colort","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/neeasade%2Fcolort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neeasade%2Fcolort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neeasade%2Fcolort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neeasade%2Fcolort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neeasade","download_url":"https://codeload.github.com/neeasade/colort/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245036127,"owners_count":20550662,"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":["c","colors","rice"],"created_at":"2024-10-10T23:50:17.454Z","updated_at":"2025-03-22T23:32:32.812Z","avatar_url":"https://github.com/neeasade.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## colort[int]\n\nA small program for 'tinting' colors by values. Also supports inverting colors.\n\ncommand                             | output\n------------------------------------|-------\n`colort 1 \"#000000\"`                | `#010101`\n`colort -l 1 \"#FFFFFF\"`             | `#FFFFFF`\n`colort -l 1 \"#FFFFFF\"`             | `#FFFFFF`, exit status 0\n`colort -i \"#000000\"`               | `#FFFFFF`\n`colort 60 \"#000000\"`               | `#3C3C3C`\n`colort -60 \"#000000\"`              | `#C4C4C4`\n`colort -s 4 1 \"spam000000spam\"`    | `spam010101spam`\n`colort -t -s 4 1 \"spam000000spam\"` | `010101`\n`colort -t \"ff000000\"`              | `000000`\n`colort -r 1 \"#000000\"`             | `#010000`\n\n\n### Notes:\n\n- The color is assumed to be the last 6 chars of the input string (can be changed with `-s`)\n- If the tint value is omitted, defaults to 0.\n- The `-l` flag limits color tinting by not letting values roll around.\n    - if 2 or more of RGB is limited when this is turned on, exit status of 1.\n- The `-i` flag inverts colors.\n- The `-s` flag selects the index in the input string to start getting color from.\n- The `-t` flag makes the output only the color string\n- The `-c` flag calculates the contrast of the color. If this evaluates to black, exit status 0. If white, exit status 1.\n- If the -r, -g, or -b flags are used, red, green, or blue are affected by the operation respectively.\n- The tint value can be within the set of values supported by a `long` datatype.\n\n\n### Example use cases:\n\nInvert a background color to have readable text on any background:\n\n![1](https://u.teknik.io/nS1O3.png) | ![2](https://u.teknik.io/jHTr9.png) | ![3](https://u.teknik.io/JLLZ2.png)\n------------------------------------|-------------------------------------|------------------------------------\n\nAuto-determine select and icon colors for GTK themes based on the background (using oomox and acyl in these examples)\n- `Select_color=\"$(colort -c \"$BG\" \u0026\u0026 colort 25 \"$BG\" || colort -25 \"$BG\")\"`\n    - If the background contrast is 'dark', tint up, else tint down.\n- `Icon_color=\"$(colort -c \"$BG\" \u0026\u0026 colort -l 80 \"$BG\" || colort -l -80 \"$BG\")\"`\n    - the same logic, but tinted further to make icons more bold, and a flag to top out at white or black.\n\n![1](https://u.teknik.io/d90oe.png) | ![2](https://u.teknik.io/TQjth.png) | ![3](https://u.teknik.io/5rUdv.png)\n------------------------------------|-------------------------------------|------------------------------------\n\nIf for some reason we wanted everything to have a blue tint, we can wrap both the above calls with a `colort -b 40`:\n\n![1](https://u.teknik.io/TcvZm.png) | ![2](https://u.teknik.io/EVX9y.png) | ![3](https://u.teknik.io/swKON.png)\n------------------------------------|-------------------------------------|------------------------------------\n\nInput background colors used for the examples: `282828`, `AB4642`, `D8D8D8` from base16 colorsets.\n\n\n### TODO\n\n- consider accepting input from STDIN\n- update the man page\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneeasade%2Fcolort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneeasade%2Fcolort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneeasade%2Fcolort/lists"}