Class: Gsk::RadialGradientNode

Inherits:
RenderNode show all
Defined in:
(unknown)

Overview

A render node for a radial 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, center, hradius, vradius, start, end, color_stops, n_color_stops) ⇒ Gsk::RadialGradientNode

Creates a GskRenderNode that draws a radial gradient.

The radial gradient starts around center. The size of the gradient is dictated by hradius in horizontal orientation and by vradius in vertical orientation.

Parameters:

  • bounds (Graphene::Rect)

    the bounds of the node

  • center (Graphene::Point)

    the center of the gradient

  • hradius (Gsk::gfloat)

    the horizontal radius

  • vradius (Gsk::gfloat)

    the vertical radius

  • start (Gsk::gfloat)

    a percentage >= 0 that defines the start of the gradient around center

  • end (Gsk::gfloat)

    a percentage >= 0 that defines the end of the gradient around center

  • 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

#centerGraphene::Point

Retrieves the center pointer for the gradient.

Returns:

  • (Graphene::Point)

    the center point for the gradient

#endGsk::gfloat

Retrieves the end value for the gradient.

Returns:

  • (Gsk::gfloat)

    the end value for the gradient

#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

#hradiusGsk::gfloat

Retrieves the horizontal radius for the gradient.

Returns:

  • (Gsk::gfloat)

    the horizontal radius for the gradient

#n_color_stopsInteger

Retrieves the number of color stops in the gradient.

Returns:

  • (Integer)

    the number of color stops

#startGsk::gfloat

Retrieves the start value for the gradient.

Returns:

  • (Gsk::gfloat)

    the start value for the gradient

#vradiusGsk::gfloat

Retrieves the vertical radius for the gradient.

Returns:

  • (Gsk::gfloat)

    the vertical radius for the gradient