├── .eslintrc.json ├── .gitignore ├── LICENSE ├── README.md ├── index.js ├── package.json └── test.js /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "node": true, 5 | "commonjs": true, 6 | "es6": true 7 | }, 8 | "extends": "eslint:recommended", 9 | "rules": { 10 | "strict": 2, 11 | "indent": 0, 12 | "linebreak-style": 0, 13 | "quotes": 0, 14 | "semi": 0, 15 | "no-cond-assign": 1, 16 | "no-constant-condition": 1, 17 | "no-duplicate-case": 1, 18 | "no-empty": 1, 19 | "no-ex-assign": 1, 20 | "no-extra-boolean-cast": 1, 21 | "no-extra-semi": 1, 22 | "no-fallthrough": 1, 23 | "no-func-assign": 1, 24 | "no-global-assign": 1, 25 | "no-implicit-globals": 2, 26 | "no-inner-declarations": ["error", "functions"], 27 | "no-irregular-whitespace": 2, 28 | "no-loop-func": 1, 29 | "no-multi-str": 1, 30 | "no-mixed-spaces-and-tabs": 1, 31 | "no-proto": 1, 32 | "no-sequences": 1, 33 | "no-throw-literal": 1, 34 | "no-unmodified-loop-condition": 1, 35 | "no-useless-call": 1, 36 | "no-void": 1, 37 | "no-with": 2, 38 | "wrap-iife": 1, 39 | "no-redeclare": 1, 40 | "no-unused-vars": ["error", { "vars": "all", "args": "none" }], 41 | "no-sparse-arrays": 1 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | //this will affect all the git repos 2 | git config --global core.excludesfile ~/.gitignore 3 | 4 | 5 | //update files since .ignore won't if already tracked 6 | git rm --cached 7 | 8 | # Compiled source # 9 | ################### 10 | *.com 11 | *.class 12 | *.dll 13 | *.exe 14 | *.o 15 | *.so 16 | 17 | # Packages # 18 | ############ 19 | # it's better to unpack these files and commit the raw source 20 | # git has its own built in compression methods 21 | *.7z 22 | *.dmg 23 | *.gz 24 | *.iso 25 | *.jar 26 | *.rar 27 | *.tar 28 | *.zip 29 | 30 | # Logs and databases # 31 | ###################### 32 | *.log 33 | *.sql 34 | *.sqlite 35 | 36 | # OS generated files # 37 | ###################### 38 | .DS_Store 39 | .DS_Store? 40 | ._* 41 | .Spotlight-V100 42 | .Trashes 43 | # Icon? 44 | ehthumbs.db 45 | Thumbs.db 46 | .cache 47 | .project 48 | .settings 49 | .tmproj 50 | *.esproj 51 | nbproject 52 | 53 | # Numerous always-ignore extensions # 54 | ##################################### 55 | *.diff 56 | *.err 57 | *.orig 58 | *.rej 59 | *.swn 60 | *.swo 61 | *.swp 62 | *.vi 63 | *~ 64 | *.sass-cache 65 | *.grunt 66 | *.tmp 67 | 68 | # Dreamweaver added files # 69 | ########################### 70 | _notes 71 | dwsync.xml 72 | 73 | # Komodo # 74 | ########################### 75 | *.komodoproject 76 | .komodotools 77 | 78 | # Node # 79 | ##################### 80 | node_modules 81 | 82 | # Bower # 83 | ##################### 84 | bower_components 85 | 86 | # Folders to ignore # 87 | ##################### 88 | .hg 89 | .svn 90 | .CVS 91 | intermediate 92 | publish 93 | .idea 94 | .graphics 95 | _test 96 | _archive 97 | uploads 98 | tmp 99 | 100 | # Vim files to ignore # 101 | ####################### 102 | .VimballRecord 103 | .netrwhist 104 | 105 | bundle.* 106 | 107 | _demo -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2015 Dmitry Ivanov 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors. 2 | 3 | [![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/) 4 | 5 | 6 | ```js 7 | import colors from 'color-name'; 8 | colors.red //[255,0,0] 9 | ``` 10 | 11 | 12 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | aliceblue: [240, 248, 255], 3 | antiquewhite: [250, 235, 215], 4 | aqua: [0, 255, 255], 5 | aquamarine: [127, 255, 212], 6 | azure: [240, 255, 255], 7 | beige: [245, 245, 220], 8 | bisque: [255, 228, 196], 9 | black: [0, 0, 0], 10 | blanchedalmond: [255, 235, 205], 11 | blue: [0, 0, 255], 12 | blueviolet: [138, 43, 226], 13 | brown: [165, 42, 42], 14 | burlywood: [222, 184, 135], 15 | cadetblue: [95, 158, 160], 16 | chartreuse: [127, 255, 0], 17 | chocolate: [210, 105, 30], 18 | coral: [255, 127, 80], 19 | cornflowerblue: [100, 149, 237], 20 | cornsilk: [255, 248, 220], 21 | crimson: [220, 20, 60], 22 | cyan: [0, 255, 255], 23 | darkblue: [0, 0, 139], 24 | darkcyan: [0, 139, 139], 25 | darkgoldenrod: [184, 134, 11], 26 | darkgray: [169, 169, 169], 27 | darkgreen: [0, 100, 0], 28 | darkgrey: [169, 169, 169], 29 | darkkhaki: [189, 183, 107], 30 | darkmagenta: [139, 0, 139], 31 | darkolivegreen: [85, 107, 47], 32 | darkorange: [255, 140, 0], 33 | darkorchid: [153, 50, 204], 34 | darkred: [139, 0, 0], 35 | darksalmon: [233, 150, 122], 36 | darkseagreen: [143, 188, 143], 37 | darkslateblue: [72, 61, 139], 38 | darkslategray: [47, 79, 79], 39 | darkslategrey: [47, 79, 79], 40 | darkturquoise: [0, 206, 209], 41 | darkviolet: [148, 0, 211], 42 | deeppink: [255, 20, 147], 43 | deepskyblue: [0, 191, 255], 44 | dimgray: [105, 105, 105], 45 | dimgrey: [105, 105, 105], 46 | dodgerblue: [30, 144, 255], 47 | firebrick: [178, 34, 34], 48 | floralwhite: [255, 250, 240], 49 | forestgreen: [34, 139, 34], 50 | fuchsia: [255, 0, 255], 51 | gainsboro: [220, 220, 220], 52 | ghostwhite: [248, 248, 255], 53 | gold: [255, 215, 0], 54 | goldenrod: [218, 165, 32], 55 | gray: [128, 128, 128], 56 | green: [0, 128, 0], 57 | greenyellow: [173, 255, 47], 58 | grey: [128, 128, 128], 59 | honeydew: [240, 255, 240], 60 | hotpink: [255, 105, 180], 61 | indianred: [205, 92, 92], 62 | indigo: [75, 0, 130], 63 | ivory: [255, 255, 240], 64 | khaki: [240, 230, 140], 65 | lavender: [230, 230, 250], 66 | lavenderblush: [255, 240, 245], 67 | lawngreen: [124, 252, 0], 68 | lemonchiffon: [255, 250, 205], 69 | lightblue: [173, 216, 230], 70 | lightcoral: [240, 128, 128], 71 | lightcyan: [224, 255, 255], 72 | lightgoldenrodyellow: [250, 250, 210], 73 | lightgray: [211, 211, 211], 74 | lightgreen: [144, 238, 144], 75 | lightgrey: [211, 211, 211], 76 | lightpink: [255, 182, 193], 77 | lightsalmon: [255, 160, 122], 78 | lightseagreen: [32, 178, 170], 79 | lightskyblue: [135, 206, 250], 80 | lightslategray: [119, 136, 153], 81 | lightslategrey: [119, 136, 153], 82 | lightsteelblue: [176, 196, 222], 83 | lightyellow: [255, 255, 224], 84 | lime: [0, 255, 0], 85 | limegreen: [50, 205, 50], 86 | linen: [250, 240, 230], 87 | magenta: [255, 0, 255], 88 | maroon: [128, 0, 0], 89 | mediumaquamarine: [102, 205, 170], 90 | mediumblue: [0, 0, 205], 91 | mediumorchid: [186, 85, 211], 92 | mediumpurple: [147, 112, 219], 93 | mediumseagreen: [60, 179, 113], 94 | mediumslateblue: [123, 104, 238], 95 | mediumspringgreen: [0, 250, 154], 96 | mediumturquoise: [72, 209, 204], 97 | mediumvioletred: [199, 21, 133], 98 | midnightblue: [25, 25, 112], 99 | mintcream: [245, 255, 250], 100 | mistyrose: [255, 228, 225], 101 | moccasin: [255, 228, 181], 102 | navajowhite: [255, 222, 173], 103 | navy: [0, 0, 128], 104 | oldlace: [253, 245, 230], 105 | olive: [128, 128, 0], 106 | olivedrab: [107, 142, 35], 107 | orange: [255, 165, 0], 108 | orangered: [255, 69, 0], 109 | orchid: [218, 112, 214], 110 | palegoldenrod: [238, 232, 170], 111 | palegreen: [152, 251, 152], 112 | paleturquoise: [175, 238, 238], 113 | palevioletred: [219, 112, 147], 114 | papayawhip: [255, 239, 213], 115 | peachpuff: [255, 218, 185], 116 | peru: [205, 133, 63], 117 | pink: [255, 192, 203], 118 | plum: [221, 160, 221], 119 | powderblue: [176, 224, 230], 120 | purple: [128, 0, 128], 121 | rebeccapurple: [102, 51, 153], 122 | red: [255, 0, 0], 123 | rosybrown: [188, 143, 143], 124 | royalblue: [65, 105, 225], 125 | saddlebrown: [139, 69, 19], 126 | salmon: [250, 128, 114], 127 | sandybrown: [244, 164, 96], 128 | seagreen: [46, 139, 87], 129 | seashell: [255, 245, 238], 130 | sienna: [160, 82, 45], 131 | silver: [192, 192, 192], 132 | skyblue: [135, 206, 235], 133 | slateblue: [106, 90, 205], 134 | slategray: [112, 128, 144], 135 | slategrey: [112, 128, 144], 136 | snow: [255, 250, 250], 137 | springgreen: [0, 255, 127], 138 | steelblue: [70, 130, 180], 139 | tan: [210, 180, 140], 140 | teal: [0, 128, 128], 141 | thistle: [216, 191, 216], 142 | tomato: [255, 99, 71], 143 | turquoise: [64, 224, 208], 144 | violet: [238, 130, 238], 145 | wheat: [245, 222, 179], 146 | white: [255, 255, 255], 147 | whitesmoke: [245, 245, 245], 148 | yellow: [255, 255, 0], 149 | yellowgreen: [154, 205, 50] 150 | } 151 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "color-name", 3 | "version": "2.0.0", 4 | "description": "A list of color names and its values", 5 | "main": "index.js", 6 | "type": "module", 7 | "files": [ 8 | "index.js" 9 | ], 10 | "engines": { 11 | "node": ">=12.20" 12 | }, 13 | "scripts": { 14 | "test": "node test.js" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "http://github.com/colorjs/color-name.git" 19 | }, 20 | "keywords": [ 21 | "color-name", 22 | "color", 23 | "color-keyword", 24 | "keyword" 25 | ], 26 | "author": "Dmitry Iv ", 27 | "license": "MIT", 28 | "bugs": { 29 | "url": "https://github.com/colorjs/color-name/issues" 30 | }, 31 | "homepage": "https://github.com/colorjs/color-name" 32 | } 33 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | import assert from 'node:assert'; 2 | import names from './index.js'; 3 | 4 | assert.deepEqual(names.red, [255,0,0]); 5 | assert.deepEqual(names.aliceblue, [240,248,255]); 6 | --------------------------------------------------------------------------------