color-measure

Measure color characteristics

Usage no npm install needed!

<script type="module">
  import colorMeasure from 'https://cdn.skypack.dev/color-measure';
</script>

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

Related

  • 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