1
0
mirror of https://github.com/thangisme/notes.git synced 2024-11-19 11:36:13 -05:00
notes/node_modules/css-color-names
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00
..
css-color-names.json Initial commit 2017-03-09 13:16:08 -05:00
getcolors.sh Initial commit 2017-03-09 13:16:08 -05:00
Makefile Initial commit 2017-03-09 13:16:08 -05:00
package.json Initial commit 2017-03-09 13:16:08 -05:00
README.md Initial commit 2017-03-09 13:16:08 -05:00
stringify.js Initial commit 2017-03-09 13:16:08 -05:00

css-color-names

A JSON Object of css color names mapped to their hex value

Usage

var csscolors = require('css-color-names');
console.dir(csscolors);

yields

{
  "aqua": "#00ffff",
  "aliceblue": "#f0f8ff",
  "antiquewhite": "#faebd7",
  "black": "#000000",
  "blue": "#0000ff",
  ...
}

How was this list generated?

In the Makefile you'll see a line like this:

./getcolors.sh | ./stringify.js > $(FILE)

The first command scrapes a site for the list, and outputs the results separated by newlines. The second command creates the JSON object and outputs it to stdout, which then gets redirected into css-color-names.json

Installation

npm install css-color-names

License

MIT