Design Utilityv1.0.0
@sopkit/color
High-performance colorspace converter supporting HEX, RGB, and HSL representations.
Overview
A lightweight color math engine. Ideal for dynamic themes, UI dashboards, canvas rendering, and color palette creation.
Installation
npm install @sopkit/color
Quick Start (ESM)
import { hexToRgb, rgbToHsl } from "@sopkit/color";
const rgb = hexToRgb("#3b82f6");
const hsl = rgbToHsl(rgb.r, rgb.g, rgb.b);API Reference
hexToRgb(hex: string): RGBConverts HEX color string to RGB.
rgbToHex(r, g, b): stringConverts RGB components to HEX.
rgbToHsl(r, g, b): HSLConverts RGB to HSL components.
hslToRgb(h, s, l): RGBConverts HSL to RGB components.
Rivals Comparison
How @sopkit/color compares against the typical industry standard (color / color-convert):
Dependencies
0 (Zero dependencies)Has downstream dependencies
Weight
2.3 KB28 KB
Tree-Shaking
Fully supported (ESM Named exports)Often imports large modules
SopKit Guarantee
All libraries in the SopKit ecosystem are guaranteed to have zero server calls, zero analytical trackers, and 100% client-side privacy-first execution.