1

I'm assuming that a browser, internally, has a method to create it's default color format from user css file input, that it can interpret. If I write the following css rules, I think they will point to the same format.

<style>
.style {
    color: red;
}
.style {
    color: #f00;
}
.style {
    color: #F00;
}
.style {
    color: rgb(255,0,0);
}
</style>

will result in

<style>
.style {
    color: #FF0000;
}
</style>

The question might be a little off, but shouldn't the browser render a webpage faster if the color style is it's default format?

machineaddict
  • 3,216
  • 8
  • 37
  • 61
  • 1
    Just a Reference.. http://stackoverflow.com/questions/6797306/performance-differences-between-color-declarations – planet260 Mar 06 '15 at 13:03
  • Also this website has very cool comparison charts against each browser..http://jsperf.com/css-color-names-vs-hex-codes/18 – planet260 Mar 06 '15 at 13:04
  • @planet260: thanks for the link. it seems it's very hard to test the theory. – machineaddict Mar 06 '15 at 13:18
  • 1
    Did you try editing the test.. You can run test on different browsers to see if there is any difference... I just ran it for my Browser Chrome.. You can see the results here.. http://jsperf.com/css-color-names-vs-hex-codes/20 – planet260 Mar 06 '15 at 13:20
  • Possible duplicate of [Performance differences between color declarations?](https://stackoverflow.com/questions/6797306/performance-differences-between-color-declarations) – ADJenks Jul 23 '19 at 17:33

1 Answers1

2

Here are the results including color names, short hex, hex, rgb, rgba, hsl, and hsla. You can run the test yourself here.

Color Performance Test Results

nu everest
  • 9,589
  • 12
  • 71
  • 90