How do I convert RGBA to HEX?
Turn red, green and blue into two hex digits each, then multiply the alpha by 255 and add it as two more digits. rgba(37, 99, 235, 0.5) has channels 25, 63 and eb, and 0.5 × 255 = 128 = 80 in hex, so the code is #2563eb80.