Re: Themable colors



Soeren Sandmann wrote:

Bill Haneman <Bill Haneman Sun COM> writes:

The ONLY time that an application should choose a specific color (or
even a specific value, i.e. 'black' or 'white') is when "red means
RED", i.e. if the application is a painting application, an image
processing application, or something similar, where the actual hue and
value are semantically identified with the element.

Otherwise you should use a gc whose semantics are 'stand out' or
'error'.  That's what this thread is really about.
So according to you the section of the HIG that deals with color
should be deleted?
Possibly it needs heavy revision. Calum? It should be clear that explicit colors must be avoided except in applications that deal with actual colorspaces, such as image processing.
What if you need to show a graphical representation of numbers, say a
bar or pie chart? Should you use gc's with the semantics "pie chart
color 1" and "pie chart color 2"?
In this case the actual colors don't matter. And yes, the colors should be chosen from a theme-dependent palette.
Ideally we would have a widget-rendering palette:

fg_gc, bg_gc, base_gc, text_gc, highlight_gc, border_gc, edge_bevel_gc, link_text_gc, etc. etc.
and a palette of colors for rendering "non-widget" graphical elements 
such as charts etc.:
chart_bg_gc, chart_fg_gc, fgoddcolor_gc, fgevencolor_gc, gcolor1_gc, 
gcolor2_gc, gcolor3_gc, ...  gcolor16_gc
with some rules such as "fgoddcolor_gc should be visible against 
odd-numbered gcolor_gc's" and
"consecutively numbered color gcs should be used to draw adjacent 
objects in a chart", "gcolor16_gc should be distinguishable adjacent to 
gcolor1_gc", etc.  16 colors (fg and bg) should suffice for almost all 
applications since any additional shades can be derived from the basic 
fg and bg colors.
Perhaps it would make more sense to make the "object palette" a set of 
2d arrays for fg and bg:
GdkGC *fg_color[<color_number>][<STATE>];
GdkGC *bg_color[][];

etc.

- Bill

Soeren



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