Greg Ercolano schrieb:
> int r1 = 255, g1 = 0, b1 = 0;               // start with r/g/b colors..
>      Fl_Color c = fl_rgb_color(r1,g1,b1);        // ..turn them into an 
> Fl_Color..
>      int r2 = (c>>  24)&  255;                   // then back again into 
> r/g/b colors
>      int g2 = (c>>  16)&  255;
>      int b2 = (c>>   8)&  255;
>      Fl::background(r2,g2,b2);

That works, but next step is to replace fl_rgb_color() by 
fl_show_colormap() and this way the problem comes back.

When checking the values I found, that fl_show_colormap() provides an 
index to colormap-table, i.e. when clicking to red (second field) there 
results the index "1". Using this i.e. for color(Fl_Color) out of 
fl_draw, it works well.
So I think, my question basically was right, but could have been more 
detailed: How to convert Fl_Color-index-value to RGB?
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to