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 with alpha = false and all solid colors
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
RGBa
1144528.6 Ops/sec
RGB
1136368.5 Ops/sec
Hex
1136170.2 Ops/sec
HSL
1138136.2 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", { alpha: false }); var canvasTwo = document.getElementById("canvasTwo"); var ctxTwo = canvasTwo.getContext("2d", { alpha: false }); var canvasThree = document.getElementById("canvasThree"); var ctxThree = canvasThree.getContext("2d", { alpha: false }); var canvasFour = document.getElementById("canvasFour"); var ctxFour = canvasFour.getContext("2d", { alpha: false });
Tests:
RGBa
ctxOne.clearRect(0, 0, 400, 400); ctxOne.beginPath(); ctxOne.fillStyle = 'rgba(231, 76, 60, 1)'; ctxOne.arc(200, 200, 100, 0, Math.PI * 2, true); ctxOne.fill();
RGB
ctxTwo.clearRect(0, 0, 400, 400); ctxTwo.beginPath(); ctxTwo.fillStyle = 'rgb(231, 76, 60)'; ctxTwo.arc(200, 200, 100, 0, Math.PI * 2, true); ctxTwo.fill();
Hex
ctxThree.clearRect(0, 0, 400, 400); ctxThree.beginPath(); ctxThree.fillStyle = '#e74c3c'; ctxThree.arc(200, 200, 100, 0, Math.PI * 2, true); ctxThree.fill();
HSL
ctxFour.clearRect(0, 0, 400, 400); ctxFour.beginPath(); ctxFour.fillStyle = 'hsl(5, 74%, 90%)'; ctxFour.arc(200, 200, 100, 0, Math.PI * 2, true); ctxFour.fill();