What is hsl-to-hex?
The hsl-to-hex npm package is a simple utility that converts HSL (Hue, Saturation, Lightness) color values to HEX color codes. This can be particularly useful in web development and design where HEX color codes are commonly used.
What are hsl-to-hex's main functionalities?
Convert HSL to HEX
This feature allows you to convert HSL color values to HEX color codes. The function takes three arguments: hue (0-360), saturation (0-100), and lightness (0-100). The output is a HEX color code.
const hslToHex = require('hsl-to-hex');
const hexColor = hslToHex(360, 100, 50);
console.log(hexColor); // Output: #ff0000
Other packages similar to hsl-to-hex
color-convert
The color-convert package provides a wide range of color conversions, including HSL to HEX. It is more comprehensive than hsl-to-hex, supporting conversions between many different color models such as RGB, CMYK, and LAB.
color
The color package is a versatile library for color manipulation and conversion. It supports converting HSL to HEX among other color models. It also offers additional features like color manipulation (lightening, darkening, etc.) and parsing.
tinycolor2
The tinycolor2 package is a small, fast library for color manipulation and conversion. It supports converting HSL to HEX and offers a variety of other color operations, including blending, lightening, darkening, and more.
hsl-to-hex
Convert HSL colors to RGB colors in hex format.
API
require('hsl-to-hex') => Function
hsl(hue, saturation, luminosity)` => String
Example
var hsl = require('hsl-to-hex')
var hue = 133 hsl(133, 40, 60)
var saturation = 40
var luminosity = 60
var hex = hsl(hue, saturation, luminosity)
console.log(hex)
License
ISC