import hexRgb from "hex-rgb";

export const hexToRgba = (hexColor: string, opacity?: number): string => {
  const { red, green, blue, alpha } = hexRgb(hexColor);

  return `rgba(${red}, ${green}, ${blue}, ${opacity || alpha})`;
};
