color-manipulate
v1.0.1
Published
Collection of color manipulation functions
Downloads
1,315
Readme
color-manipulate
A collection of color manipulation functions.
$ npm install color-manipulate
var mix = require('color-manipulate/mix');
mix(colorA, colorB, .5);
Manipulations
- lighten(color, ratio) — increase color lightness by ratio.
- draken(color, ratio) — decrease color lightness by ratio.
- saturate(color, ratio) — saturate color by ratio.
- desaturate(color, ratio) — decrease saturation by ratio.
- whiten(color, ratio) (aka tint) — mix to white.
- blacken(color, ratio) (aka shade) — mix to black.
- grayscale(color, ratio) — convert color to gray.
- fadeout(color, ratio) (aka clearer, transparentize) — increase transparency.
- fadein(color, ratio) (aka opaquer, opacify) — decrease transparency.
- spin(color, degrees) (aka rotate) — rotate hue by degrees.
- invert(color, ratio) (aka negate) — invert color.
- mix(color1, color2, ratio) (aka blend) — mix second color to the first color.
Supported color libs
Related
- color-measure — a collection of color measures.
- color-blend — a collection of color blending functions.
- color-space — a collection of color spaces and conversions between them.
- color — color class, exposing these libs as an API.
Contribute
Suggest color library, manipulation or tell about the library using color-manipulate.