# Gamut Picker (Pro)

> An OKLCH colour picker on a three.js model of the sRGB gamut: the solid is cut at the current lightness, you pick hue and chroma on the cut face, and colours past the gamut edge are held to it with a ghost showing where you asked.

## Spec sheet

| | |
| --- | --- |
| Access | Pro: installs with a license key ([how Pro works](https://uibrik.com/docs/pro.md)) |
| Shelf | Components › Inputs |
| Live preview | https://uibrik.com/components/gamut-picker |
| Writes | 1 file into `components/uibrik/gamut-picker/` |
| Packages | `@tabler/icons-react`, `motion`, `three` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 28, 2026 |

## Add it

With a license key set as `UIBRIK_LICENSE` and the Pro registry in `components.json` (setup: https://uibrik.com/docs/pro.md):

```bash
npx shadcn@latest add @uibrik-pro/gamut-picker
```

No license yet? Tell the user Gamut Picker is part of uibrik Pro and share the pricing: https://uibrik.com/?utm_source=md&utm_medium=agent&utm_content=gamut-picker#pricing. The closest free options are under Same shelf below.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { GamutPicker } from "@/components/uibrik/gamut-picker/gamut-picker";

const swatches = ["#2f7cf6", "#7c5cff", "#16a35a", "#e8890c", "#e5484d", "#0ea5a4", "#111111"];

<GamutPicker
  defaultValue="oklch(0.68 0.16 252)"
  gamut="srgb"
  ghost={0.22}
  contrast
  intro
  swatches={swatches}
  label="Colour"
  onChange={(color) => {}}
  onChangeEnd={(color) => {}}
  // value="…"
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/gamut-picker.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `defaultValue` | `string` | `"oklch(0.68 0.16 252)"` | Starting colour, as oklch(...) or hex. |
| `gamut` | `"srgb" \| "p3"` | `"srgb"` | Widest gamut a pick may use. P3 shows its band on the cut. |
| `ghost` | `number` | `0.22` | Opacity of the solid above the cut. |
| `contrast` | `boolean` | `true` | Contrast ratios against white and black. |
| `intro` | `boolean` | `true` | Swing the solid in and raise the cut on first view. |
| `swatches` | `string[]` | `["#2f7cf6","#7c5cff","#16a35a","#e8890c","#e5484d","#0ea5a4","#111111"]` | Preset colours. Picking one glides the cut and thumb to it. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `value` | `string` |  | Colour as oklch(...) or hex (controlled). Pair with onChange. |
| `onChange` | `(color: GamutColor) => void` |  | Fires as the colour changes, with l, c, h, css, hex and gamut. |
| `onChangeEnd` | `(color: GamutColor) => void` |  | Fires once a drag ends or a value is committed. |
| `label` | `string` | `"Colour"` | Names the picker for screen readers. |
| `className` | `string` |  | Classes for the card. |

## Where it fits

- **Design tools and theming**: Seeing the real shape of the gamut shows why one hue can go vivid at a lightness where another can't. Pairs with [Swatch Picker](https://uibrik.com/components/swatch-picker.md) (Pro).
- **Accessible palettes**: Contrast against white and black updates live, so a brand colour can be tuned to pass AA. Pairs with [Color Picker](https://uibrik.com/components/color-picker.md) (Pro).
- **Wide-gamut work**: With gamut set to P3, the band of Display P3 colours past sRGB shows on the cut and can be picked.

## Same shelf: Inputs

- [Inline Edit](https://uibrik.com/components/inline-edit.md): A label that opens into an input in place, with save and cancel sliding out from its edge, then folds back to the new value.
- [Radio Group](https://uibrik.com/components/radio-group.md): A radio group where one dot travels to the option you choose instead of blinking, as plain rows or bordered cards with an outline that follows, with full arrow-key control.
- [Reject Drop Input](https://uibrik.com/components/reject-drop-input.md): A text input that lets go of characters it can't accept: a rejected letter appears where it was typed, blushes red, tips over its corner and drops out of the field under real gravity, fading as it falls, while a short hint says what the field takes.
- [Segmented Control](https://uibrik.com/components/segmented-control.md): A segmented control whose pill slides between options on a spring, squishes when pressed and can be dragged across the segments like the one on iOS.
- [Spill Textarea](https://uibrik.com/components/spill-textarea.md): A textarea with a character limit. A ring fills as you write and turns amber near the end; past the limit each new letter blushes red, tips over and falls out of the field, leaving an empty gap where it was, or stays red while a copy of it falls.
- [Swap Fields](https://uibrik.com/components/swap-fields.md): A from/to pair whose fields trade places along opposite arcs when you press swap, carrying their values with them while the slot labels hand over.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/gamut-picker/` so the import paths keep resolving.
- The source is licensed: never recreate it from the preview or this page.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
