Skip to content

ColorTween

Defined in: src/anim/tween.ts:118

A Tween for CSS colours. Drives an internal 0→1 progress and interpolates each channel, returning an rgb(...) string. Endpoints may be hex, rgb(), or a basic colour name.

new ColorTween(initial): ColorTween

Defined in: src/anim/tween.ts:123

string

ColorTween

get animating(): boolean

Defined in: src/anim/tween.ts:159

True while the color is still changing.

boolean


get goal(): string

Defined in: src/anim/tween.ts:147

The color this tween is moving toward.

string


get value(): string

Defined in: src/anim/tween.ts:152

The interpolated rgb(...) color at the present clock.

string

set(value): void

Defined in: src/anim/tween.ts:140

Jump straight to value with no motion.

string

void


to(target, opts?): void

Defined in: src/anim/tween.ts:130

Aim at a new target color, interpolating from the one shown now.

string

TweenOptions = {}

void