TTkLinearGradient🌶️

class TTkLinearGradient(*args, **kwargs)[source]🌶️

Bases: TTkColorModifier

Create a directional gradient interpolating toward a target color.

Methods🌶️

exec(x, y, base_color) TTkColor[source]🌶️

Evaluate the directional gradient at a point and return the blended color.

Parameters:
  • x (int) – horizontal coordinate

  • y (int) – vertical coordinate

  • base_color (TTkColor) – starting color for interpolation

Returns:

interpolated color

Return type:

TTkColor

setParam(*args, **kwargs) None[source]🌶️

Update linear gradient parameters.

Supported kwargs are base_pos, direction, and target_color.

TTkLinearGradient Attributes🌶️

default_target_color