Hi
I wrote a small loop in c++ for generating colors from QColor::colorNames(). But it generates it reaaaaly randomly, so together they look really really bad.
Is there any idea how to generate distinguishable colours(blue, red, green, yellow, orange, white etc.) first? I know it depence from i-value in loop, but no idea how to set it
Here is my code:
QVector<QColor> colorCat(numCat); // number of categories I have to color
for(int i =0; i < numCatt; i++)
colorCat[i] = colorName[i]; //I also tried something like colorName[2*i], or [i*i] to generate something normal, but it failed
QStringList colorName = QColor::colorNames();
QVector<QColor> colorCat(numCat); // number of categories I have to color
for(int i =0; i < numCatt; i++)
colorCat[i] = colorName[i]; //I also tried something like colorName[2*i], or [i*i] to generate something normal, but it failed
To copy to clipboard, switch view to plain text mode
Bookmarks