- Notifications
You must be signed in to change notification settings - Fork1
Convert colors to websafe / websmart values
License
skratchdot/color-quantize
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Convert colors to websafe / websmart values
Install the module with:npm install color-quantize
varcolorQuantize=require('color-quantize');colorQuantize.websafe('#cd1289');// "#CC0099"colorQuantize.websmart('#cd1289');// "#CC1188"
This library uses theonecolor parser,so colorString can in many different formats (i.e. #ff00cc, rgb(13,42,255), etc).
Return a hex code from the 216 web-safe color palette.
colorString can be in any format supported byonecolor.
Same as calling:colorQuantize.quantize(colorString, 51)
Return a hex code from the 4096 web-smart color palette.
colorString can be in any format supported byonecolor.
Same as calling:colorQuantize.quantize(colorString, 17)
Quantize a colorString by the given quantizeAmount.
colorString can be in any format supported byonecolor.
quantizeAmount must be an integer.
- initial release
Copyright (c) 2014 skratchdot
Licensed under the MIT license.
About
Convert colors to websafe / websmart values