This commit is contained in:
Bachir Soussi Chiadmi 2023-06-12 15:40:07 +02:00
parent f47b2fd7e3
commit 2ee902e578

View File

@ -103,7 +103,7 @@ export default {
}, },
getRandBGColor (hue) { getRandBGColor (hue) {
let h = !hue ? Math.floor(Math.random()*360) : hue + -30 + Math.floor(Math.random()*60); let h = !hue ? Math.floor(Math.random()*360) : hue + -30 + Math.floor(Math.random()*60);
let s = 40 + Math.floor(Math.random()*20); let s = 25 + Math.floor(Math.random()*5);
let l = 40 + Math.floor(Math.random()*10); let l = 40 + Math.floor(Math.random()*10);
let a = `${parseFloat(0.2 + Math.random()*.4).toFixed(3)}`.slice(1); let a = `${parseFloat(0.2 + Math.random()*.4).toFixed(3)}`.slice(1);
let hsla = `hsla(${h}, ${s}%, ${l}%, ${a})`; let hsla = `hsla(${h}, ${s}%, ${l}%, ${a})`;
@ -119,10 +119,11 @@ export default {
let step = 1; let step = 1;
for (let i = 0; i < parseInt(canvasBackgroundTrame.width); i+=step) { for (let i = 0; i < parseInt(canvasBackgroundTrame.width); i+=step) {
for (let j = 0; j < parseInt(canvasBackgroundTrame.height); j+=step) { for (let j = 0; j < parseInt(canvasBackgroundTrame.height); j+=step) {
if (Math.random() > 0.95) { if (Math.random() > 0.6) {
ctx.beginPath(); ctx.beginPath();
ctx.arc(i, j, 0.5, 0, 2 * Math.PI, false); // ctx.arc(i, j, 0.5, 0, 2 * Math.PI, false);
ctx.fillStyle = "rgba(200,200,200,0.7)"; ctx.rect(i, j, 1, 1);
ctx.fillStyle = "rgba(0,0,0,0.1)";
ctx.fill(); ctx.fill();
} }
} }