"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _vue = require("vue");
require("../color");
var _util = require("../util");
const ColorClear = (0, _vue.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 = (0, _util.generateColor)(hsba);
        genColor.cleared = true;
        props.onChange(genColor);
      }
    };
    return () => (0, _vue.createVNode)("div", {
      "class": `${props.prefixCls}-clear`,
      "onClick": handleClick
    }, null);
  }
});
var _default = exports.default = ColorClear;