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:
parent
a8dc6501de
commit
839beb52f3
Notes:
sideshowbarker
2024-07-19 08:01:27 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/839beb52f37
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue