machineaddict
machineaddict

Reputation: 3236

Which CSS color format is rendering faster?

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?

Upvotes: 1

Views: 266

Answers (1)

nu everest
nu everest

Reputation: 10259

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

Upvotes: 3

Related Questions