04-12-2006 10:03 AM
04-13-2006 08:50 AM
Hello,
I never been faced to a soo large plot graph. I think however you can use the MakeColor function, changing the RGB value you pass.
This can be an example:
#define NUMCOLOR 30
int shift = 0, i,color[NUMCOLOR],inc = 0, clr[3];
for(i=0;i<NUMCOLOR;i++){
inc += 0xFF/NUMCOLOR;
clr[shift%3] = inc; // one color increased
clr[(shift+1)%3] = 0xff-i*NUMCOLOR/0xff;
clr[(shift+2)%3] = 0; // one color set to 0
shift++; // shift RGB for next loop
color[i] = MakeColor (clr[0], clr[1], clr[2]); // create a color
}
I don't know if using a random function you obtain better distinguishing colors, or if you need to modify some colors because they are too similar to your background color.
Hope this help
04-17-2006 08:57 PM
Hi.
Depending on the type of data you are working with, you might be able to work with a reasonably small number of colors, if you use them in combination with multiple Line Styles, Point Styles or even Plot Styles.
Regards,
Colin.
04-18-2006 08:30 AM
10-18-2006 09:43 PM
double
RGB_distance_w3c(RGB a, RGB b) {
double db
= (a.r * 299 + a.g * 587 + a.b * 114) / 1000
- (b.r * 299 + b.g * 587 + b.b * 114) / 1000;double dc
= (maxl(a.r, b.r) - minl(a.r, b.r))
+ (maxl(a.g, b.g) - minl(a.g, b.g))
+ (maxl(a.b, b.b) - minl(a.b, b.b));// smaller brightness difference is enough to express color difference
db /= 125;
dc /= 500;return sqrt(db * db + dc * dc) * 10000;
}