{"id":21736419,"url":"https://github.com/kyza/color-regex","last_synced_at":"2025-08-12T06:06:26.520Z","repository":{"id":93393601,"uuid":"602754493","full_name":"Kyza/color-regex","owner":"Kyza","description":"Pattern matching and extracting color code formats using RegEx.","archived":false,"fork":false,"pushed_at":"2023-08-07T02:38:22.000Z","size":7843,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"trunk","last_synced_at":"2025-04-01T11:02:17.291Z","etag":null,"topics":["javascript","pomsky","regex","rust","typescript"],"latest_commit_sha":null,"homepage":"","language":null,"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/Kyza.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":"2023-02-16T21:48:21.000Z","updated_at":"2025-01-29T12:13:35.000Z","dependencies_parsed_at":"2023-08-26T05:15:43.590Z","dependency_job_id":null,"html_url":"https://github.com/Kyza/color-regex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Kyza/color-regex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyza%2Fcolor-regex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyza%2Fcolor-regex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyza%2Fcolor-regex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyza%2Fcolor-regex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kyza","download_url":"https://codeload.github.com/Kyza/color-regex/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyza%2Fcolor-regex/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270011172,"owners_count":24511896,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["javascript","pomsky","regex","rust","typescript"],"created_at":"2024-11-26T05:18:54.635Z","updated_at":"2025-08-12T06:06:26.511Z","avatar_url":"https://github.com/Kyza.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Color RegEx\n\nPattern matching and extracting color code formats using RegEx.\n\nWritten in [Pomsky](https://pomsky-lang.org).\n\n- [Source](/index.pom)\n- [Compiled](/index.reg)\n\n## Support\n\n- [x] [Hexadecimal](https://w3c.github.io/csswg-drafts/css-color/#hex-color)\n- [x] [RGB](https://w3c.github.io/csswg-drafts/css-color/#funcdef-rgb) / [RGBA](https://w3c.github.io/csswg-drafts/css-color/#funcdef-rgba)\n- [x] [COLOR](https://w3c.github.io/csswg-drafts/css-color/#funcdef-color)\n- [x] [HSL](https://w3c.github.io/csswg-drafts/css-color/#funcdef-hsl) / [HSLA](https://w3c.github.io/csswg-drafts/css-color/#funcdef-hsla)\n- [x] [HWB](https://w3c.github.io/csswg-drafts/css-color/#funcdef-hwb)\n- [x] [LAB](https://w3c.github.io/csswg-drafts/css-color/#funcdef-lab) / [OKLAB](https://w3c.github.io/csswg-drafts/css-color/#funcdef-oklab)\n- [x] [LCH](https://w3c.github.io/csswg-drafts/css-color/#funcdef-lch) / [OKLCH](https://w3c.github.io/csswg-drafts/css-color/#funcdef-oklch)\n- [x] [\\\u003cnamed-color\\\u003e](https://w3c.github.io/csswg-drafts/css-color/#named-colors)\n- [x] [\\\u003csystem-color\\\u003e](https://w3c.github.io/csswg-drafts/css-color/#css-system-colors)\n- [x] [currentColor](https://w3c.github.io/csswg-drafts/css-color/#currentcolor-color)\n\n## [Blocks Example](https://blocks.githubnext.com/Kyza/color-regex/blob/trunk/README.md)\n\n\u003cBlockComponent\nblock={{\"owner\":\"Kyza\",\"repo\":\"blocks\",\"id\":\"pomsky-viewer\",\"type\":\"file\"}}\ncontext={{\"owner\":\"Kyza\",\"repo\":\"color-regex\",\"path\":\"full.pom\",\"sha\":\"master\",\"file\":\"README.md\"}}\nheight={500}\n/\u003e\n\n## Playground\n\n- [Pomsky](https://playground.pomsky-lang.org/?text=)\n- [Regex101](https://regex101.com/r/3HmoM7)\n\n## Visualization\n\nFrom [https://regexper.com/](https://regexper.com/).\n\n![Railroad graph of the regex.](./color-regex.png)\n\n## Usage\n\nIt always matches 1, 3, 4, or 5 unnamed groups.\n\n### 1\n\nThis group will be the name of the color alias such as `red` or `papayawhip`.\n\n### 3-5\n\nThese groups are the color type, then the color values.\n\nOR\n\nThese groups are `\"color\"`, the color type, then the color values.\n\n### Usage\n\nJust filter out the undefined values and you'll have an array of the values you want.\n\n```js\n\"rgb(255, 255, 255)\".match(regex).filter((item, i) =\u003e i \u003e 0 \u0026\u0026 item != null)\n\"color(display-p3 1 1 1 / 1)\".match(regex).filter((item, i) =\u003e i \u003e 0 \u0026\u0026 item != null)\n```\n\n## Why?\n\nFor fun and to demonstrate Pomsky's power of making complex regular expressions that are still readable.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyza%2Fcolor-regex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyza%2Fcolor-regex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyza%2Fcolor-regex/lists"}