asafefe.dev
Lab

Lab/07

Palette Generator

One hue drives a five-step ramp built in HSL so the steps stay related. Slide or shuffle, then click a swatch to copy its hex.

  • Tool
  • Color
Click a swatch to copy
7°
76%

Installation

Add Palette Generator to your project with the shadcn CLI. The files land in components/lab, ready to edit.

$ pnpm dlx shadcn@latest add @soultel/lab-palette-generator

Or by URL: https://asafefe.dev/r/lab-palette-generator.json

Brings along

  • lucide-react
  • utils
  • @soultel/lab-controls

Usage

example.tsx5 lines
import { PaletteGenerator } from "@/components/lab/palette-generator"

export function Example() {
  return <PaletteGenerator defaultHue={210} onChange={(hexes) => console.log(hexes)} />
}

Props

PropTypeDefaultDescription
defaultHuenumber7Starting base hue, 0 to 359.
defaultSaturationnumber76Starting saturation, 20 to 95.
onChange(hexes: string[]) => void-Called with the five hex values on every change.