Skip to content

Wipe

Use this module to wipe the tree with color. P.P.S please do not actually wipe the tree, the LEDs do not like being wet and may produce the magic smoke 😉

wipe(theta, alpha, color, speed, fade=None)

wipe A simple wipe

Wipe a color from one side to the other. The angle is defined by Theta and Alpha. The prefered way to wipe a color on the tree is wipe_frames()

Parameters:

Name Type Description Default
theta float

Angle in radians

required
alpha float

Angle in radians

required
color Color

The color you are setting

required
speed int

The speed of the animation

required
fade Color | None

Possibly an in between color to be used during the wipe. Defaults to None.

None

wipe_frames(theta, alpha, color, frames=45, fade=None)

wipe_frames wipe for n number of frames

A more predictable version of wipe().

Parameters:

Name Type Description Default
theta float

Angle in radians

required
alpha float

Angle in radians

required
color Color

The colour to wipe to

required
frames int

The exact number of frames that the wipe will take to complete. Defaults to 45.

45
fade Color | None

The color the tree goes to after the wipe. Defaults to None.

None

wipe_wave_frames(theta, alpha, color, frames=45, lerp_frame=20, lerp_fn=linear)

wipe_wave_frames Wave for a number of frames

Lerp pixels to the target color over the specified number of lerp frames. Produces more of a wave rather than a wipe.

Parameters:

Name Type Description Default
theta float

Angle in radians

required
alpha float

Angle in radians

required
color Color

The colour to wipe to

required
frames int

The exact number of frames the animation will take to complete. Defaults to 45.

45
lerp_frame int

The number of frames to lerp over. Defaults to 20.

20
lerp_fn Callable[[float], float]

Unkown. Defaults to linear.

linear