Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. for (let y = 0; y < height; y += fontHeight) {
  2. for (let x = 0; x < width; x += fontWidth) {
  3. const frameSection = hiddenContext.getImageData(x, y, fontWidth, fontHeight);
  4. const { r, g, b } = getAverageRGB(frameSection);
  5.  
  6. outputContext.fillStyle = `rgb(${r},${g},${b})`;
  7. outputContext.fillText('@', x, y);
  8. }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement