canvas changing line colors between each line code example Example: canvas change line color context.strokeStyle = '#ff0000';