Module: Gtk::SymbolicPaintable

Defined in:
(unknown)

Overview

An interface that supports symbolic colors in paintables.

GdkPaintables implementing the interface will have the
[vfuncGtk.SymbolicPaintable.snapshot_symbolic] function called and
have the colors for drawing symbolic icons passed. At least 5 colors
are guaranteed to be passed every time. These 5 colors are the
foreground color, and the colors to use for errors, warnings
and success information in that order, followed by the system
accent color.

The system accent color has been added in GTK 4.22.
More colors may be added in the future.

Instance Method Summary collapse

Instance Method Details

#snapshot_symbolic(snapshot, width, height, colors, n_colors) ⇒ nil

Snapshots the paintable with the given colors.

If less than 5 colors are provided, GTK will pad the array with default
colors.

Parameters:

  • snapshot (Gdk::Snapshot) —

    a GdkSnapshot to snapshot to

  • width (Float) —

    width to snapshot in

  • height (Float) —

    height to snapshot in

  • colors (Array<Gdk::RGBA>) —

    a pointer to an array of colors

  • n_colors (Integer) —

    The number of colors

Returns:

  • (nil)

#snapshot_with_weight(snapshot, width, height, colors, n_colors, weight) ⇒ nil

Snapshots the paintable with the given colors and weight.

If less than 5 colors are provided, GTK will pad the array with default
colors.

Parameters:

  • snapshot (Gdk::Snapshot) —

    a GdkSnapshot to snapshot to

  • width (Float) —

    width to snapshot in

  • height (Float) —

    height to snapshot in

  • colors (Array<Gdk::RGBA>) —

    a pointer to an array of colors

  • n_colors (Integer) —

    The number of colors

  • weight (Float) —

    The font weight to use (from 1 to 1000, with default 400)

Returns:

  • (nil)