React Color Saturation
Install
npm i @uiw/react-color-saturation
Usage
import Saturation from '@uiw/react-color-saturation';
function Demo() {
const [hsva, setHsva] = useState({ h: 0, s: 0, v: 68, a: 1 });
return (
<Saturation
hsva={hsva}
onChange={(newColor) => {
setHsva({ ...hsva, ...newColor, a: hsva.a });
}}
/>
);
}
Props
import { HsvaColor } from '@uiw/color-convert';
interface SaturationProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
prefixCls?: string;
hsva: HsvaColor;
onChange?: (newColor: HsvaColor) => void;
}
License
Licensed under the MIT License.