Created
March 28, 2019 18:20
-
-
Save deliseev/853844e53ffc74880d0ab7e0800221e0 to your computer and use it in GitHub Desktop.
Draw simple pattern on <canvas>
This file contains 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
ctx.fillStyle = | |
"#" + | |
( | |
((Math.cos(r) * 127 + 128) << 16) | | |
((Math.cos(r + pi2 / 3) * 127 + 128) << 8) | | |
(Math.cos(r + (pi2 / 3) * 2) * 127 + 128) | |
).toString(16); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment