Why to convert to HEX ?
when most of times you use RGB values it Slows down the loading speed of the blog and some times doesn’t not show correct Colors.
Question: How do I convert RGB values of a color to a hexadecimal string?
The algorithm is as follows:
make sure that RGB values are in the range 0…255,
convert RGB values to hex strings,
and then merge the three strings.
Try it yourself: