Gjsify LogoGjsify Logo

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 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+.

record

Hierarchy

  • SymbolicColor

Index

Constructors

Properties

name: string

Methods

  • 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.

    Parameters

    • props: StyleProperties

      #GtkStyleProperties to use when resolving named colors, or %NULL

    Returns [boolean, Gdk.RGBA]

  • toString(): string
  • 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.

    Returns string

  • unref(): void
  • Decreases the reference count of color, freeing its memory if the reference count reaches 0.

    Returns void

  • 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.

    Parameters

    • color: Gtk.SymbolicColor

      another #GtkSymbolicColor

    • factor: number

      factor to apply to color alpha

    Returns Gtk.SymbolicColor

  • Creates a symbolic color pointing to an unresolved named color. See gtk_style_context_lookup_color() and gtk_style_properties_lookup_color().

    Parameters

    • name: string

      color name

    Returns Gtk.SymbolicColor

  • 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.

    Parameters

    • color: Gtk.SymbolicColor

      another #GtkSymbolicColor

    • factor: number

      shading factor to apply to color

    Returns Gtk.SymbolicColor

  • 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.

    Parameters

    • themeClass: string

      The theme class to pull color from

    • id: number

      The color id

    Returns Gtk.SymbolicColor

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method