onchange
Description
Fires on a color change when a new value is selected via the input field or sliderUsage
onchange?: (ev: { value: string; input?: boolean }) => void;
Parameters
The callback of the event takes an object with the following parameter:
- value - (required) HEX code of the newly selected color
- input - (optional) true, if the value is being typed (see the Details section below)
Example
<script>
function handleChange({ value }) {
console.log(value);
// => "#75FFD6"
}
</script>
<ColorBoard onchange={handleChange}/>