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

Package detail

color-core

iamlite158MIT1.4.0TypeScript support: included

color-core is a comprehensive, type-safe color manipulation library for TypeScript and JavaScript applications. It provides a powerful toolkit for working with colors across multiple color spaces, making it an essential tool for developers working on pr

color, colours, colors, colour, rgb, hsl, hsv, hex, cmyk, lab, lch, xyz, yuv, color-conversion, color-manipulation, color-harmony, color-picker, color-scheme, colorspace, typescript, javascript, react, nextjs, frontend, ui, design

readme

logo


`color-core` is a comprehensive, type-safe color manipulation library for TypeScript and JavaScript applications. It provides a powerful toolkit for working with colors across multiple color spaces, making it an essential tool for developers working on projects that require advanced color handling.

Features

  • 🎨 Support for 22 color spaces: RGB, sRGB, Adobe RGB, HEX, HSL, HSV, HSI, HWB, CMYK, LCH, LAB(D50), LAB(D60), XYZ(D50), XYZ(D65), YUV, Oklab, Oklch, HSLuv, HPLuv, CIExyY, and CIELuv
  • 🔄 Easy color conversions between all supported formats
  • 🌈 Generate color harmonies (complementary, analogous, triadic, tetradic, split-complementary, and more)
  • 🛠 Powerful color manipulation tools (adjust lightness, saturation, hue, alpha, and more)
  • 🎛 Customizable, unopinionated ColorPicker component
  • 💪 Full TypeScript support with type safety
  • 🔌 Seamless IDE integration
  • 🧠 Color naming and information retrieval
  • 🔦 Brightness calculation and light/dark color detection
  • 🚀 Optimized for modern web applications

Installation

npm i color-core


Usage

color-core is designed to simplify color manipulation for developers and designers. Whether you're working on web applications, data visualization, or graphic design, this library provides the tools you need to handle colors efficiently across various formats and color spaces. Let's explore how to use color-core in your projects. The following examples demonstrate key functionalities of the library, from basic color conversions to more advanced color manipulations


The Color Class

The Color class is the heart of color-core. It provides a unified way to create, convert, and manipulate colors across different color spaces.

See it in action ⤵️


import { Color } from 'color-core';

// Create a color from different formats
const red = new Color('#ff0000');
const green = new Color({ r: 0, g: 255, b: 0 });
const blue = new Color({ h: 240, s: 100, l: 50 });

// Convert to different formats
console.log(red.toRgb());    // { r: 255, g: 0, b: 0 }
console.log(green.toHsl());  // { h: 120, s: 100, l: 50 }
console.log(blue.toHex());   // '#0000ff'

// Advanced color spaces
console.log(red.toOklab());   // { L: 0.627955, a: 0.224863, b: 0.125846 }
console.log(green.toCIExyY());// { x: 0.3, y: 0.6, Y: 0.715158 }
console.log(blue.toHSLuv()); // { h: 265.87, s: 100, l: 32.3 }

// Color manipulation
const lightRed = red.adjustLightness(20);
console.log(lightRed.toHex()); // '#ff6666'

const desaturatedGreen = green.adjustSaturation(-50);
console.log(desaturatedGreen.toHex()); // '#40bf40'

// Generate harmonies
const [complement] = red.complementary();
console.log(complement.toHex()); // '#00ffff'

const [color1, color2] = blue.splitComplementary();
console.log(color1.toHex(), color2.toHex()); // '#ffaa00' '#ff5500'

// Mix colors
const purple = red.mix(blue, 0.5);
console.log(purple.toHex()); // '#800080'

// Get color information
red.getName().then(name => console.log(name)); // 'Red'
red.getInfo().then(info => console.log(info));
// Returns: { name, hex, rgb, hsl, luminance, requestedHex }

// Check brightness and lightness
console.log(red.getBrightness()); // 76.245
console.log(red.isLight()); // false

Color Conversion Functions

For situations where you need quick, one-off color conversions, color-core offers standalone conversion functions. These can be useful when you don't need the full functionality of the Color class.


import { hexToRgb, rgbToHsl, rgbToOklab } from 'color-core';

const rgb = hexToRgb('#00ff00');
console.log(rgb);  // { r: 0, g: 255, b: 0 }

const hsl = rgbToHsl(rgb);
console.log(hsl);  // { h: 120, s: 100, l: 50 }

const oklab = rgbToOklab(rgb);
console.log(oklab);  // { L: 0.866440, a: -0.233888, b: 0.179498 }

ColorPicker Component

color-core includes a customizable ColorPicker component for typescript applications. This component provides a user-friendly interface for color selection while allowing extensive customization to fit your application's needs.


import { ColorPicker } from 'color-core';

function MyComponent() {
  return (
    <ColorPicker
      initialColor={{ r: 255, g: 0, b: 0 }}
      onChange={(color) => console.log('Selected color:', color)}
      width={300}
      height={200}
    />
  );
}


API Reference

The following section provides a comprehensive overview of color-core's API. Each method and function is documented to help you understand its purpose and usage within your color manipulation workflows.You can find more detailed information in the official documentation.


Color Class

The Color class is the main entry point for color manipulations.


Constructor

new Color(color: string | RGB | HSL | HSV | CMYK | LAB | LCH | XYZ | YUV | Oklab | Oklch | HSLuv | HPLuv | CIExyY | HSI | HWB | AdobeRGB)
Creates a new Color instance from various color formats.

Conversion Methods


Method Return Type Description
toRgb() RGB Converts the color to RGB format
toSrgb() SRGB Converts the color to sRGB format
toHex() string Converts the color to HEX format
toHsl() HSL Converts the color to HSL format
toHsv() HSV Converts the color to HSV format
toHsi() HSI Converts the color to HSI format
toHwb() HWB Converts the color to HWB format
toLch() LCH Converts the color to LCH format
toYuv() YUV Converts the color to YUV format
toCmyk() CMYK Converts the color to CMYK format
toOklab() Oklab Converts the color to Oklab format
toOklch() Oklch Converts the color to Oklch format
toHSLuv() HSLuv Converts the color to HSLuv format
toHPLuv() HPLuv Converts the color to HPLuv format
toCIELuv() LUV Converts the color to CIELuv format
toCIExyY() CIExyY Converts the color to CIExyY format
toAdobeRGB() AdobeRGB Converts the color to Adobe RGB format
toXyz() XYZ Converts the color to XYZ (D65) format
toXyzD50() XYZ Converts the color to XYZ (D50) format
toLab() LAB Converts the color to LAB (D65) format
toLabD50() LAB Converts the color to LAB (D50) format

Harmony Methods


Method Parameters Return Type Description
complementary() None [Color, Color] Generates a complementary harmony
analogous() angle?: number [Color, Color, Color] Generates an analogous harmony
triadic() None [Color, Color, Color] Generates a triadic harmony
tetradic() angle?: number [Color, Color, Color, Color] Generates a tetradic harmony
splitComplementary() angle?: number [Color, Color, Color] Generates a split-complementary harmony
doubleSplitComplementary() angle?: number [Color, Color, Color, Color, Color] Generates a double split-complementary harmony
square() None [Color, Color, Color, Color] Generates a square harmony
monochromatic() count?: number Color[] Generates a monochromatic harmony
shades() count?: number Color[] Generates shades of the color
tints() count?: number Color[] Generates tints of the color
tones() count?: number Color[] Generates tones of the color

Manipulation Methods


Method Parameters Return Type Description
adjustLightness() amount: number Color Adjusts the lightness of the color
adjustSaturation() amount: number Color Adjusts the saturation of the color
adjustHue() amount: number Color Adjusts the hue of the color
adjustAlpha() amount: number Color Adjusts the alpha of the color
invert() None Color Inverts the color
grayscale() None Color Converts the color to grayscale
mix() color: Color, amount: number Color Mixes the color with another color

Utility Methods


Method Parameters Return Type Description
toString() includeAlpha?: boolean string Returns the color as a hex string
equals(other: Color) other: Color boolean Checks if two colors are equal
getBrightness() None number Calculates the perceived brightness (0-255)
isLight() threshold?: number boolean Determines if the color is light or dark
getName() None Promise<string> Returns the name of the closest matching color
getInfo() None Promise<ColorInfo> Returns detailed information about the color

Standalone Functions


Conversion Functions


