cq

color-quantize

Convert colors to websafe / websmart values

Showing:

Popularity

Downloads/wk

0

GitHub Stars

4

Maintenance

Last Commit

6yrs ago

Contributors

0

Package

Dependencies

1

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

color-quantize

NPM version Build Status Code Climate Coverage Status Dependency Status devDependency Status

NPM

Description

Convert colors to websafe / websmart values

Getting Started

Install the module with: npm install color-quantize

var colorQuantize = require('color-quantize');
colorQuantize.websafe('#cd1289'); // "#CC0099"
colorQuantize.websmart('#cd1289'); // "#CC1188"

Documentation

This library uses the onecolor parser, so colorString can in many different formats (i.e. #ff00cc, rgb(13,42,255), etc).

colorQuantize.websafe(colorString)

Return a hex code from the 216 web-safe color palette.

colorString can be in any format supported by onecolor.

Same as calling: colorQuantize.quantize(colorString, 51)

colorQuantize.websmart(colorString)

Return a hex code from the 4096 web-smart color palette.

colorString can be in any format supported by onecolor.

Same as calling: colorQuantize.quantize(colorString, 17)

colorQuantize.quantize(colorString, quantizeAmount)

Quantize a colorString by the given quantizeAmount.

colorString can be in any format supported by onecolor.

quantizeAmount must be an integer.

Release History

v0.1.0 - Released June 21, 2014

  • initial release

License

Copyright (c) 2014 skratchdot
Licensed under the MIT license.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial