color-parser
CSS color string parser
Last updated 12 years ago by tjholowaychuk .
Original npm · Tarball · package.json
$ npm install color-parser 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.1.0                                ...           latest (12 years ago)

2 Versions

  • 0.1.0                                ...           12 years ago
  • 0.0.1                                ...           12 years ago
Maintainers (1)
Downloads
Total 4
Today 1
This Week 1
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE