import "../../utils/type.js";
import b from "../../utils/unpack.js";
import i from "../../utils/last.js";
const { round: o } = Math, h = (...g) => {
  let [a, n, u, e] = b(g, "rgba"), s = i(g) || "auto";
  e === void 0 && (e = 1), s === "auto" && (s = e < 1 ? "rgba" : "rgb"), a = o(a), n = o(n), u = o(u);
  let t = "000000" + (a << 16 | n << 8 | u).toString(16);
  t = t.substr(t.length - 6);
  let r = "0" + o(e * 255).toString(16);
  switch (r = r.substr(r.length - 2), s.toLowerCase()) {
    case "rgba":
      return `#${t}${r}`;
    case "argb":
      return `#${r}${t}`;
    default:
      return `#${t}`;
  }
};
export {
  h as default
};
//# sourceMappingURL=rgb2hex.js.map
