Easing
Named easing curves and interpolate() for number, Vector2i, Color32, and Rect2i.
Named easing curves for palette fades, audio fades, and demo animation. Evaluate a curve with applyEasing, or
interpolate number / Vector2i / Color32 / Rect2i values with interpolate.
Curve math matches RetroBlit by Martin Cietwierkowski (Ease class, Robert
Penner's easing equations).
EasingFunction Since 1.0.3
applyEasing Since 1.0.3
interpolate Since 1.5.0
import { , , , } from 'blit386';
const = (0.5, 'ease-in-out'); // 0..1 progress → eased value
const = ('bounce-out', new (0, -40), new (0, 80), 0.7);
const = ('cubic-out', ., ., 0.4);Curves
EasingFunction is a string union. 'ease-in', 'ease-out', and 'ease-in-out' are the quadratic family (kept for
existing palette and audio call sites).
| Family | Identifiers |
|---|---|
| Linear | 'linear' |
| Quadratic | 'ease-in', 'ease-out', 'ease-in-out' |
| Sine | 'sine-in', 'sine-out', 'sine-in-out' |
| Cubic | 'cubic-in', 'cubic-out', 'cubic-in-out' |
| Quartic | 'quartic-in', 'quartic-out', 'quartic-in-out' |
| Quintic | 'quintic-in', 'quintic-out', 'quintic-in-out' |
| Exponential | 'expo-in', 'expo-out', 'expo-in-out' |
| Circular | 'circ-in', 'circ-out', 'circ-in-out' |
| Back (overshoot) | 'back-in', 'back-out', 'back-in-out' |
| Elastic | 'elastic-in', 'elastic-out', 'elastic-in-out' |
| Bounce | 'bounce-in', 'bounce-out', 'bounce-in-out' |
Every curve returns 0 at t = 0 and 1 at t = 1. Values of t outside [0, 1] are not clamped. Back and elastic
curves may overshoot outside [0, 1] for intermediate t.
applyEasing
import { } from 'blit386';
const = (0.5, 'cubic-in'); // 0.125interpolate
Applies the curve to t, then interpolates from start to end.
number- floating-point blendVector2i/Rect2i- each component rounded to the nearest integerColor32- each channel rounded and clamped to[0, 255]
import { , } from 'blit386';
const = ('sine-in-out', new (0, 0, 16, 16), new (40, 20, 64, 48), 0.5);API history
| Symbol | Since | Last changed | Status |
|---|---|---|---|
applyEasing | 1.0.3 | 1.5.0 | stable |
EasingFunction | 1.0.3 | 1.5.0 | stable |
interpolate | 1.5.0 | – | stable |
1.5.0 - Tue Aug 11 2026
- Changed
EasingFunctionAdded sine, cubic, quartic, quintic, expo, circ, back, elastic, and bounce families. - Changed
applyEasingAdded sine, cubic, quartic, quintic, expo, circ, back, elastic, and bounce families. - Added
interpolate
1.0.3 - Sat May 16 2026
- Added
EasingFunction - Added
applyEasing
See also
API: Palette
API: Audio
EasingFunction.API: Core Types
Vector2i, Rect2i, and Color32 used by interpolate.Last updated on October 18, 2026