Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any performance differences between color names or hexa values in css?

Color properties in CSS can accept color names ( white, pink, etc) or hexadecimal values ( #FFF , #669966 , etc) or RGB.

But not all the color names are standard for all browsers. There are tests like CSS color names vs hex codes, (my results is better hexadecimal) , so is it always better to use hexadecimal than other two options?

Edit: Other duplicate questions is about personal preferences, this is about performance.

like image 699
richie-torres Avatar asked Dec 31 '25 09:12

richie-torres


1 Answers

Putting away the color names, the hex values and RGB are pretty much the same.

But the result shows that Hex codes are slightly faster (not that much to worry about).

For example, Firefox 11 does 15,400 operations of hex code but 14,900 of rgb in a second.

So, that is not much to worry about. You won't even notice that.

like image 113
Miro Markaravanes Avatar answered Jan 02 '26 01:01

Miro Markaravanes