Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
CSS color string parser
JavaScript Makefile
Branch: master
Failed to load latest commit information.
test
.gitignore add `make test`
History.md Release 0.1.1
Makefile add `make test`
Readme.md add docs
colors.js Add `rebeccapurple`
component.json
index.js index: Fix missing `a` value when parsing named colors
package.json Add `main` to 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

Something went wrong with that request. Please try again.