Skip to content

Instantly share code, notes, and snippets.

@softpunch
Last active July 3, 2017 19:19
Show Gist options
  • Save softpunch/80a40b8d536480db94a5218affb358c5 to your computer and use it in GitHub Desktop.
Save softpunch/80a40b8d536480db94a5218affb358c5 to your computer and use it in GitHub Desktop.
Generate Random Colors Using Golden Ratio
// PSEUDO CODE
// via Herman Tulleken
// http://devmag.org.za/2012/07/29/how-to-choose-colours-procedurally-algorithms/
offset = Random.NextFloat();
for (int i = 0; i < n; i++)
color[i] = gradient.GetColor(offset + (0.618033988749895f * i) % 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment