Class: Gsk::LinearGradientNode

Inherits:
RenderNode show all
Defined in:
(unknown)

Overview

A render node for a linear gradient.

Instance Method Summary collapse

Methods inherited from RenderNode

deserialize, #draw, #get_bounds, #node_type, #ref, #serialize, #unref, #write_to_file

Constructor Details

#initialize(bounds, start, end, color_stops, n_color_stops) ⇒ Gsk::LinearGradientNode

Creates a GskRenderNode that will create a linear gradient from the given points and color stops, and render that into the area given by bounds.

Parameters:

  • bounds (Graphene::Rect)

    the rectangle to render the linear gradient into

  • start (Graphene::Point)

    the point at which the linear gradient will begin

  • end (Graphene::Point)

    the point at which the linear gradient will finish

  • color_stops (Array<Gsk::ColorStop>)

    a pointer to an array of GskColorStop defining the gradient. The offsets of all color stops must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1.

  • n_color_stops (Integer)

    the number of elements in color_stops

Instance Method Details

#endGraphene::Point

Retrieves the final point of the linear gradient.

Returns:

  • (Graphene::Point)

    the final point

#get_color_stops(n_stops) ⇒ Array<Gsk::ColorStop>

Retrieves the color stops in the gradient.

Parameters:

  • n_stops (Integer)

    the number of color stops in the returned array

Returns:

  • (Array<Gsk::ColorStop>)

    the color stops in the gradient

#n_color_stopsInteger

Retrieves the number of color stops in the gradient.

Returns:

  • (Integer)

    the number of color stops

#startGraphene::Point

Retrieves the initial point of the linear gradient.

Returns:

  • (Graphene::Point)

    the initial point