SymbolicColor

GtkSymbolicColor is a boxed type that represents a symbolic color. It is the result of parsing a [color expression][gtkcssprovider-symbolic-colors]. To obtain the color represented by a GtkSymbolicColor, it has to be resolved with SymbolicColor.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 gdk.RGBA value.

It is not normally necessary to deal directly with gtk.SymbolicColors, since they are mostly used behind the scenes by gtk.StyleContext and gtk.CssProvider

gtk.SymbolicColor is deprecated. Symbolic colors are considered an implementation detail of GTK+.

Constructors

this
this(GtkSymbolicColor* gtkSymbolicColor, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(SymbolicColor color, double factor, bool useAlpha)

Creates a symbolic color defined as a shade of another color. A factor > 1.0 would resolve to a brighter or more transparent color, while < 1.0 would resolve to a darker or more opaque color.

this
this(RGBA color)

Creates a symbolic color pointing to a literal color.

this
this(SymbolicColor color1, SymbolicColor color2, double factor)

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.

this
this(string name)

Creates a symbolic color pointing to an unresolved named color. See Style.contextLookupColor and Style.propertiesLookupColor.

this
this(string themeClass, int id)

Creates a symbolic color based on the current win32 theme.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

getStruct
void* getStruct()

the main Gtk struct as a void*

getSymbolicColorStruct
GtkSymbolicColor* getSymbolicColorStruct(bool transferOwnership)

Get the main Gtk struct

ref_
SymbolicColor ref_()

Increases the reference count of color

resolve
bool resolve(StyleProperties props, RGBA resolvedColor)

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.

toString
string toString()

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.

unref
void unref()

Decreases the reference count of color, freeing its memory if the reference count reaches 0.

Static functions

getType
GType getType()

Variables

gtkSymbolicColor
GtkSymbolicColor* gtkSymbolicColor;

the main Gtk struct