Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
RGB vs RGBa vs HSL vs Hex using Canvas
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Browser:
Chrome 138
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
10 months ago
Test name
Executions per second
RGBa
302322.0 Ops/sec
RGB
403000.0 Ops/sec
Hex
195724.1 Ops/sec
HSL
192698.6 Ops/sec
HTML Preparation code:
<canvas id="canvasOne" width="400" height="400"></canvas> <canvas id="canvasTwo" width="400" height="400"></canvas> <canvas id="canvasThree" width="400" height="400"></canvas> <canvas id="canvasFour" width="400" height="400"></canvas>
Script Preparation code:
var canvasOne = document.getElementById("canvasOne"); var ctxOne = canvasOne.getContext("2d"); var canvasTwo = document.getElementById("canvasTwo"); var ctxTwo = canvasTwo.getContext("2d"); var canvasThree = document.getElementById("canvasThree"); var ctxThree = canvasThree.getContext("2d"); var canvasFour = document.getElementById("canvasFour"); var ctxFour = canvasFour.getContext("2d");
Tests:
RGBa
ctxTwo.fillStyle = 'rgba(255, 255, 255, 0.3)'; ctxTwo.fillRect(0, 0, 400, 400); ctxOne.beginPath(); ctxOne.fillStyle = 'rgba(231, 76, 60, 0.1)'; ctxOne.arc(200, 200, 100, 0, Math.PI * 2, true); ctxOne.fill();
RGB
ctxTwo.fillStyle = 'rgba(255, 255, 255, 0.3)'; ctxTwo.fillRect(0, 0, 400, 400); ctxTwo.beginPath(); ctxTwo.fillStyle = 'rgb(249, 206, 201)'; ctxTwo.arc(200, 200, 100, 0, Math.PI * 2, true); ctxTwo.fill();
Hex
ctxThree.fillStyle = 'rgba(255, 255, 255, 0.3)'; ctxThree.fillRect(0, 0, 400, 400); ctxThree.beginPath(); ctxThree.fillStyle = '#f9cec9'; ctxThree.arc(200, 200, 100, 0, Math.PI * 2, true); ctxThree.fill();
HSL
ctxThree.fillStyle = 'rgba(255, 255, 255, 0.3)'; ctxThree.fillRect(0, 0, 400, 400); ctxThree.beginPath(); ctxThree.fillStyle = 'hsl(15, 90%, 64%)'; ctxThree.arc(200, 200, 100, 0, Math.PI * 2, true); ctxThree.fill();