Function Parameters Return Type Description
hexToRgb hex: string RGB Converts HEX to RGB
rgbToHex rgb: RGB string Converts RGB to HEX
rgbToHsl rgb: RGB HSL Converts RGB to HSL
hslToRgb hsl: HSL RGB Converts HSL to RGB
rgbToHsv rgb: RGB HSV Converts RGB to HSV
hsvToRgb hsv: HSV RGB Converts HSV to RGB
rgbToHsi rgb: RGB HSI Converts RGB to HSI
hsiToRgb hsi: HSI RGB Converts HSI to RGB
rgbToHwb rgb: RGB HWB Converts RGB to HWB
hwbToRgb hwb: HWB RGB Converts HWB to RGB
rgbToCmyk rgb: RGB CMYK Converts RGB to CMYK
cmykToRgb cmyk: CMYK RGB Converts CMYK to RGB
rgbToXyz rgb: RGB XYZ Converts RGB to XYZ (D65)
xyzToRgb xyz: XYZ RGB Converts XYZ to RGB (D65)
rgbToXyzD50 rgb: RGB XYZ Converts RGB to XYZ (D50)
xyzD50ToRgb xyz: XYZ RGB Converts XYZ (D50) to RGB
xyzD65ToD50 xyz: XYZ XYZ Converts XYZ from D65 to D50
xyzD50ToD65 xyz: XYZ XYZ Converts XYZ from D50 to D65
rgbToLab rgb: RGB LAB Converts RGB to LAB (D65)
labToRgb lab: LAB RGB Converts LAB to RGB (D65)
rgbToLabD50 rgb: RGB LAB Converts RGB to LAB (D50)
labD50ToRgb lab: LAB RGB Converts LAB (D50) to RGB
rgbToLch rgb: RGB LCH Converts RGB to LCH
lchToRgb lch: LCH RGB Converts LCH to RGB
rgbToOklab rgb: RGB Oklab Converts RGB to Oklab
oklabToRgb oklab: Oklab RGB Converts Oklab to RGB
rgbToOklch rgb: RGB Oklch Converts RGB to Oklch
oklchToRgb oklch: Oklch RGB Converts Oklch to RGB
rgbToHPLuv rgb: RGB HPLuv Converts RGB to HPLuv
hpluvToRgb hpluv: HPLuv RGB Converts HPLuv to RGB
rgbToHSLuv rgb: RGB HSLuv Converts RGB to HSLuv
hsluvToRgb hsluv: HSLuv RGB Converts HSLuv to RGB
rgbToCIExyY rgb: RGB CIExyY Converts RGB to CIE xyY
ciexyYToRgb ciexyY: CIExyY RGB Converts CIE xyY to RGB
rgbToCIELuv rgb: RGB CIELuv Converts RGB to CIE Luv
cieLuvToRgb cieLuv: CIELuv RGB Converts CIE Luv to RGB
rgbToYuv rgb: RGB YUV Converts RGB to YUV
yuvToRgb yuv: YUV RGB Converts YUV to RGB
rgbToSrgb rgb: RGB RGB Converts RGB to sRGB
srgbToRgb rgb: RGB RGB Converts sRGB to RGB
rgbToAdobeRGB rgb: RGB RGB Converts RGB to Adobe RGB
adobeRGBToRGB rgb: RGB RGB Converts Adobe RGB to RGB

Harmony Functions


Function Parameters Return Type Description
complementary color: Color [Color, Color] Generates a complementary harmony
analogous color: Color, angle? [Color, Color, Color] Generates an analogous harmony
triadic color: Color [Color, Color, Color] Generates a triadic harmony
tetradic color: Color, angle? [Color, Color, Color, Color] Generates a tetradic harmony
splitComplementary color: Color, angle? [Color, Color, Color] Generates a split-complementary harmony
doubleSplitComplementary color: Color, angle? [Color, Color, Color, Color, Color] Generates a double split-complementary harmony
square color: Color [Color, Color, Color, Color] Generates a square harmony
monochromatic color: Color, count? Color[] Generates a monochromatic harmony
shades color: Color, count? Color[] Generates shades of the color
tints color: Color, count? Color[] Generates tints of the color
tones color: Color, count? Color[] Generates tones of the color

Manipulation Functions


Function Parameters Return Type Description
adjustLightness color: Color, amount: number Color Adjusts the lightness of the color
adjustSaturation color: Color, amount: number Color Adjusts the saturation of the color
adjustHue color: Color, amount: number Color Adjusts the hue of the color
adjustAlpha color: Color, amount: number Color Adjusts the alpha of the color
invert color: Color Color Inverts the color
grayscale color: Color Color Converts the color to grayscale
mix color1: Color, color2: Color, amount: number Color Mixes two colors

Types


type RGB = { r: number; g: number; b: number; a?: number };
type SRGB = { r: number; g: number; b: number };
type HSL = { h: number; s: number; l: number; a?: number };
type HSV = { h: number; s: number; v: number; a?: number };
type CMYK = { c: number; m: number; y: number; k: number };
type LAB = { l: number; a: number; b: number };
type LCH = { l: number; c: number; h: number };
type XYZ = { x: number; y: number; z: number };
type YUV = { y: number; u: number; v: number };
type Oklab = { L: number; a: number; b: number };
type Oklch = { L: number; C: number; h: number };
type HPLuv = { h: number; p: number; l: number };
type HSLuv = { h: number; s: number; l: number };
type CIExyY = { x: number; y: number; Y: number };
type CIELuv = { L: number; u: number; v: number };
type HSI = { h: number; s: number; i: number };
type HWB = { h: number; w: number; b: number };
type AdobeRGB = { r: number; g: number; b: number };


Examples

These practical examples demonstrate how to use various features of color-core to solve common color-related tasks. Feel free to adapt these examples to your specific needs.

Color Manipulation


import { Color } from 'color-core';

const color = new Color('#ff0000');

// Lighten the color
const lighterColor = color.adjustLightness(20);
console.log(lighterColor.toHex()); // '#ff6666'

// Desaturate the color
const desaturatedColor = color.adjustSaturation(-50);
console.log(desaturatedColor.toHex()); // '#bf4040'

// Change the hue
const hueShiftedColor = color.adjustHue(120);
console.log(hueShiftedColor.toHex()); // '#00ff00'

// Invert the color
const invertedColor = color.invert();
console.log(invertedColor.toHex()); // '#00ffff'

// Convert to grayscale
const grayscaleColor = color.grayscale();
console.log(grayscaleColor.toHex()); // '#4d4d4d'

// Mix with another color
const mixedColor = color.mix(new Color('#0000ff'), 0.5);
console.log(mixedColor.toHex()); // '#800080'

// Get color name
color.getName().then(name => console.log(name)); // 'Red'

// Get color information
color.getInfo().then(info => console.log(info));
// Returns: { name, hex, rgb, hsl, luminance, requestedHex }

// Check brightness and if the color is light
console.log(color.getBrightness()); // 76.245
console.log(color.isLight()); // false
---

Advanced Usage

The advanced usage section covers more complex scenarios, including working with less common color spaces and generating sophisticated color harmonies. These examples showcase the depth of color-core's capabilities.

Working with Different Color Spaces


import { Color } from 'color-core';

// Create a color in Oklab space
const oklabColor = new Color({ L: 0.627955, a: 0.224863, b: 0.125846 });
console.log(oklabColor.toHex()); // '#ff0000'

// Convert to CIE xyY
const xyYColor = oklabColor.toCIExyY();
console.log(xyYColor); // { x: 0.64, y: 0.33, Y: 0.2126 }

// Create a color in HSLuv space
const hsluvColor = new Color({ h: 12.177, s: 100, l: 53.237 });
console.log(hsluvColor.toRgb()); // { r: 255, g: 0, b: 0 }

// Convert to Adobe RGB
const adobeRGBColor = hsluvColor.toAdobeRGB();
console.log(adobeRGBColor); // { r: 255, g: 0, b: 0 }

Color Harmonies


import { Color } from 'color-core';

const baseColor = new Color('#ff0000');

// Generate complementary color
const [complement] = baseColor.complementary();
console.log(complement.toHex()); // '#00ffff'

// Generate analogous colors
const [analog1, analog2] = baseColor.analogous();
console.log(analog1.toHex(), analog2.toHex()); // '#ff8000' '#ff0080'

// Generate triadic colors
const [triad1, triad2] = baseColor.triadic();
console.log(triad1.toHex(), triad2.toHex()); // '#00ff00' '#0000ff'

// Generate tetradic colors
const [tetra1, tetra2, tetra3] = baseColor.tetradic();
console.log(tetra1.toHex(), tetra2.toHex(), tetra3.toHex()); // '#80ff00' '#00ffff' '#8000ff'

// Generate split-complementary colors
const [split1, split2] = baseColor.splitComplementary();
console.log(split1.toHex(), split2.toHex()); // '#00ff80' '#0080ff'

