mirror of
https://github.com/scrtwpns/mixbox.git
synced 2026-03-19 14:39:27 +01:00
21 lines
621 B
HTML
21 lines
621 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
</head>
|
|
<body>
|
|
<canvas id="canvas" width="720" height="128"></canvas>
|
|
<script src="https://scrtwpns.com/mixbox.js"></script>
|
|
<script>
|
|
var canvas = document.getElementById('canvas');
|
|
var context = canvas.getContext("2d");
|
|
var color1 = "rgb(0, 33, 133)"; // blue
|
|
var color2 = "rgb(252, 211, 0)"; // yellow
|
|
var n = canvas.width;
|
|
for (var i = 0; i < n; i++) {
|
|
context.fillStyle = mixbox.lerp(color1, color2, i / (n - 1));
|
|
context.fillRect(i, 0, 1, canvas.height);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|