{"id":28202556,"url":"https://github.com/saelsa/color-utils","last_synced_at":"2026-03-06T13:03:55.218Z","repository":{"id":290778929,"uuid":"975530228","full_name":"saelsa/color-utils","owner":"saelsa","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-06T11:31:20.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-03T02:20:44.793Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saelsa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-04-30T13:16:19.000Z","updated_at":"2025-06-06T11:26:32.000Z","dependencies_parsed_at":"2025-04-30T14:51:33.526Z","dependency_job_id":"582e8069-f4dc-46fd-8e17-386f300781b1","html_url":"https://github.com/saelsa/color-utils","commit_stats":null,"previous_names":["saelsa/color-utils"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/saelsa/color-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saelsa%2Fcolor-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saelsa%2Fcolor-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saelsa%2Fcolor-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saelsa%2Fcolor-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saelsa","download_url":"https://codeload.github.com/saelsa/color-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saelsa%2Fcolor-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30178286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T12:39:21.703Z","status":"ssl_error","status_checked_at":"2026-03-06T12:36:09.819Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2025-05-17T00:14:19.555Z","updated_at":"2026-03-06T13:03:55.210Z","avatar_url":"https://github.com/saelsa.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# color-utils\n\nA simple utility library for working with colors in javascript. \n\n## Installation\n\nYou can install this package from JSR:\n\n```bash\nnpx jsr add @iltsp/color-utils\n```\n\nOr with npm:\n\n```bash\nnpm install @iltsp/color-utils\n```\n\n## Usage\n\n### Adjust colors \n\n```javascript\nimport { adjustColor } from '@iltsp/color-utils';\n\n// Lighten color (HEX)\nadjustColor(\"#6496C8\", 0.1); // \"rgb(110, 165, 220)\"\n\n// Lighten color (RGB)\nadjustColor(\"rgb(100, 150, 200)\", 0.1); // \"rgb(110, 165, 220)\"\n\n// Lighten color (CSS Variable)\nadjustColor(\"--test-color\", 0.1); // \"rgb(110, 165, 220)\"\n\n// Darken color (HEX)\nadjustColor(\"#6496C8\", -0.1); // \"rgb(90, 135, 180)\"\n\n// Darken color (RGB)\nadjustColor(\"rgb(100, 150, 200)\", -0.1); // \"rgb(90, 135, 180)\"\n\n// Darken color (CSS Variable)\nadjustColor(\"--test-color\", -0.1); // \"rgb(90, 135, 180)\"\n\n```\n\n## API Reference\n\n### adjustColor(color, percent, getStyle)\n\n Adjusts the brightness of a color by a given percentage. It can either lighten or darken the color.\n\n#### Parameters\n\n- `color` (string): The color to adjust, in either RGB or HEX or as CSS variable.\n- `percent` (number): The percentage to adjust the color by. Positive values lighten the color, negative values darken the color. The value should be between -1 and 1.\n- `getStyle`(function): A function to get the computed style of the document. This is used to retrieve the value of CSS variables. By default, it uses `getComputedStyle(document.documentElement)`.\n\n\n#### Returns\n\n- (string): The adjusted color in RGB format.\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaelsa%2Fcolor-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaelsa%2Fcolor-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaelsa%2Fcolor-utils/lists"}