color-type
v1.0.2
Published
Helper function to detect the color type/model (HEX, RGB, HSL).
Downloads
10
Maintainers
Readme
color-type
Helper function to detect the color type/model (HEX, RGB, HSL).
Install
$ npm install --save color-type
$ bower install --save color-type
$ component install hemanth/color-type
Usage
Node.js
var ct = require('color-type');
cm.is('rgb(255,255,255)'); //'rgb'
cm.is('#FFF'); // 'hex'
cm.is('hsl(0,100%, 50%)'); // 'hsl'
cm.isHSL('hsl(0,100%, 50%)'); // true
cm.isRGB('rgb(255,255,255)'); // true
cm.isHEX('#FFF'); // true
License
MIT © Hemanth.HM