Skip to content

Instantly share code, notes, and snippets.

@mariotacke
Created July 11, 2019 19:12
Show Gist options
  • Select an option

  • Save mariotacke/beb163e3888eaef558ca07a807633fee to your computer and use it in GitHub Desktop.

Select an option

Save mariotacke/beb163e3888eaef558ca07a807633fee to your computer and use it in GitHub Desktop.

Revisions

  1. mariotacke created this gist Jul 11, 2019.
    5 changes: 5 additions & 0 deletions medium.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    const charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%&()/\\+<>';
    const randomCharacter = charset[Math.floor(Math.random() * charset.length)];

    outputContext.fillStyle = `rgb(${r},${g},${b})`;
    outputContext.fillText(randomCharacter, x, y);