Re: gnome-panel transparency problems





Hey, I have a proposal! (have thought about this for a LOOONG time):

For areas in applets that contain text (clock applet, window list applet, etc),
check the RGB value of the pixels in the background area;

(example for 8-bit color depth)
if the average RGB value < 128
  draw text in white
else
  draw text in black

This sounds like a potentially big theming violation to me.
Applets need to use the GTK+ style information when drawing both text and graphics, otherwise they violate accessibility requirements. This doesn't mean that you can't have transparent applets, but it does mean that their text needs to use the current GTK+ style foreground.

To really do a reasonable job at this while maintaining theme/accessibility support, stuff like panel pixmaps need to get rolled into the system theme; trying to build a heuristic is contrary to the accessibility requirements.

- Bill

There are two possible approaches:
1) check per-applet
2) check per-character

Approach 1 is of course faster, but does not handle backgrounds with a lot of
shifting nuances very well.
Approach 2 is safe in this manner, but requires a lot more calculation.
Some sampling approach could work as well (eg check every 2nd/4th/Nth pixel).

Of course, there should be an option in the panel properties: ("Font color:
[x]automatic [x]manual <choose..>") If "automatic" mode is chosen, there could
be an secondary option for what method to use - "[x]fail-safe [x]fast"

Note: I think it would look best if the applet bevels etc also used the same
foreground color.

This could turn out *nice* (did some mockups some time ago, think I have them
somewhere)

Regards,
Mikael.


-------------------------------------------------





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]