Last active
September 25, 2017 05:24
-
-
Save bevchou/068390d28cc93fdf385afc9a738f34e9 to your computer and use it in GitHub Desktop.
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
//only change the color when not dragging and when it passes the stop angle | |
if (mouseAngle >= stopAngle || !dragging) { | |
changeCol = false; | |
} else { | |
changeCol = true; | |
} | |
//when slider position hits stop angle | |
if (angle > stopAngle) { | |
//change the color | |
if (changeCol) { | |
h += 20; | |
changeCol = false; | |
} | |
//reset the angle | |
angle = 0; | |
//reset the color to beginning | |
if (h >= 360) { | |
h = 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment