MacArthur, Ian (SELEX GALILEO, UK) schrieb: > > The fltk color type is 32-bits, encoded as RGBI, with a byte each for R, > G, B and I (I being the index into the colour map.) > > Now, so far as I can make out, most of the fltk code seems to encode > colours such that they are rrggbb00 for RGB colours, or 000000ii for > index colours. > > The fltk code seems to test for this by masking the colour value with > 0xffffff00 and if that is non-zero, it treats it as RGB. > > If that is zero, it masks with 0x000000FF and then looks up the related > RGB values by doing a lookup into fl_cmap[] array. > (e.g. see fl_color_win32.cxx etc near line 111 of fltk-1.3)
Yes, that's it. > The problem with this seems to be that the fl_cmap[] array is static, > and I don't see how we get access to those values easily... I also took a look to the code and agree - to me it seems, that the lookup is directly assigned to the operating system and not easy to retrieve, because it's always hidden by fl_color function. Okay, not necessary to patch anything, because Fl_Color_Chooser() does the job and is more sophisticated than fl_show_colormap(). Maybe next better solution would be, to make Fl::background() accept Fl_Color, because this way would cover RGB and I and would be a more consistent handling of colors. Maybe a thing, to consider for FLTK 1.3? _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

