BLIT386BLIT386

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).

FamilyIdentifiers
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.125

interpolate

Applies the curve to t, then interpolates from start to end.

  • number - floating-point blend
  • Vector2i / Rect2i - each component rounded to the nearest integer
  • Color32 - 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

SymbolSinceLast changedStatus
applyEasing1.0.31.5.0stable
EasingFunction1.0.31.5.0stable
interpolate1.5.0–stable

1.5.0 - Tue Aug 11 2026

  • ChangedEasingFunctionAdded sine, cubic, quartic, quintic, expo, circ, back, elastic, and bounce families.
  • ChangedapplyEasingAdded sine, cubic, quartic, quintic, expo, circ, back, elastic, and bounce families.
  • Addedinterpolate

1.0.3 - Sat May 16 2026

  • AddedEasingFunction
  • AddedapplyEasing

See also

Last updated on October 18, 2026

On this page