Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

JSColor

A JavaScript library for handling storage of a color and easily converting between Hex, RGB, and HSV

For example, you can snag a color and adjust only the hue, keeping saturation and brightness even, to maintain a sort of gradient effect in a color range: `var color1 = Color();

color1.hex( '#74d04c' );

color1.h( color1.h() - 40 );

console.log( color1.hex() );`

Usage

The following getters/setters are supported. Whenever you set a value the others will be immediately adjusted to match. So if you set the hex, you can grab the RGB or HSV immediately.

RGB values are 0-255

H is 0-360

S and V are 0-100

Hex is #000000 - #FFFFFF and expects the leading hash

Methods

In all cases passing no value will return the current value.

  • r( val )

  • g( val )

  • b( val )

  • h( val )

  • s( val )

  • v( val )

  • hex( val )

About

JavaScript Color Conversion Library

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages