import React, { useRef } from 'react' import { Input, Popover } from 'antd' import { usePrefix } from '@pind/designable-react' import { SketchPicker } from 'react-color' import './styles.less' export interface IColorInputProps { value?: string onChange?: (color: string) => void } export const ColorInput: React.FC = (props) => { const container = useRef(null) const prefix = usePrefix('color-input') const color = props.value as string return (
{ props.onChange?.(e.target.value) }} placeholder="Color" prefix={ container.current as HTMLDivElement} content={ { props.onChange?.(`rgba(${rgb.r},${rgb.g},${rgb.b},${rgb.a})`) }} /> } >
} />
) }