Color
A color picker.
Wraps Tweakpane's color input binding.
Usage outside of a <Pane> component will implicitly wrap the color picker in <Pane position="inline">.
<script lang="ts"> import { Color } from 'svelte-tweakpane-ui'
let startColor = '#fff000' let endColor = '#ff00ff'</script>
<Color bind:value={startColor} label="Start Color" /><Color bind:value={endColor} label="End Color" />
<div class="demo" style:--a={startColor} style:--b={endColor}></div>
<style> .demo { aspect-ratio: 1; width: 100%; background: linear-gradient(to top, var(--a), var(--b)); }</style>| bindablerequired | |
| Description | A color value to control. Use either a color-like string (e.g. #ff00ff), or an object with |
|---|---|
| Type | ColorValue |
| optional | |
| Description | Whether to treat values as floats from 0.0 to 1.0, or integers from 0 to 255. |
|---|---|
| Type | 'float' | 'int' |
| Default | 'int' |
| optional | |
| Description | Prevent interactivity and gray out the control. |
|---|---|
| Type | boolean |
| Default | false |
| optional | |
| Description | Text displayed next to control. |
|---|---|
| Type | string |
| Default | undefined |
| optional | |
| Description | Custom color scheme. |
|---|---|
| Type | Theme |
| Default | undefinedInherits default Tweakpane theme equivalent to ThemeUtils.presets.standard, or the theme set with setGlobalDefaultTheme(). |
| optional | |
| Description | Allow users to interactively expand / contract the picker. |
|---|---|
| Type | boolean |
| Default | true |
| bindableoptional | |
| Description | Expand or collapse the input's picker. |
|---|---|
| Type | boolean |
| Default | false |
| optional | |
| Description | The style of value "picker" to use in the input. |
|---|---|
| Type | 'inline' | 'popup' |
| Default | 'popup' |
| Description | Fires when This event is provided for advanced use cases. It's usually preferred to bind to the The |
|---|---|
| Extends | ValueChangeEvent |
| Type | ColorChangeEvent |