Created
May 18, 2018 17:09
-
-
Save pamelafox/aa5ab01b92a9679b798ff5b78020a07f to your computer and use it in GitHub Desktop.
GlowingSun Processing Program
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
void setup() { | |
size(640, 360); | |
} | |
void draw() { | |
background(135, 206, 235); | |
noStroke(); | |
int sunX = 200; | |
int sunY = 100; | |
int sunWidth = 100; | |
// Draw the glow | |
for (int i = 10; i >= 0; i--) { | |
fill(255, 128, 0, 90 - (i*5)); | |
int glowWidth = sunWidth + (i * 5); | |
ellipse(sunX, sunY, glowWidth, glowWidth); | |
} | |
// Draw the sun | |
fill(255, 128, 0); | |
ellipse(sunX, sunY, sunWidth, sunWidth); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment