Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

color-space

Package Overview
Dependencies
Maintainers
6
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

color-space

Color space conversions and data

  • 1.15.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
6
Created

What is color-space?

The color-space npm package provides a comprehensive set of tools for color space conversion and manipulation. It supports a wide range of color spaces and allows for easy conversion between them.

What are color-space's main functionalities?

RGB to HSL Conversion

This feature allows you to convert colors from the RGB color space to the HSL color space. The code sample demonstrates converting a red color in RGB to its HSL representation.

const colorSpace = require('color-space');
const rgb = [255, 0, 0];
const hsl = colorSpace.rgb.hsl(rgb);
console.log(hsl); // [0, 100, 50]

HSL to RGB Conversion

This feature allows you to convert colors from the HSL color space to the RGB color space. The code sample demonstrates converting a red color in HSL to its RGB representation.

const colorSpace = require('color-space');
const hsl = [0, 100, 50];
const rgb = colorSpace.hsl.rgb(hsl);
console.log(rgb); // [255, 0, 0]

CMYK to RGB Conversion

This feature allows you to convert colors from the CMYK color space to the RGB color space. The code sample demonstrates converting a red color in CMYK to its RGB representation.

const colorSpace = require('color-space');
const cmyk = [0, 1, 1, 0];
const rgb = colorSpace.cmyk.rgb(cmyk);
console.log(rgb); // [255, 0, 0]

XYZ to LAB Conversion

This feature allows you to convert colors from the XYZ color space to the LAB color space. The code sample demonstrates converting a color in XYZ to its LAB representation.

const colorSpace = require('color-space');
const xyz = [41.24, 21.26, 1.93];
const lab = colorSpace.xyz.lab(xyz);
console.log(lab); // [53.23288178584245, 80.10930952982204, 67.22006831026425]

Other packages similar to color-space

Keywords

FAQs

Package last updated on 06 Oct 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc