In CSS, there are three options for using colors: There’s the RGB option, the RGBA option, and the hexadecimal option. RGB stands for Red, Blue, and Green, and the “A” in RGBA stands for “alpha”, or transparency. RGB values can be between 0 and 255, totaling 256 possible values for each color, and 16.8 million different combinations.

Hexadecimal on the other hand is a 6-character string that goes from 0 to ff (255 in hexadecimal numbers) The first two values of a hexadecimal code is the Red value, the second 2 values are the Green value, and the last two values are the Blue value.

For CSS, the hexadecimal version of getting color is used over the RGB version, UNLESS transparency is needed, in which case RGBA is used instead.

By Levi

Leave a Reply

Your email address will not be published. Required fields are marked *