ConicGradientNode

class ConicGradientNode(*args, **kwargs)

Superclasses: RenderNode

A render node for a conic gradient.

Constructors

class ConicGradientNode
classmethod new(bounds: Rect, center: Point, rotation: float, color_stops: Sequence[ColorStop]) 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 – the bounds of the node

  • center – the center of the gradient

  • rotation – the rotation of the gradient in degrees

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

Methods

class ConicGradientNode
get_angle() float

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 - get_rotation()

Added in version 4.2.

get_center() Point

Retrieves the center pointer for the gradient.

get_color_stops() list[ColorStop]

Retrieves the color stops in the gradient.

get_n_color_stops() int

Retrieves the number of color stops in the gradient.

get_rotation() float

Retrieves the rotation for the gradient in degrees.