import { PointerProps, hexToHsva, HsvaColor, hsvaToHex, hsvaToHexa, Saturation, Hue, Alpha, } from "@uiw/react-color/esm"; import React, { useState } from "react"; import HexInput from "./hex-input"; import AlphaInput from "./alpha-input"; import { isHexColor } from "../../../utils/colors"; interface Props { color: string; onChange: (newColor: string) => void; } const ColorPickerPalettePointer = ({ left, top }: PointerProps) => { const progressLeft = parseInt(left ?? "100%") / 100; const progressTop = parseInt(top ?? "0%") / 100; return (
); }; const ColorPickerPalette = ({ color, onChange }: Props) => { const hsvaColor: HsvaColor = hexToHsva(isHexColor(color) ? color : "#ff0000"); const [hue, setHue] = useState(hsvaColor.h); const [alpha, setAlpha] = useState(hsvaColor.a); const handleChange = (value: Partial