Skip to content

Helper function to detect the color type/model (HEX, RGB, HSL).

License

Notifications You must be signed in to change notification settings

hemanth/color-type

Repository files navigation

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

About

Helper function to detect the color type/model (HEX, RGB, HSL).

Resources

License

Stars

Watchers

Forks

Packages