Socket
Socket
Sign inDemoInstall

color-id

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    color-id

Get integer id for a color


Version published
Weekly downloads
208K
decreased by-1.5%
Maintainers
1
Install size
10.1 kB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 05 Jun 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc