CSS color names vs hex codes

Benchmark created by AlienWebguy on


Preparation HTML

<div id="1"></div>
<div id="2"></div>
<div id="3"></div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
color names
$('#1').css('background-color','red');
$('#2').css('background-color','green');
$('#3').css('background-color','blue');
ready
hex codes
$('#1').css('background-color','#F00');
$('#2').css('background-color','#0F0');
$('#3').css('background-color','#00F');
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.