color-manipulate

Collection of color manipulation functions

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
color-manipulate
721.0.19 years ago9 years agoMinified + gzip package size for color-manipulate in KB

Readme

color-manipulate Build Status Code Climate
A collection of color manipulation functions. $ npm install color-manipulate ```js 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-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. NPM