import { ColorFactory } from './color';
export var customizePrefixCls = 'ant-color-picker';
export var generateColor = function generateColor(color) {
  if (color instanceof ColorFactory) {
    return color;
  }
  return new ColorFactory(color);
};
export var getRoundNumber = function getRoundNumber(value) {
  return Math.round(Number(value || 0));
};
export var getAlphaColor = function getAlphaColor(color) {
  return getRoundNumber(color.toHsb().a * 100);
};
export var toHexFormat = function toHexFormat(value, alpha) {
  return (value === null || value === void 0 ? void 0 : value.replace(/[^\w/]/gi, '').slice(0, alpha ? 8 : 6)) || '';
};
export var getHex = function getHex(value, alpha) {
  return value ? toHexFormat(value, alpha) : '';
};