import { defineComponent, createVNode as _createVNode } from 'vue';
import '../color';
import { generateColor } from '../util';
const ColorClear = defineComponent({
  name: 'ColorClear',
  inheritAttrs: false,
  props: {
    prefixCls: String,
    value: Object,
    onChange: Function
  },
  setup(props) {
    const handleClick = () => {
      if (props.onChange && props.value && !props.value.cleared) {
        const hsba = props.value.toHsb();
        hsba.a = 0;
        const genColor = generateColor(hsba);
        genColor.cleared = true;
        props.onChange(genColor);
      }
    };
    return () => _createVNode("div", {
      "class": `${props.prefixCls}-clear`,
      "onClick": handleClick
    }, null);
  }
});
export default ColorClear;