/** * External dependencies */ import { colord, Colord } from 'colord'; /** * Internal dependencies */ import { InputWithSlider } from './input-with-slider'; interface HslInputProps { color: Colord; onChange: ( nextColor: Colord ) => void; enableAlpha: boolean; } export const HslInput = ( { color, onChange, enableAlpha }: HslInputProps ) => { const { h, s, l, a } = color.toHsl(); return ( <> { onChange( colord( { h: nextH, s, l, a } ) ); } } /> { onChange( colord( { h, s: nextS, l, a, } ) ); } } /> { onChange( colord( { h, s, l: nextL, a, } ) ); } } /> { enableAlpha && ( { onChange( colord( { h, s, l, a: nextA / 100, } ) ); } } /> ) } ); };