"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.opacity = void 0;
const opacity = function () {
  let hexColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '#ffffff';
  let opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
  if (!/^#[0-9A-F]{6}$/i.test(hexColor) || opacity < 0 || opacity > 1) return undefined;
  const r = parseInt(hexColor.slice(1, 3), 16);
  const g = parseInt(hexColor.slice(3, 5), 16);
  const b = parseInt(hexColor.slice(5, 7), 16);
  return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(opacity, ")");
};
exports.opacity = opacity;
//# sourceMappingURL=opacity.js.map