Class: Gsk::ConicGradientNode

Inherits:
RenderNode show all
Defined in:
(unknown)

Overview

A render node for a conic 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, rotation, color_stops, n_color_stops) ⇒ Gsk::ConicGradientNode

Creates a GskRenderNode that draws a conic gradient.

The conic gradient starts around center in the direction of rotation. A rotation of 0 means that the gradient points up. Color stops are then added clockwise.

Parameters:

  • bounds (Graphene::Rect)

    the bounds of the node

  • center (Graphene::Point)

    the center of the gradient

  • rotation (Gsk::gfloat)

    the rotation of the gradient in degrees

  • 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

#angleGsk::gfloat

Retrieves the angle for the gradient in radians, normalized in [0, 2 * PI].

The angle is starting at the top and going clockwise, as expressed in the css specification:

angle = 90 - gsk_conic_gradient_node_get_rotation()

Returns:

  • (Gsk::gfloat)

    the angle for the gradient

#centerGraphene::Point

Retrieves the center pointer for the gradient.

Returns:

  • (Graphene::Point)

    the center point 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

#n_color_stopsInteger

Retrieves the number of color stops in the gradient.

Returns:

  • (Integer)

    the number of color stops

#rotationGsk::gfloat

Retrieves the rotation for the gradient in degrees.

Returns:

  • (Gsk::gfloat)

    the rotation for the gradient