"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const floatRegex = require("./dist-es-value-types-utils-float-regex.cjs");
const isNullish = require("./dist-es-value-types-utils-is-nullish.cjs");
const singleColorRegex = require("./dist-es-value-types-utils-single-color-regex.cjs");
const isColorString = (type, testProp) => (v) => {
  return Boolean(typeof v === "string" && singleColorRegex.singleColorRegex.test(v) && v.startsWith(type) || testProp && !isNullish.isNullish(v) && Object.prototype.hasOwnProperty.call(v, testProp));
};
const splitColor = (aName, bName, cName) => (v) => {
  if (typeof v !== "string")
    return v;
  const [a, b, c, alpha] = v.match(floatRegex.floatRegex);
  return {
    [aName]: parseFloat(a),
    [bName]: parseFloat(b),
    [cName]: parseFloat(c),
    alpha: alpha !== void 0 ? parseFloat(alpha) : 1
  };
};
exports.isColorString = isColorString;
exports.splitColor = splitColor;
//# sourceMappingURL=dist-es-value-types-color-utils.cjs.map
