{"id":15630735,"url":"https://github.com/qix-/color-string","last_synced_at":"2025-05-14T03:09:17.033Z","repository":{"id":41366169,"uuid":"1920376","full_name":"Qix-/color-string","owner":"Qix-","description":"Parser and generator for CSS color strings","archived":false,"fork":false,"pushed_at":"2025-02-14T13:03:06.000Z","size":74,"stargazers_count":218,"open_issues_count":4,"forks_count":66,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-12T15:53:28.273Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Qix-.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2011-06-19T19:03:02.000Z","updated_at":"2025-05-12T02:49:42.000Z","dependencies_parsed_at":"2025-02-21T21:01:38.827Z","dependency_job_id":"b56099d8-b99b-4ced-898f-0bb22e757f2c","html_url":"https://github.com/Qix-/color-string","commit_stats":{"total_commits":113,"total_committers":30,"mean_commits":"3.7666666666666666","dds":0.8407079646017699,"last_synced_commit":"d9b04bb2989b2279079ed1b48ac2e9d61291ef64"},"previous_names":["harthur/color-string"],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qix-%2Fcolor-string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qix-%2Fcolor-string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qix-%2Fcolor-string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qix-%2Fcolor-string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Qix-","download_url":"https://codeload.github.com/Qix-/color-string/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254059508,"owners_count":22007768,"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":[],"created_at":"2024-10-03T10:36:01.781Z","updated_at":"2025-05-14T03:09:17.016Z","avatar_url":"https://github.com/Qix-.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# color-string\n\n\u003e library for parsing and generating CSS color strings.\n\n## Install\n\n```sh\nnpm install color-string\n```\n\n## Usage\n\n### Parsing\n\n```js\ncolorString.get('#FFF')                          // {model: 'rgb', value: [255, 255, 255, 1]}\ncolorString.get('#FFFA')                         // {model: 'rgb', value: [255, 255, 255, 0.67]}\ncolorString.get('#FFFFFFAA')                     // {model: 'rgb', value: [255, 255, 255, 0.67]}\ncolorString.get('hsl(360, 100%, 50%)')           // {model: 'hsl', value: [0, 100, 50, 1]}\ncolorString.get('hsl(360 100% 50%)')             // {model: 'hsl', value: [0, 100, 50, 1]}\ncolorString.get('hwb(60, 3%, 60%)')              // {model: 'hwb', value: [60, 3, 60, 1]}\n\ncolorString.get.rgb('#FFF')                      // [255, 255, 255, 1]\ncolorString.get.rgb('blue')                      // [0, 0, 255, 1]\ncolorString.get.rgb('rgba(200, 60, 60, 0.3)')    // [200, 60, 60, 0.3]\ncolorString.get.rgb('rgba(200 60 60 / 0.3)')     // [200, 60, 60, 0.3]\ncolorString.get.rgb('rgba(200 60 60 / 30%)')     // [200, 60, 60, 0.3]\ncolorString.get.rgb('rgb(200, 200, 200)')        // [200, 200, 200, 1]\ncolorString.get.rgb('rgb(200 200 200)')          // [200, 200, 200, 1]\n\ncolorString.get.hsl('hsl(360, 100%, 50%)')       // [0, 100, 50, 1]\ncolorString.get.hsl('hsl(360 100% 50%)')         // [0, 100, 50, 1]\ncolorString.get.hsl('hsla(360, 60%, 50%, 0.4)')  // [0, 60, 50, 0.4]\ncolorString.get.hsl('hsl(360 60% 50% / 0.4)')    // [0, 60, 50, 0.4]\n\ncolorString.get.hwb('hwb(60, 3%, 60%)')          // [60, 3, 60, 1]\ncolorString.get.hwb('hwb(60, 3%, 60%, 0.6)')     // [60, 3, 60, 0.6]\n\ncolorString.get.rgb('invalid color string')      // null\n```\n\n### Generation\n\n```js\ncolorString.to.hex(255, 255, 255)     // \"#FFFFFF\"\ncolorString.to.hex(0, 0, 255, 0.4)    // \"#0000FF66\"\ncolorString.to.hex(0, 0, 255, 0.4)    // \"#0000FF66\"\ncolorString.to.rgb(255, 255, 255)     // \"rgb(255, 255, 255)\"\ncolorString.to.rgb(0, 0, 255, 0.4)    // \"rgba(0, 0, 255, 0.4)\"\ncolorString.to.rgb(0, 0, 255, 0.4)    // \"rgba(0, 0, 255, 0.4)\"\ncolorString.to.rgb.percent(0, 0, 255) // \"rgb(0%, 0%, 100%)\"\ncolorString.to.keyword(255, 255, 0)   // \"yellow\"\ncolorString.to.hsl(360, 100, 100)     // \"hsl(360, 100%, 100%)\"\ncolorString.to.hwb(50, 3, 15)         // \"hwb(50, 3%, 15%)\"\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqix-%2Fcolor-string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqix-%2Fcolor-string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqix-%2Fcolor-string/lists"}