(ctx, src, x, y, w, h, color)
| 3464 | } |
| 3465 | |
| 3466 | function drawOledIconAlphaMask(ctx, src, x, y, w, h, color) { |
| 3467 | const img = getCachedOledImage(src); |
| 3468 | if (!img || !img.complete || !img.naturalWidth) return; |
| 3469 | ctx.save(); |
| 3470 | ctx.imageSmoothingEnabled = false; |
| 3471 | // Paint a solid rectangle then mask it by the icon alpha so it is always visible in OLED. |
| 3472 | ctx.fillStyle = color; |
| 3473 | ctx.fillRect(x, y, w, h); |
| 3474 | ctx.globalCompositeOperation = "destination-in"; |
| 3475 | ctx.drawImage(img, x, y, w, h); |
| 3476 | ctx.restore(); |
| 3477 | } |
| 3478 | |
| 3479 | function drawOledLine(ctx, x0, y0, x1, y1, color) { |
| 3480 | ctx.fillStyle = color; |
nothing calls this directly
no test coverage detected