I just wanted to know if it’s faster to use hex color codes or the color names when I want to use it in CSS?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
My guess is the codes will be faster since the names are probably assigned to a look-up table and reference hex codes anyway.
That being said, my guess is the speed difference will be completely negligible.
Here’s a performance test I just created. They’re neck and neck, though hex codes seems to be just barely faster on 4/5 runs so far:
http://jsperf.com/css-color-names-vs-hex-codes