// Generate shades
const shades = baseColor.shades(5);
shades.forEach(shade => console.log(shade.toHex()));
// '#ff0000' '#cc0000' '#990000' '#660000' '#330000'

// Generate tints
const tints = baseColor.tints(5);
tints.forEach(tint => console.log(tint.toHex()));
// '#ff0000' '#ff3333' '#ff6666' '#ff9999' '#ffcccc'

As you become more familiar with color-core, you'll likely discover additional ways to leverage its functionality in your projects. The library's extensive color space support and manipulation tools provide a robust foundation for a wide range of color-related tasks.


Versioning


This project follows Semantic Versioning. For the versions available, see the tags on this repository.



Contributing


Contributions are welcome and greatly appreciated!



License


This project is licensed under the MIT License - see the LICENSE file for details.



Support


If you're having any problem, please raise an issue on GitHub and I will be happy to help.



Acknowledgements


HSLuv & HPLuv Conversions by Alexei Boronine

Oklab & Oklch Math Used by Björn Ottosson

Color Name API by meodai



Code Coverage


codecov


Built with ❤️ by iamlite


Back to top :arrow_up:

changelog


id: changelog title: Changelog sidebar_label: Changelog


Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

TODO

  • more parsers for CSS color strings

[1.4.0] - 2024-07-25

Added

  • New accessibility features:
    • getRelativeLuminance: Calculate the relative luminance of a color
    • getContrastRatio: Calculate the contrast ratio between two colors
    • getWCAGCompliance: Determine WCAG compliance level for color contrast
  • New methods in Color class: getRelativeLuminance(), getContrastRatio(), getWCAGCompliance()
  • Partial implementation of parsers for CSS color strings. More coming soon.

Changed

  • Clarified behavior of rgbToHex function for alpha values:
    • Alpha values of 0.995 and above now consistently produce 'ff'
    • Other alpha values are rounded to the nearest integer
  • Updated documentation with new accessibility features and examples.
  • Improved test coverage for new accessibility features.

Attention

  • Deprecated the color picker component in favor of a new color picker package to be released soon.
  • Removed dependencies for React & React DOM since those are no longer needed.

Fixed

[1.3.3] - 2024-07-21

Added

  • New color scale functions:
    • Sequential Scale
    • Diverging Scale
    • Multi-Hue Sequential Scale
    • Perceptually Uniform Scale
    • Qualitative Scale

Changed

  • New git structure using a monorepo setup with yarn workspaces
  • New documentation site built with Docusaurus v3 + typedoc
  • Updated demo site to showcase new color scale functions

[1.3.1] - 2024-07-17

Changed

  • Updated SRGB type definitions to include prefix to avoid conflicts with other color spaces

[1.3.0] - 2024-07-17

BIG UPDATE 🎉

Added

  • <input checked="" disabled="" type="checkbox"> Support for AdobeRGB, Oklab, Oklch, HSLuv, HPLuv, CIExyY, CIELuv, HWB, sRGB, and HSI color spaces
  • <input checked="" disabled="" type="checkbox"> Support for converting between D50 and D65 white points for XYZ and Lab color spaces
  • <input checked="" disabled="" type="checkbox"> New conversion functions:
    • rgbToOklab(), oklabToRgb()
    • rgbToOklch(), oklchToRgb()
    • rgbToHSLuv(), hsluvToRgb()
    • rgbToHPLuv(), hpluvToRgb()
    • rgbToCIExyY(), ciexyYToRgb()
    • rgbToCIELuv(), cieLuvToRgb()
    • rgbToHwb(), hwbToRgb()
    • rgbToHsi(), hsiToRgb()
    • rgbToSrgb(), srgbToRgb()
    • adobeRGBToRGB(), rgbToAdobeRGB()
    • xyzD50ToD65(), xyzD65ToD50()
    • xyzD50ToRgb(), rgbToXyzD50()
    • labD50ToRgb(), rgbToLabD50()
  • <input checked="" disabled="" type="checkbox"> New methods in Color class: toOklab(), toOklch(), toHSLuv(), toHPLuv(), toCIExyY(), toCIELuv(), toHWB(), toHSI(), toSrgb(), toAdobeRGB()
  • <input checked="" disabled="" type="checkbox"> Updated demo site to showcase new color spaces and conversions

