canvas line color
snippet in javascript

canvas line color

user1979

var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.strokeStyle = "#FF0000";
ctx.strokeRect(20, 20, 150, 100);

canvas line color

user3405

var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.strokeStyle = "#FF0000";
ctx.strokeRect(20, 20, 150, 100);

javascript cahnge colour of strokerect

user1256

const context = canvas.getContext('2d');

context.strokeStyle = 'blue';
context.strokeRect(100, 100, 50, 50);