import { Color3 as f, Color4 as o } from "@babylonjs/core";
import { hex2rgb as i } from "@swiftcarrot/color-fns";
const p = (t, n) => {
  if (t && t.startsWith("#")) {
    const { r, g: s, b: e } = i(t);
    return new f(r / 255, s / 255, e / 255);
  }
  return n;
}, x = (t, n) => {
  if (t && t.startsWith("#")) {
    let r = 1;
    t.length === 9 && (r = parseInt(t.slice(7, 9), 16) / 255);
    const { r: s, g: e, b: h } = i(t);
    return new o(s / 255, e / 255, h / 255, r);
  }
  return n;
};
export {
  p as hex2Color3,
  x as hex2Color4
};
