Created
October 11, 2023 07:38
-
-
Save asc0910/7e5825ca58a0b6c7576c4e0cb34f4e37 to your computer and use it in GitHub Desktop.
My jsGist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*bug-in-github-api-content-can-not-be-empty*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<canvas id="myCanvas" width="500" height="500" style="border:1px solid grey"></canvas> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var img = document.createElement('img'); | |
img.src = 'https://i.ibb.co/8rZkxw8/vignette.png'; | |
img.onload = () => { | |
const c = document.getElementById("myCanvas"); | |
const ctx = c.getContext("2d"); | |
ctx.fillStyle = "#BC95F8"; | |
ctx.fillRect(0, 0, 500, 500); | |
ctx.globalCompositeOperation = "overlay"; | |
ctx.drawImage(img, 0, 0, 500, 500); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"name":"My jsGist","settings":{},"filenames":["index.html","index.css","index.js"]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment