{"id":20377244,"url":"https://github.com/ericpugh/dub-color","last_synced_at":"2026-06-11T09:31:41.217Z","repository":{"id":56978840,"uuid":"77542414","full_name":"ericpugh/dub-color","owner":"ericpugh","description":"Find the english language name of a (HEX) color ","archived":false,"fork":false,"pushed_at":"2017-03-10T19:58:54.000Z","size":22,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-06-02T07:33:50.672Z","etag":null,"topics":["color-palette","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/ericpugh.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}},"created_at":"2016-12-28T15:27:22.000Z","updated_at":"2018-06-06T11:06:08.000Z","dependencies_parsed_at":"2022-08-21T10:50:10.759Z","dependency_job_id":null,"html_url":"https://github.com/ericpugh/dub-color","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ericpugh/dub-color","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericpugh%2Fdub-color","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericpugh%2Fdub-color/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericpugh%2Fdub-color/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericpugh%2Fdub-color/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericpugh","download_url":"https://codeload.github.com/ericpugh/dub-color/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericpugh%2Fdub-color/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34192870,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"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":["color-palette","php"],"created_at":"2024-11-15T01:44:14.854Z","updated_at":"2026-06-11T09:31:41.190Z","avatar_url":"https://github.com/ericpugh.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DubColor\n\nFind the english language name of a (HEX) color. Names provided by one of the following color palettes, or can be extended to use a custom palette:\n* [Crayola](https://www.wikiwand.com/en/List_of_Crayola_crayon_colors)\n* [CSS3](https://drafts.csswg.org/css-color-3/)\n* [CSS4](https://drafts.csswg.org/css-color/)\n* [NCS](https://en.wikipedia.org/wiki/Natural_Color_System)\n\n\n### Example Usage\n\n```php\n\u003c?php\n\nuse ericpugh\\DubColor\\Palette\\Css4;\nuse ericpugh\\DubColor\\ColorDubber;\nuse ericpugh\\DubColor\\Color;\n\n// Create instance of DubColor and set color palette to use.\n$palette = Css4::getColors();\n$dubber = new ColorDubber($palette);\n$total_num_colors = $dubber-\u003ecountColorPalette();\n\n// An example hex color.\n$example_hex = '#83F600';\n$example_color = new Color($dubber::fromHexToInt($example_hex));\n// Finds the closest HEX color in the current palette.\n$closest = $dubber-\u003eclosestColor($example_color);\n// Finds the name \"lawngreen\".\n$name = $dubber-\u003egetColorName($closest);\n\n// Output results.\n$label = sprintf('\u003cspan\u003eFound 1 in %d colors\u003c/span\u003e', $total_num_colors);\n$color_span = sprintf('\u003cspan style=\"background-color:%s\"\u003eName: %s\u003c/span\u003e', $closest, $name);\necho $label . $color_span;\n\n?\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericpugh%2Fdub-color","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericpugh%2Fdub-color","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericpugh%2Fdub-color/lists"}