[PD] default colors of iemguis (was: some gui objects with grey background in help patches?)

Roman Haefeli reduzent at gmail.com
Tue Nov 29 08:14:10 CET 2022


> On Tue, 29 Nov 2022, 02:56 Alexandre Torres Porres,
> <porres at gmail.com> wrote:
> > Em seg., 28 de nov. de 2022 às 05:05, Roman Haefeli
> > <reduzent at gmail.com> escreveu:
> > > On Mon, 2022-11-28 at 02:58 -0300, Alexandre Torres Porres wrote:
> > > > For the record, I just realized default colors of iemguis is
> > > > not  "pure white" (...) 
> > > > it is "FCFCFC" (...) This is not a regression, it's the same in
> > > > pd 0.48,
> > > > 
> > > > I don't know why or where that happens in the code
> > > 
> > > I haven't checked the code, but the old encoding allowed for only
> > > 6
> > > bits per channel. Assuming the two least significant bits are set
> > > to 0,
> > > FC is the highest value possible in that scheme
> > > 
> > > 0xFC = 0b1111 1100
> > > 
> > 
> > 
> > It's much simpler than that. Default color is explicitly set and
> > defined as "0xFCFCFC" in g_all_guis.c, more specifically here:
> > 
> > https://github.com/pure-data/pure-data/blob/06ecc41f42059bfe02081e4738ed21f6bcd0eac9/src/g_all_guis.c#L1030
> > 
> > default "front" and "label" colors are also set there as black.
> > 
> > [cnv] has different default colors specified in its code (0xE0E0E0
> > for background and 0x404040 for label);


On Tue, 2022-11-29 at 07:55 +0100, Simon Iten wrote:
> i think what roman is trying to say is that the color was indeed
> displayed as white back in the days (in 6bit) and the two trailing
> zeros are there because the value was shifted two positions to the
> left (<< 2 binary operation) to align with 8bit variables more
> conveniently... (or maybe i misunderstood completely)


I thought the value #FCFCFC comes from the 6bit encoding scheme and
Alex pointed out that this value is hardcoded as the default value. Now
I think, this is the hard-coded default value exactly because of the
old 6bit encoding scheme. If the initial values was 0xFFFFFF, you
wouldn't have been able to get back to that value once you changed
colors in the properties. 

>From what I remember, the iemguis never were exactly white and you
couldn't make them white, at least not with the RGB dialog.

Roman






More information about the Pd-list mailing list