Changed

  • NAME CHANGE! 'next-color' is now 'color-core'
  • New Demo Site! Built with next-ui :artist:
  • Updated type definitions to include Oklab, Oklch, HSLuv, HPLuv, CIExyY, and CIELUV
  • Expanded test coverage for new color spaces, refactored tests to be less dumb.
  • New calculations for LCH color space to improve accuracy
  • New calculations for XYZ and LAB color spaces to account for white point differences

Documentation

[1.2.0] - 2024-07-07

Added

  • Color naming functionality: getColorName() method to get the closest named color from api.color.pizza based on the provided color
  • Brightness calculation:
    • getBrightness() method to calculate perceived brightness
    • isLight() method to determine if a color is light or dark

Changed

  • Improved performance of color conversion functions
  • Refactored color manipulation methods for better readability and maintainability
  • Updated demo site with new features and examples
  • Improved error handling and type safety
  • Improved documentation with more examples and explanations
  • Enhanced test coverage
  • Added CI/CD pipeline for automated testing and deployment

Fixed

  • Edge case in mix() function where alpha values were not being considered correctly
  • Precision loss in successive color space conversions
  • Addressed potential "Maximum update depth exceeded" error during rapid color picker interactions
  • Improved performance of ColorPicker component for better performance during rapid color changes

[1.1.0] - 2024-07-07

Fixed

  • removed test files from npm package - woops!

[1.1.0] - 2024-07-07

Added

  • SO many tests! 🎉

Changed

  • Improved performance of RGB to HSL conversion
  • Other minor conversion optimizations
  • Enhanced type safety for all color manipulation functions
  • Updated demo site with new features and examples

Fixed

  • Edge case in mix() function where alpha values were not being considered correctly
  • Precision loss in successive color space conversions

Deprecated

  • Compound color harmony function in favor of Split-Complementary

Security

  • Updated dependencies to address potential vulnerabilities

Documentation

  • Added examples for all new features in README.md
  • Improved API documentation with more detailed explanations and use cases + a new fancy theme

[1.0.1] - 2024-07-05

Changed

  • Optimized ColorPicker component for better performance during rapid color changes.
  • Implemented debouncing for color updates to reduce unnecessary re-renders.

Added

  • useCallback implementation in ColorPicker for improved render efficiency.
  • New hueSliderHeight prop in ColorPicker for customizable hue slider height.

Fixed

  • Addressed potential "Maximum update depth exceeded" error during rapid color picker interactions.

[1.0.0] - 2024-07-04

Added

  • New Color Picker functionality
  • Unified Color class for easy color manipulations
  • Additional color harmony functions:
    • Compound
    • Double Split-Complementary
    • Shades
    • Square
    • Tints
    • Tones
  • New color manipulation methods:
    • adjustLightness
    • adjustSaturation
    • adjustHue
    • adjustAlpha
    • invert
    • grayscale
    • mix
  • Support for XYZ and YUV color spaces
  • Improved type safety and error handling

Changed

  • Upgraded from version 0.2.0 to 1.0.0
  • Refactored and optimized existing color conversion and harmony functions
  • Enhanced documentation and examples in README.md

Fixed

  • Various bug fixes and performance improvements

0.2.0 - 2024-07-03

Added

  • New color harmony functions:
    • Square
    • Double Split-Complementary
    • Compound (Accented Analog)
    • Shades
    • Tints
    • Tones
  • Extended Color class with new harmony methods

Changed

  • /

Fixed

  • /

[0.1.2] - 2024-07-02

Added

  • Color harmony functions:
    • Complementary
    • Analogous
    • Triadic
    • Tetradic (Rectangle)
    • Split-Complementary
    • Monochromatic
  • Unified Color class for easy color manipulations
  • Demo site showcasing color conversions and harmonies

Changed

  • Improved TypeScript typings for better developer experience
  • Enhanced error handling for invalid color inputs

Fixed

  • Edge cases in color conversion algorithms

0.1.0 - 2024-07-01

Added

  • Initial release of the color-core library
  • Color conversion functions:
    • RGB to/from HEX
    • RGB to/from HSL
    • RGB to/from HSV
    • RGB to/from CMYK
    • RGB to/from LAB
    • RGB to/from LCH
  • Basic TypeScript support with type definitions
  • Basic error handling for invalid inputs
  • Test suite for verifying color conversions