Skip to content

Instantly share code, notes, and snippets.

@pamelafox
Created May 18, 2018 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pamelafox/aa5ab01b92a9679b798ff5b78020a07f to your computer and use it in GitHub Desktop.
Save pamelafox/aa5ab01b92a9679b798ff5b78020a07f to your computer and use it in GitHub Desktop.
GlowingSun Processing Program
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