# Color Picker ## Example ```svelte

Inline Color Picker

Popover Color Picker

``` ## Documentation ## Usage ```svelte ``` ### Credits - Adapted from [svelte-color-select](https://github.com/CaptainCodeman/svelte-color-select). ## API Reference ### ColorPicker A full color picker with a saturation/value area, hue slider, and optional quick-select swatches. Supports RGB, OKLab, and OKHsv color spaces. | Prop | Type | Default | Description | |------|------|---------|-------------| | rgb | `{ r: number; g: number; b: number }` | `-` | The current color in RGB format (0-255). (bindable) | | oklab | `{ l: number; a: number; b: number }` | `-` | The current color in OKLab format. (bindable) | | okhsv | `{ h: number; s: number; v: number }` | `-` | The current color in OKHsv format. (bindable) | | onchange | `(color: { hex: string; rgb: RGB; oklab: OKlab; okhsv: OKhsv; oklch: OKlch }) => void` | `-` | Callback invoked when the color changes. Provides the color in all supported formats. | | quickSelects | `{ label: string; rgb?: RGB; oklab?: OKlab; okhsv?: OKhsv }[]` | `[]` | Quick-select color swatches displayed below the picker. (bindable) | | class | `string` | `-` | Additional CSS classes to apply. | ### PopoverColorPicker A color picker wrapped in a popover, triggered by a color swatch button. | Prop | Type | Default | Description | |------|------|---------|-------------| | rgb | `{ r: number; g: number; b: number }` | `-` | The current color in RGB format (0-255). (bindable) | | oklab | `{ l: number; a: number; b: number }` | `-` | The current color in OKLab format. (bindable) | | okhsv | `{ h: number; s: number; v: number }` | `-` | The current color in OKHsv format. (bindable) | | onchange | `(color: { hex: string; rgb: RGB; oklab: OKlab; okhsv: OKhsv; oklch: OKlch }) => void` | `-` | Callback invoked when the color changes. | | quickSelects | `{ label: string; rgb?: RGB; oklab?: OKlab; okhsv?: OKhsv }[]` | `[]` | Quick-select color swatches. (bindable) | | side | `'top' | 'right' | 'bottom' | 'left'` | `'bottom'` | The preferred side of the trigger to render the popover. | | sideOffset | `number` | `10` | The distance in pixels from the trigger. | | class | `string` | `-` | Additional CSS classes to apply. |