import { createVNode as _createVNode } from "vue";
import { defineComponent } from 'vue';
import { generateColor } from '../util';
var ColorClear = defineComponent({
  name: 'ColorClear',
  props: ['prefixCls', 'value', 'onChange', 'colorCleared'],
  setup: function setup(props) {
    var handleClick = function handleClick() {
      if (props.value && !props.colorCleared) {
        var _props$onChange;
        var hsba = props.value.toHsb();
        hsba.a = 0;
        var genColor = generateColor(hsba);
        (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, genColor);
      }
    };
    return function () {
      return _createVNode("div", {
        "class": "".concat(props.prefixCls, "-clear"),
        "onClick": handleClick
      }, null);
    };
  }
});
export default ColorClear;