{"id":20969876,"url":"https://github.com/ourcodeworld/name-that-color","last_synced_at":"2025-10-18T00:04:32.908Z","repository":{"id":50085748,"uuid":"143456686","full_name":"ourcodeworld/name-that-color","owner":"ourcodeworld","description":"A non-official PHP port of the NTC JS library to find out the name of the closest matching color.","archived":false,"fork":false,"pushed_at":"2023-11-18T00:28:36.000Z","size":25,"stargazers_count":35,"open_issues_count":4,"forks_count":18,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-14T11:35:38.338Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/ourcodeworld.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":"2018-08-03T17:44:01.000Z","updated_at":"2024-07-30T06:02:20.000Z","dependencies_parsed_at":"2024-06-21T19:07:09.158Z","dependency_job_id":"ef8ba000-84b7-4a39-9026-70bb30a6af38","html_url":"https://github.com/ourcodeworld/name-that-color","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"758b1f9b4b521da63f0ae4226e80cae620b0f648"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ourcodeworld/name-that-color","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ourcodeworld%2Fname-that-color","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ourcodeworld%2Fname-that-color/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ourcodeworld%2Fname-that-color/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ourcodeworld%2Fname-that-color/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ourcodeworld","download_url":"https://codeload.github.com/ourcodeworld/name-that-color/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ourcodeworld%2Fname-that-color/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261119345,"owners_count":23112189,"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-11-19T03:53:22.574Z","updated_at":"2025-10-18T00:04:32.902Z","avatar_url":"https://github.com/ourcodeworld.png","language":"PHP","readme":"# What is Name That Color\n\nThis library is a PHP port of the known JS Script to find out the closest color name by its hex code.\n \n# Installation\n\nName That Color can be used either with or without Composer.\n\n## With Composer\n\nThe preferred way to use name-that-color is with Composer. Execute the following command to install this package as a dependency in your project:\n\n```batch\ncomposer require ourcodeworld/name-that-color\n```\n\n## Without Composer\n\nIf you don't use composer, you can still use the wrapper. Download the [ColorInterpreter.php](https://github.com/ourcodeworld/name-that-color/blob/master/src/ColorInterpreter.php) class from the repository and then use `require_once` to import it in your code:\n\n```php\n\u003c?php\n\nrequire_once(\"ColorInterpreter.php\");\n\n$instance = new ColorInterpreter();\n\n// Configuration here ...\n```\n# Example\n\nInclude the ColorInterpreter class and call the name method that returns an array with the closest color interpretation providen by the script. The result array contains three keys:\n\n- hex: the hex color of the closest color in the class.\n- name: the human name given to the color.\n- exact: boolean that determines wheter the color code is exact as the name or not.\n\n```php\n// Include the class\nuse ourcodeworld\\NameThatColor\\ColorInterpreter as NameThatColor;\n\n$instance = new NameThatColor();\n\n$result = $instance-\u003ename(\"#008559\");\n\nvar_dump($result);\n\narray(3) {\n  [\"hex\"]=\u003e\n  string(7) \"#01826B\"\n  [\"name\"]=\u003e\n  string(8) \"Deep Sea\"\n  [\"exact\"]=\u003e\n  bool(false)\n}\n```\n\nThis class offers other utilities as converting an hex color code to HSL or RGB as well in case you need them:\n\n```php\n// Include the class\nuse ourcodeworld\\NameThatColor\\ColorInterpreter as NameThatColor;\n\n$instance = new NameThatColor();\n\n// From hex to HSL\n$hsl_data = $instance-\u003ehsl(\"#008559\");\nvar_dump($hsl_data);\narray(3) {\n  [0]=\u003e\n  int(113)\n  [1]=\u003e\n  int(255)\n  [2]=\u003e\n  int(66)\n}\n\n// From hex to RGB\n$rgb_data = $instance-\u003ergb(\"#008559\");\nvar_dump($rgb_data);\narray(3) {\n  [0]=\u003e\n  int(0)\n  [1]=\u003e\n  int(133)\n  [2]=\u003e\n  int(89)\n}\n\n```\n\n\nThe MIT License (MIT)\n=====================\n\nCopyright © 2017 Our Code World\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the “Software”), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fourcodeworld%2Fname-that-color","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fourcodeworld%2Fname-that-color","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fourcodeworld%2Fname-that-color/lists"}