Last active
July 3, 2017 19:19
-
-
Save softpunch/8bfdba98090c4e58dd43699ce835ec56 to your computer and use it in GitHub Desktop.
Generate Jittered Array of Colors
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
// PSEUDO CODE | |
// via Herman Tulleken | |
// http://devmag.org.za/2012/07/29/how-to-choose-colours-procedurally-algorithms/ | |
maxJitter = 0.5; // any value between 0 and 1 | |
for(int i = 0; i < n; i++) | |
color[i] = gradient.GetColor( | |
(i + 0.5 + (2 * Random.NextFloat() - 1) * maxJitter) * intervalSize); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment