'use strict'; module.exports = function drawDebugLine(context, lineNumber, y, width, color = "red") { context.strokeStyle = color; context.beginPath(); if (typeof width === "number") { context.moveTo(0, y); context.lineTo(width, y); } else { context.moveTo(width[0], y); context.lineTo(width[1], y); } context.stroke(); let boxOffsets = ["red", "green", "blue", "orange"]; let boxOffset = boxOffsets.indexOf(color); context.fillStyle = color; context.fillRect(boxOffset * 18, y + 3, 16, 16); context.font = "12px sans-serif"; context.fillStyle = "white"; context.fillText(lineNumber, 5 + boxOffset * 18, y + 15); };