code: function convertHexColorToRgba(hex) {
    // Expand shorthand form (e.g. "#03F") to full form (e.g. "#0033FF")
    const shorthandRegex = /^#([a-f\d])([a-f\d])([a-f\d])$/i;
    const hexFull = `${hex}`.replace(shorthandRegex, (m, r, g, b) => {
      return r + r + g + g + b + b;
    });
  
    const result = /^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hexFull);
    if (!result) {
      // Return untouched if not a hex code
      return hex;
    }
  
    const r = parseInt(result[1], 16);
    const g = parseInt(result[2], 16);
    const b = parseInt(result[3], 16);
    const a = 1;
  
    return `rgba(${r}, ${g}, ${b}, ${a})`;
  }
docs: Convert a CSS hex color code (#00EE00) to rgba() format
  @param {string} hex hex color code (#00EE00). Short form is also accepted i.e. #03F for #0033FF)