gm-color-parser
v0.1.2
Published
Parses string representations of colors, forked from color-parser
Downloads
10
Maintainers
Readme
color-parser
CSS color string parser, forked from component/color-parser
Installation
Browserify/NPM
$ npm install --save gm-color-parser
var parse = require('gm-color-parser');
Component
$ component install charlottegore/color-parser
var parse = require('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