Skip to content

Parse, validate, manipulate, and display colors

License

Notifications You must be signed in to change notification settings

conducive2/colorjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

colorjs

Install Colorjs

Node.js

  npm install colorjs

ES6

  import colorjs from 'colorjs';

  colorjs('#fff').format('RGB');

Document

Parse

RGBHex

  colorjs('#fff');

  colorjs('#000000');

RGB

  colorjs({ r: 255, g: 255, b: 255 });

HSL

  colorjs({ h: 300, s: 100, l: 100 });

HSV

  colorjs({ h: 300, s: 100, v: 100 });

Format Type

colorjs(clolorString, formatType);

  colorjs('#fff', 'RGBHex');

  colorjs('255, 255, 255', 'R, G, B');

  colorjs('300 100 100', 'H S L');

Display

  colorjs('#fff', 'RGBHex').format('R, G, B');  // '255, 255, 255'

  colorjs('255, 255, 255', 'R, G, B').format('RGBHex');  // '#ffffff'

  colorjs('300 100 100', 'H S L').format('HSL'); // { h: 300, s: 100, l: 100 }

Manipulate

Add

  colorjs('#000').add('r', 255);  //#ff0000

Subtraction

  colorjs('#fff').sub('r', 255);  //#00ffff

Query

Random

About

Parse, validate, manipulate, and display colors

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published