Skip to content

Instantly share code, notes, and snippets.

@ialhashim
Created July 27, 2014 21:12
Show Gist options
  • Save ialhashim/b39a68cf48a0d2e66621 to your computer and use it in GitHub Desktop.
Save ialhashim/b39a68cf48a0d2e66621 to your computer and use it in GitHub Desktop.
Random colors Qt
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;
}
@pamputt
Copy link

pamputt commented Sep 15, 2022

What is the license of this piece of code?

@ialhashim
Copy link
Author

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