Skip to content

Instantly share code, notes, and snippets.

@makc
Created November 30, 2022 06:48
Show Gist options
  • Save makc/f7fd8e8fee87bef801149dcf4df9e11e to your computer and use it in GitHub Desktop.
Save makc/f7fd8e8fee87bef801149dcf4df9e11e to your computer and use it in GitHub Desktop.
Colored pixel GIF
function pixelDataURL (r, g, b) {
return 'data:image/gif;base64,' +
btoa(
[71,73,70,56,57,97,1,0,1,0,128,0,0,r,g,b,0,0,0,44,0,0,0,0,1,0,1,0,0,2,2,68,1,0,59]
.map(c => String.fromCharCode(c))
.join('')
)
;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment