ColorMatrixNode

class ColorMatrixNode(*args, **kwargs)

Superclasses: RenderNode

A render node controlling the color matrix of its single child node.

Constructors

class ColorMatrixNode
classmethod new(child: RenderNode, color_matrix: Matrix, color_offset: Vec4) ColorMatrixNode

Creates a GskRenderNode that will drawn the child with color_matrix.

In particular, the node will transform colors by applying

pixel = transpose(color_matrix) * pixel + color_offset

for every pixel. The transformation operates on unpremultiplied colors, with color components ordered R, G, B, A.

Parameters:
  • child – The node to draw

  • color_matrix – The matrix to apply

  • color_offset – Values to add to the color

Methods

class ColorMatrixNode
get_child() RenderNode

Gets the child node that is getting its colors modified by the given node.

get_color_matrix() Matrix

Retrieves the color matrix used by the node.

get_color_offset() Vec4

Retrieves the color offset used by the node.