Created
July 27, 2014 21:12
-
-
Save ialhashim/b39a68cf48a0d2e66621 to your computer and use it in GitHub Desktop.
Random colors Qt
This file contains hidden or 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
inline QVector<QColor> rndColors(int count){ | |
QVector<QColor> colors; | |
float currentHue = 0.0; | |
for (int i = 0; i < count; i++){ | |
colors.push_back( QColor::fromHslF(currentHue, 1.0, 0.5) ); | |
currentHue += 0.618033988749895f; | |
currentHue = std::fmod(currentHue, 1.0f); | |
} | |
return colors; | |
} |
You are free to use it in any way. Or add MIT license to it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the license of this piece of code?