Socket
Socket
Sign inDemoInstall

color-space

Package Overview
Dependencies
0
Maintainers
6
Versions
49
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

color-space

Collection of color space conversions


Version published
Maintainers
6
Weekly downloads
352,792
decreased by-13.88%

Weekly downloads

Readme

Source

Color-space test stable npm size

Collection of color spaces conversions & data.

Demo.

Usage

import space from 'color-space';

//convert lab to lch
var result = space.lab.lch([80,50,60]);

Spaces can be imported separately:

import rgb from 'color-space/rgb.js';
import hsl from 'color-space/hsl.js';

//convert rgb to hsl
rgb.hsl([200,230,100]);

API

<fromSpace>.<toSpace>(array);
<space>.name //space name
<space>.min //channel minimums
<space>.max //channel maximums
<space>.channel //channel names
<space>.alias //alias space names

Spaces

Contribute

Please fork, add color space with basic conversions to/from XYZ or RGB and tests. The goal of the project is the most complete set of color spaces with minimal uniform API.

Credits

Thanks to all scientists, who devoted their time to color research and conveyed their knowledge, for now we can use their formulas and code.

Alternatives

See also

Keywords

FAQs

Last updated on 25 Jun 2023

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