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
lab/palette-generator7°
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-generatorOr by URL: https://asafefe.dev/r/lab-palette-generator.json
Brings along
- lucide-react
- utils
- @soultel/lab-controls
Usage
import { PaletteGenerator } from "@/components/lab/palette-generator"
export function Example() {
return <PaletteGenerator defaultHue={210} onChange={(hexes) => console.log(hexes)} />
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| defaultHue | number | 7 | Starting base hue, 0 to 359. |
| defaultSaturation | number | 76 | Starting saturation, 20 to 95. |
| onChange | (hexes: string[]) => void | - | Called with the five hex values on every change. |
