Skip to content

Instantly share code, notes, and snippets.

@softpunch
Last active July 3, 2017 19:19
Show Gist options
  • Save softpunch/8bfdba98090c4e58dd43699ce835ec56 to your computer and use it in GitHub Desktop.
Save softpunch/8bfdba98090c4e58dd43699ce835ec56 to your computer and use it in GitHub Desktop.
Generate Jittered Array of Colors
// 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