GtkSymbolicColor — Symbolic colors
#include <gtk/gtk.h>
GtkSymbolicColor is a boxed type that represents a symbolic color. It is the result of parsing a color expression. To obtain the color represented by a GtkSymbolicColor, it has to be resolved with gtk_symbolic_color_resolve()
, which replaces all symbolic color references by the colors they refer to (in a given context) and evaluates mix, shade and other expressions, resulting in a GdkRGBA value.
It is not normally necessary to deal directly with GtkSymbolicColors, since they are mostly used behind the scenes by GtkStyleContext and GtkCssProvider.
GtkSymbolicColor is deprecated. Symbolic colors are considered an implementation detail of GTK+.
GtkSymbolicColor *
gtk_symbolic_color_new_literal (const GdkRGBA *color
);
gtk_symbolic_color_new_literal
has been deprecated since version 3.8 and should not be used in newly-written code.
GtkSymbolicColor is deprecated.
Creates a symbolic color pointing to a literal color.
color | a GdkRGBA |
a newly created GtkSymbolicColor
Since: 3.0
GtkSymbolicColor *
gtk_symbolic_color_new_name (const gchar *name
);
gtk_symbolic_color_new_name
has been deprecated since version 3.8 and should not be used in newly-written code.
GtkSymbolicColor is deprecated.
Creates a symbolic color pointing to an unresolved named color. See gtk_style_context_lookup_color()
and gtk_style_properties_lookup_color()
.
name | color name |
a newly created GtkSymbolicColor
Since: 3.0
GtkSymbolicColor * gtk_symbolic_color_new_shade (GtkSymbolicColor *color
,gdouble factor
);
gtk_symbolic_color_new_shade
has been deprecated since version 3.8 and should not be used in newly-written code.
GtkSymbolicColor is deprecated.
Creates a symbolic color defined as a shade of another color. A factor > 1.0 would resolve to a brighter color, while < 1.0 would resolve to a darker color.
[constructor]
color | another GtkSymbolicColor | |
factor | shading factor to apply to |
A newly created GtkSymbolicColor
Since: 3.0
GtkSymbolicColor * gtk_symbolic_color_new_alpha (GtkSymbolicColor *color
,gdouble factor
);
gtk_symbolic_color_new_alpha
has been deprecated since version 3.8 and should not be used in newly-written code.
GtkSymbolicColor is deprecated.
Creates a symbolic color by modifying the relative alpha value of color
. A factor < 1.0 would resolve to a more transparent color, while > 1.0 would resolve to a more opaque color.
[constructor]
color | another GtkSymbolicColor | |
factor | factor to apply to |
A newly created GtkSymbolicColor
Since: 3.0
GtkSymbolicColor * gtk_symbolic_color_new_mix (GtkSymbolicColor *color1
,GtkSymbolicColor *color2
,gdouble factor
);
gtk_symbolic_color_new_mix
has been deprecated since version 3.8 and should not be used in newly-written code.
GtkSymbolicColor is deprecated.
Creates a symbolic color defined as a mix of another two colors. a mix factor of 0 would resolve to color1
, while a factor of 1 would resolve to color2
.
[constructor]
color1 | color to mix | |
color2 | another color to mix | |
factor | mix factor |
A newly created GtkSymbolicColor
Since: 3.0
GtkSymbolicColor * gtk_symbolic_color_new_win32 (const gchar *theme_class
,gint id
);
gtk_symbolic_color_new_win32
has been deprecated since version 3.8 and should not be used in newly-written code.
GtkSymbolicColor is deprecated.
Creates a symbolic color based on the current win32 theme.
Note that while this call is available on all platforms the actual value returned is not reliable on non-win32 platforms.
[constructor]
theme_class | The theme class to pull color from | |
id | The color id |
A newly created GtkSymbolicColor
Since: 3.4
GtkSymbolicColor *
gtk_symbolic_color_ref (GtkSymbolicColor *color
);
gtk_symbolic_color_ref
has been deprecated since version 3.8 and should not be used in newly-written code.
GtkSymbolicColor is deprecated.
Increases the reference count of color
color |
the same color
Since: 3.0
void
gtk_symbolic_color_unref (GtkSymbolicColor *color
);
gtk_symbolic_color_unref
has been deprecated since version 3.8 and should not be used in newly-written code.
GtkSymbolicColor is deprecated.
Decreases the reference count of color
, freeing its memory if the reference count reaches 0.
color |
Since: 3.0
gboolean gtk_symbolic_color_resolve (GtkSymbolicColor *color
,GtkStyleProperties *props
,GdkRGBA *resolved_color
);
gtk_symbolic_color_resolve
has been deprecated since version 3.8 and should not be used in newly-written code.
GtkSymbolicColor is deprecated.
If color
is resolvable, resolved_color
will be filled in with the resolved color, and TRUE
will be returned. Generally, if color
can’t be resolved, it is due to it being defined on top of a named color that doesn’t exist in props
.
When props
is NULL
, resolving of named colors will fail, so if your color
is or references such a color, this function will return FALSE
.
color | ||
props | GtkStyleProperties to use when resolving named colors, or | [allow-none] |
resolved_color | return location for the resolved color. | [out] |
TRUE
if the color has been resolved
Since: 3.0
char *
gtk_symbolic_color_to_string (GtkSymbolicColor *color
);
gtk_symbolic_color_to_string
has been deprecated since version 3.8 and should not be used in newly-written code.
GtkSymbolicColor is deprecated.
Converts the given color
to a string representation. This is useful both for debugging and for serialization of strings. The format of the string may change between different versions of GTK, but it is guaranteed that the GTK css parser is able to read the string and create the same symbolic color from it.
color | color to convert to a string |
a new string representing color
typedef struct _GtkSymbolicColor GtkSymbolicColor;
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk3/3.24/gtk3-GtkSymbolicColor.html