Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
Easy HTML random color generator code (in C++):srand (time(NULL));TCHAR rand_color;wsprintf (rand_color, L"#%02x%02x%02x", rand()%255, rand()%255, rand()%255);//rand_color is now a random html color code in text
Rnd() For Red, Green, Blue values. Then convert to ARGB.
Eric, sorry for the confusion, I think I wrote it too quick:Guillaume's library uses sRGB with D65 white ref. If you want to continue using that conversion, then just copy/paste RGBtoXYZ and XYZtoRGB into your code.you get a correct codethe calculation is more precise with the expanded...
I'm a Canadian-french developer for many years now.
I'm actually programming in C# but I also had some fun in the past with: VB, C++, SQL, Java, etc.
I like to play games like Carcassone, Settlers of Catane, Chess, Poker...
I also like photography.