import { clamp } from "./dist-es-utils-clamp.js";
import { number, alpha } from "./dist-es-value-types-numbers-index.js";
import { sanitize } from "./dist-es-value-types-utils-sanitize.js";
import { isColorString, splitColor } from "./dist-es-value-types-color-utils.js";
const clampRgbUnit = (v) => clamp(0, 255, v);
const rgbUnit = {
  ...number,
  transform: (v) => Math.round(clampRgbUnit(v))
};
const rgba = {
  test: /* @__PURE__ */ isColorString("rgb", "red"),
  parse: /* @__PURE__ */ splitColor("red", "green", "blue"),
  transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + rgbUnit.transform(red) + ", " + rgbUnit.transform(green) + ", " + rgbUnit.transform(blue) + ", " + sanitize(alpha.transform(alpha$1)) + ")"
};
export {
  rgbUnit,
  rgba
};
//# sourceMappingURL=dist-es-value-types-color-rgba.js.map
