color-type

1.0.2 • Public • Published

color-typeBuild Status

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

Package Sidebar

Install

npm i color-type

Weekly Downloads

3

Version

1.0.2

License

MIT

Last publish

Collaborators

  • hemanth