CSS color names vs hex codes (v16)

Revision 16 of this benchmark created on


Preparation HTML

<div id="1"></div>
<div id="2"></div>
<div id="3"></div><script src="//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
rgb codes
$('#1').css('background-color','rgb(255,0,0)');
$('#2').css('background-color','rgb(0,255,0)');
$('#3').css('background-color','rgb(0,0,255)');
ready
rgba
$('#1').css('background-color','rgba(255,0,0,0.75)');
$('#2').css('background-color','rgba(0,255,0,0.75)');
$('#3').css('background-color','rgba(0,0,255,0.75)');
ready

Revisions

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