Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

Latest commit

 

History

History
50 lines (34 loc) · 2.22 KB

readme.md

File metadata and controls

50 lines (34 loc) · 2.22 KB

color-manipulate Build Status Code Climate

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.
  • darken(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.

NPM