JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 299040
  • Score
    100M100P100Q157391F
  • License MIT

Get integer id for a color

Package Exports

  • color-id

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (color-id) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

color-id unstable Build Status

Convert color channels to single integer and back. Useful to get an id for a color.

npm install color-id

const colorId = require('color-id');

colorId([.1, .5, .5, .1]); // 0x197f7f19

colorId(channels, normalized=true)

Get id for normalized to 0..1 rgb[a] channel values. Optionally pass normalized flag to indicate that values are normalized to 0..1 range, defaults to true.

colorId.from(number, normalized=true)

Get color channels values from the color id. Optionally pass normalized flag to align values to 0..1 range.

color-interpolate — interpolate color over palette, colormap or gradient.
color-rgba — convert color string to rgba array.
color-alpha — change alpha channel for a color.