Base: Tweak the canvas demo page to stop using fractional RGB values

This is a hack to workaround missing support for fractional values in
"rgb(r,g,b)" color parsing.
This commit is contained in:
Andreas Kling 2020-03-31 19:10:08 +02:00
parent a8dc6501de
commit 839beb52f3
Notes: sideshowbarker 2024-07-19 08:01:27 +09:00

View file

@ -38,7 +38,7 @@ function update() {
var r = Math.random() * 255;
var g = Math.random() * 255;
var b = Math.random() * 255;
var color = "rgb(" + r + "," + g + "," + b + ")";
var color = "rgb(" + ~~r + "," + ~~g + "," + ~~b + ")";
ctx.fillStyle = color;
const spread = 35;
var x = mouseX + (Math.random() * spread) - (spread / 2);