change color of canvas line code example Example: canvas change line color context.strokeStyle = '#ff0000';