Last active
August 29, 2015 14:05
-
-
Save lmccart/77b004bd0455a246c7d2 to your computer and use it in GitHub Desktop.
code for wp test post 2
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
<div class="example"> | |
<pre> | |
<code class="language-javascript"> | |
var dim; | |
function setup() { | |
createCanvas(600, 400); | |
dim = width/2; | |
background(0); | |
colorMode(HSB, 360, 100, 100); | |
noStroke(); | |
ellipseMode(RADIUS); | |
frameRate(1); | |
} | |
function draw() { | |
background(0); | |
for (var x = 0; x <= width; x+=dim) { | |
drawGradient(x, height/2); | |
} | |
} | |
function drawGradient(x, y) { | |
var radius = dim/2; | |
var h = random(0, 360); | |
for (var r = radius; r > 0; --r) { | |
fill(h, 90, 90); | |
ellipse(x, y, r, r); | |
h = (h + 1) % 360; | |
} | |
} | |
</code> | |
</pre> | |
</div> | |
<script>renderCode()</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment