Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (let y = 0; y < height; y += fontHeight) {
- for (let x = 0; x < width; x += fontWidth) {
- const frameSection = hiddenContext.getImageData(x, y, fontWidth, fontHeight);
- const { r, g, b } = getAverageRGB(frameSection);
- outputContext.fillStyle = `rgb(${r},${g},${b})`;
- outputContext.fillText('@', x, y);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement