Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Convert colors to websafe / websmart values

License

NotificationsYou must be signed in to change notification settings

skratchdot/color-quantize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPM versionBuild StatusCode ClimateCoverage StatusDependency StatusdevDependency Status

NPM

Description

Convert colors to websafe / websmart values

Getting Started

Install the module with:npm install color-quantize

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

Documentation

This library uses theonecolor 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 byonecolor.

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 byonecolor.

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 byonecolor.

quantizeAmount must be an integer.

Additional Links

Release History

v0.1.0 - Released June 21, 2014

  • initial release

License

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

About

Convert colors to websafe / websmart values

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp