Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

color-measure

dfcreative1.6kMIT1.0.1

Measure color characteristics

color, measure, luma, luminosity

readme

color-measure Build Status Code Climate

A collection of color metric functions.

$ npm install color-measure

var luma = require('color-measure/luminance');
luminance(color); //0.78

Metrics

  • luminance (aka luminosity) — get relative luminance.
  • contrast — measure contrast ratio of two colors.
  • level — measure the readability level of two colors, based on contrast ratio.
  • is-dark — check whether color is dark via YIQ transform.
  • is-light — check whether color is dark via YIQ transform.
  • sugest measure
  • color-manipulate — a collection of color manipulation functions.
  • color-blend — a collection of color blending functions.
  • color-space — a collection of color spaces and conversions between them.
  • color — color class, exposing metrics as own API.

NPM