Answer the question
In order to leave comments, you need to log in
How on ctx.fillStyle to make random colors on push?
Hello =) how to make random colors on push on ctx.fillStyle?
for(let i = 0; i < this.eat.length; i++){
ctx.beginPath();
ctx.arc(this.eat[i].x, this.eat[i].y, 10, 0, 2*Math.PI, false);
ctx.fillStyle = '#89E604' ; <----- Поставить рандомный цвет.
ctx.fill();
ctx.lineWidth = 3;
ctx.strokeStyle = '#89E604';
ctx.stroke();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question