c++ - Random pastel color for a brush -


i have several qpolygon instances, need filled random colors (prefer pastels). can without creating array of colors or using predefined colors?

pastel colours, according wikipedia have:

high value , low intermediate saturation.

so can use fromhsv method qcolor class, giving random number range 0-359 h, 0-128 (for example) s , 192-255 (for example) v parameter.

if don't want 2 colours 2 similar each other, can quantize ranges: draw random numbers 0-35, 0-12 , 19-25 (also, rough example) , multiply 10.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -