CSS color string parser
JavaScript Makefile
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
History.md
Makefile
Readme.md
colors.js
component.json
index.js
package.json

Readme.md

color-parser

CSS color string parser

Installation

$ component install component/color-parser

Example

var parse = require('color-parser');

parse('#fc0')
// => { r: 255, g: 204, b: 0, a: 1 }

parse('#ffcc00')
// => { r: 255, g: 204, b: 0, a: 1 }

parse('rgb(255, 204, 0)')
// => { r: 255, g: 204, b: 0, a: 1 }

parse('rgba(255, 204, 0, 1)')
// => { r: 255, g: 204, b: 0, a: 1 }

License

MIT