Re: Themable colors
- From: Matthias Clasen <mclasen redhat com>
- To: nshmyrev yandex ru
- Cc: gtk-devel-list gnome org
- Subject: Re: Themable colors
- Date: Thu, 31 Mar 2005 13:26:13 -0500
On Thu, 2005-03-31 at 10:50 +0400, Nickolay V. Shmyrev wrote:
> Well, you've almost convinced me :)
>
> Isn't it better than have API for colors similar to stock icons API:
>
> struct GtkStockColorItem;
>
> gtk_stock_color_items_add
> gtk_stock_color_items_add_static
> gtk_stock_color_item_free
> gtk_stock_color_item_list_ids
> gtk_stock_color_lookup
>
> and add to GtkGC's api.
>
> gtk_gc_get_from_stock
>
> also it is possible and useful to make public gtk_style_shade function as
>
> gtk_color_shade (GtkColor *color, gdouble shade)
>
>
> and define a lot of stock colors:
>
> GTK_STOCK_COLOR_ERROR /* RED */
> GTK_STOCK_COLOR_WARNING /* YELLOW */
> GTK_STOCK_COLOR_NORMAL /* GREEN */
> GTK_STOCK_COLOR_HIGHLIGHT /* BLUE */
>
> and so on for all HIG palette. Note that there are definitely should be about
> 8 items with just numbers, as Soren stated, useful for graphs, charts.
>
> GTK_STOCK_COLOR_ITEM_1
> GTK_STOCK_COLOR_ITEM_2
> GTK_STOCK_COLOR_ITEM_3
> GTK_STOCK_COLOR_ITEM_4
>
>
> application could add it's own stock colors and theme authors could modify it just like stock icons
Some important points that need to be adressed are:
- We want to be able to write a simple "color setting" control. How does
that work ? Is there a Setting containing a palette, ie essentially a
map from color names to rgb triplets ?
- How can themes adapt to the user-selected stock colors ? Do we add new
rc file syntax like fg[NORMAL] = stock-color("foreground") ?
- Do themes need to be able to derive new colors from the stock colors ?
If yes, how ? Do we parse color expressions like
fg[NORMAL] = lerp(0.5, stock-color("foreground"), #ff00ff) ?
- How can themes mark themselves as being "recolorable" ? (We probably
want to disable the color setting control if the theme uses fixed
colors)
Matthias
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]