LinearGradientNode#

class LinearGradientNode(*args, **kwargs)#

Superclasses: RenderNode

A render node for a linear gradient.

Constructors#

class LinearGradientNode
classmethod new(bounds: Rect, start: Point, end: Point, color_stops: list[ColorStop]) 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 – the rectangle to render the linear gradient into

  • start – the point at which the linear gradient will begin

  • end – the point at which the linear gradient will finish

  • 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 LinearGradientNode
get_color_stops() list[ColorStop]#

Retrieves the color stops in the gradient.

get_end() Point#

Retrieves the final point of the linear gradient.

get_n_color_stops() int#

Retrieves the number of color stops in the gradient.

get_start() Point#

Retrieves the initial point of the linear gradient.