In CSS we can use several different methods to define a color:
- Color word:
red
- Hexadecimal:
#FF0000
- Red/Green/Blue channels:
rgb(255, 0, 0)
- Hue/saturation/lightness:
hsl(0, 100%, 50%)
I do realize that using named colors is not a good idea, as different browsers have their own idea of what aquamarine
looks like.
Ignoring alpha channel and browser support, are there any differences performance-wise between these 4 methods?
If we were trying to squeeze every last bit of optimization out of our CSS, which one would be preferred, if any? Are the color values converted to a specific format internally, or does the performance of it depend on anything else (like which rendering agent or browser is used)?
Looking for a "technical" answer if possible, references appreciated.
See Question&Answers more detail:os