import { rgba as a } from "./rgba.es.js";
import { isColorString as b } from "./utils.es.js";
function o(r) {
  let t = "", e = "", n = "", s = "";
  return r.length > 5 ? (t = r.substr(1, 2), e = r.substr(3, 2), n = r.substr(5, 2), s = r.substr(7, 2)) : (t = r.substr(1, 1), e = r.substr(2, 1), n = r.substr(3, 1), s = r.substr(4, 1), t += t, e += e, n += n, s += s), {
    red: parseInt(t, 16),
    green: parseInt(e, 16),
    blue: parseInt(n, 16),
    alpha: s ? parseInt(s, 16) / 255 : 1
  };
}
const l = {
  test: b("#"),
  parse: o,
  transform: a.transform
};
export {
  l as hex
};
//# sourceMappingURL=hex.es.js.map
