Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

kolora

tutizaraz12MIT1.0.0TypeScript support: included

A lightweight, dependency-free library for color conversion between various formats such as RGBA, HEX, HSL, HSV, and CMYK.

colors, color-conversion, rgba, hex, hsl, cmyk, color-palette, color-picker, gradients, color-manipulation, color-theory, color-accessibility, color-harmony, color-correction, web-design, graphic-design, css, ui-design, themeing, color-schemes

readme

Kolora

Kolora is a lightweight, dependency-free library for color conversion between various formats such as RGBA, HEX, HSL. Ideal for developers, designers, and color enthusiasts looking to effortlessly translate color codes across different color spaces.

Usage

import { toHex } from 'kolora';

const rgba = [255, 100, 100, 0.5];
const hex = toHex(rgba); // Returns '#ff646480'
import { hexToHsl } from 'kolora';

const hex = '#ff6464';
const hsl = hexToHsl(hex); // Returns [0, 100, 70]

Supported Conversions

  • RGBA to HEX
  • HEX to RGBA
  • HEX to HSL
  • HSL to HSV