{"id":20400048,"url":"https://github.com/codebrainz/color-names","last_synced_at":"2025-04-04T20:15:25.222Z","repository":{"id":3770882,"uuid":"4847724","full_name":"codebrainz/color-names","owner":"codebrainz","description":"Provides color names and HTML/RGB mappings in various output formats.","archived":false,"fork":false,"pushed_at":"2020-10-01T16:28:32.000Z","size":234,"stargazers_count":222,"open_issues_count":5,"forks_count":672,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T19:12:04.309Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codebrainz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-01T04:02:52.000Z","updated_at":"2025-02-27T09:47:26.000Z","dependencies_parsed_at":"2022-07-08T17:47:55.606Z","dependency_job_id":null,"html_url":"https://github.com/codebrainz/color-names","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Fcolor-names","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Fcolor-names/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Fcolor-names/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Fcolor-names/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codebrainz","download_url":"https://codeload.github.com/codebrainz/color-names/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242681,"owners_count":20907134,"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-15T04:38:12.172Z","updated_at":"2025-04-04T20:15:25.194Z","avatar_url":"https://github.com/codebrainz.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Color Names\n===========\n\nThese files are generated using a script which parses the list of colors\non Wikipedia, here:\n\n  http://en.wikipedia.org/wiki/List_of_colors\n\nThe script used is (poorly) written in Python and depends heavily on the\ninput format as was copied and pasted from Wikipedia using Firefox into a\nplain text file. The script is named `format-colors` and can be found in the\nsame directory as the data files. Run it at your own discretion.\n\nThere's a GNU Make file called `makefile` that just re-generates the data\nfiles when the input file is updated or the script is changed. You probably\ndon't need this file at all.\n\nThere are various output formats, explained below.\n\nNote: some of the information in the output files is redundant, ex. the\nidentifier name can be found from the regular name and the RGB integer\ntriplet is provided also by the hex HTML RGB triplet. The reason is I needed\nthis in a specific format for a project. It should be trivial to remove this\ninformation if it is redundant for you.\n\nNote: If you're using these files for something automated/scripted, please\nput them on your own server so you don't pound mine.\n\nC Code\n------\n\nFor use in programs in the C programming language. It contains an enum like:\n\n```c\ntypedef enum Color {\n  ...\n  COLOR_RED,\n  ...\n};\n```\n\nAnd then an array of `ColorInfo` structures where the `COLOR_` enumerators\nindex into the array. It looks like:\n\n```c\nColorInfo color_data[COLOR_NAMES_MAX] = {\n  ...\n  { \"Red\", \"#f00\", { 255, 0, 0 } },\n  ...\n};\n```\n\nSo if you wanted to look up the colour red, you'd do something like this:\n\n```c\nconst ColorInfo *clrinf = \u0026color_data[COLOR_RED];\nprintf(\"Color Name: %s\\n\", clrinf-\u003ename);\nprintf(\"Color Hex: %s\\n\", clrinf-\u003ehex);\nprintf(\"Color RGB: (%d, %d, %d)\\n\",\n  clrinf-\u003ergb.r, clrinf-\u003ergb.g, clrinf-\u003ergb.b);\n```\n\nLook at the code for more details.\n\nConf\n----\n\nSimilar to Windows `.ini` files or GKeyFiles (GLIB). For example:\n\n```ini\n...\n[red]\nname=Red\nhex=#f00\nrgb=255;0;0\n...\n```\n\nCSV\n---\n\nComma separated values for example to import into a spreadsheet utility.\nLooks like:\n\n```csv\n...\nred,\"Red\",#f00,255,0,0\n...\n```\n\nHTML\n----\n\nThe HTML format is meant to be viewed in your browser as a \"catalog\" of the\ncolors. It closely resembes the Wikipedia colour list page.\n\nUse the \"View Source\" feature in your browser to examine the format.\n\nJSON\n----\n\nJavaScript Object Notation, looks like a JS or Python data structure, for\nexample:\n\n```js\n{\n  ...\n  \"red\": {\n    \"name\": \"Red\",\n    \"hex\": \"#f00\",\n    \"rgb\": [255, 0, 0]\n  }\n  ...\n}\n```\n\nS-Expressions\n-------------\n\nS-Expression, which might be useful for Lisp or other languages, for example:\n\n```lisp\n(\n  ...\n  (red 'Red' '#f00' (255 0 0))\n  ...\n)\n```\n\nXML\n---\n\nGood ol' XML format, for example:\n\n```xml\n\u003ccolors\u003e\n  ...\n  \u003ccolor id=\"red\" hex=\"#f00\" red=\"255\" green=\"0\" blue=\"0\"\u003eRed\u003c/color\u003e\n  ...\n\u003c/colors\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebrainz%2Fcolor-names","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodebrainz%2Fcolor-names","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebrainz%2Fcolor-names/lists"}