Skip to content

Instantly share code, notes, and snippets.

@bevchou
Last active September 25, 2017 06:31
Show Gist options
  • Save bevchou/6cc1f087bbbc2a57f5400b7488dcc711 to your computer and use it in GitHub Desktop.
Save bevchou/6cc1f087bbbc2a57f5400b7488dcc711 to your computer and use it in GitHub Desktop.
//all the boolean values started as false at the beginning of the sketch
//if slider reaches the area after the stop angle
if (angle > stopAngle || angle < 0) {
//reset arc rotation
angle = 0;
//define when to change color
//if hasn't passed the stop angle before
if (!passedStop) {
//flip boolean value
changeCol = !changeCol;
passedStop = !passedStop;
}
} else {
passedStop = false;
}
//change color
if (changeCol) {
h += 20;
//reset after changing color
passedStop = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment