# Color picker (UI SDK): OKLCH

> With `space="oklch"`, add `ColorPickerAreaCanvas` to paint the area. Colors outside the screen’s gamut stay clear, and a thumb dragged there settles on the closest color inside when you let go.

Canonical: https://hextaui.com/docs/ui-sdk-color-picker/examples/oklch

Component docs: https://hextaui.com/docs/ui-sdk-color-picker

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/ui-sdk-color-picker-oklch.json
```

This adds `components/examples/ui-sdk-color-picker/oklch.tsx` with the Color picker component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/ui-sdk-color-picker/oklch.tsx"
import {
  ColorPicker,
  ColorPickerArea,
  ColorPickerAreaCanvas,
  ColorPickerAreaThumb,
  ColorPickerInput,
  ColorPickerSlider,
  ColorPickerSwatch,
} from "@/components/ui/ui-sdk-color-picker"

function UiSdkColorPickerOklch() {
  return (
    <ColorPicker
      aria-label="Accent"
      space="oklch"
      defaultValue="oklch(0.62 0.19 259)"
    >
      <ColorPickerArea>
        <ColorPickerAreaCanvas />
        <ColorPickerAreaThumb />
      </ColorPickerArea>
      <ColorPickerSlider channel="hue" />
      <div className="flex items-center gap-2">
        <ColorPickerSwatch />
        <ColorPickerInput aria-label="OKLCH" />
      </div>
    </ColorPicker>
  )
}

export { UiSdkColorPickerOklch }
```

## Props in this example

### ColorPicker

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultValue` | `string` | `"black"` |  |
| `space` | `"hsv" \| "hsl" \| "srgb" \| "oklch"` | `"hsv"` | Which channels the parts edit. |

### ColorPickerSlider

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `channel` | `ColorChannel` | – | Hue, or blue in sRGB, by default. |

## More Color picker examples

- [Inline](https://hextaui.com/docs/ui-sdk-color-picker/examples/inline)
- [Alpha](https://hextaui.com/docs/ui-sdk-color-picker/examples/alpha)
- [Presets and channels](https://hextaui.com/docs/ui-sdk-color-picker/examples/channels)
- [Vertical sliders](https://hextaui.com/docs/ui-sdk-color-picker/examples/vertical)
- [Controlled](https://hextaui.com/docs/ui-sdk-color-picker/examples/controlled)
- [Form](https://hextaui.com/docs/ui-sdk-color-picker/examples/form)
- [Disabled](https://hextaui.com/docs/ui-sdk-color-picker/examples/disabled)
- [Read-only](https://hextaui.com/docs/ui-sdk-color-picker/examples/read-only)
- [Right to left](https://hextaui.com/docs/ui-sdk-color-picker/examples/rtl)
