import { TinyColor as g } from "@ctrl/tinycolor";
import { ColorFormat as a } from "../types/colors.es.js";
const i = (t, r, n = !0) => {
  const e = new g(s(t));
  switch (r) {
    case a.Rgba:
      return e.toRgbString();
    case a.Hex: {
      const o = e.toHexString();
      return n && t.alpha && t.alpha < 1 ? `${o} ${Math.trunc(e.getAlpha() * 100)}%` : o;
    }
    default:
      return e.toHexString();
  }
}, p = (t) => {
  const r = new g(s(t));
  return r.isLight() || r.getAlpha() < 0.25;
}, s = (t) => {
  const { red: r, green: n, blue: e, alpha: o } = t;
  return { r, g: n, b: e, a: o };
}, u = (t) => {
  const { r, g: n, b: e, a: o } = t;
  return { red: r, green: n, blue: e, alpha: o };
};
export {
  i as getColorDisplayValue,
  p as isColorLight,
  u as toLongRgb,
  s as toShortRgb
};
//# sourceMappingURL=colors.es.js.map
