Socket
Socket
Sign inDemoInstall

@csstools/convert-colors

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@csstools/convert-colors

Convert colors between RGB, HSL, and HWB


Version published
Weekly downloads
1.6M
increased by5.28%
Maintainers
1
Weekly downloads
 
Created

What is @csstools/convert-colors?

The @csstools/convert-colors npm package provides functionality for converting colors between different color models such as RGB, HSL, HWB, and more. It can be used to manipulate and convert color values in various formats, which is useful for web development and design tasks where precise color management is required.

What are @csstools/convert-colors's main functionalities?

RGB to HSL conversion

Converts an RGB color value to its equivalent HSL value.

const { rgb2hsl } = require('@csstools/convert-colors');
const hsl = rgb2hsl(255, 0, 0); // Convert red from RGB to HSL

HSL to RGB conversion

Converts an HSL color value to its equivalent RGB value.

const { hsl2rgb } = require('@csstools/convert-colors');
const rgb = hsl2rgb(0, 100, 50); // Convert red from HSL to RGB

RGB to HEX conversion

Converts an RGB color value to its equivalent HEX value.

const { rgb2hex } = require('@csstools/convert-colors');
const hex = rgb2hex(255, 0, 0); // Convert red from RGB to HEX

HEX to RGB conversion

Converts a HEX color value to its equivalent RGB value.

const { hex2rgb } = require('@csstools/convert-colors');
const rgb = hex2rgb('#ff0000'); // Convert red from HEX to RGB

HWB to RGB conversion

Converts an HWB color value to its equivalent RGB value.

const { hwb2rgb } = require('@csstools/convert-colors');
const rgb = hwb2rgb(0, 0, 0); // Convert black from HWB to RGB

Other packages similar to @csstools/convert-colors

Keywords

FAQs

Package last updated on 28 Jan 2018

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