engine/vaporwave library

The Vaporwave family (family id 14): late-night mall-soft and outrun. A striped retro sun sinking into a neon perspective-grid floor under a sunset sky, with a floating Windows-95-era window for the display and chunky bevelled buttons in pastel periwinkle, lavender, lilac or baby pink (function keys also peach), plus hot-pink, magenta, violet or coral and cyan or aqua accents. Pure Dart: part of the generator, so every constant here is part of the family's engine-v3 definition and must not change without a version bump once a build ships it.

  • Scene (BackgroundKind.vaporSunset, painted by render/vaporwave/vaporwave_scene.dart): one of four variants — dusk and midnight (dark), pastel and aqua (light). Its ten BackgroundSpec.colors are, in order: sky top (also Palette.background), sky middle, horizon glow, sun top, sun middle, sun bottom, floor at the horizon, floor at the bottom, grid lines and the horizon line (also the haze over the far floor). angleTenths is the horizon height in permille of the scene when the painter has no display rectangle to anchor it to (380–460); driftPeriodMs (48 s) switches the grid's slow drift on.
  • Keys: square Win95 buttons (corners 0, 10 or 20 ‰ of the key's short side: at most about 2 dp on desktop), a 1 dp ink line (Palette.shadow = every KeyColors.edge), a hard two-tone bevel derived from the face at paint time, and a face that never moves: the bevel inverts in frame 1 and the label travels (+d, +d). Digit and function faces are pastels at Win95-grey lightness (L 0.79–0.83); the warm accent sits below them (L 0.66–0.71; 0.72–0.75 under the Accessible lock) and the cool accent above (L 0.88–0.92), so operators and = stand apart in lightness as well as hue. Operators always carry a label ≥ 200 heavier (OperatorCue.weight).
  • Display: an opaque client panel (Palette.surface) inside a bevelled window whose titleless title bar runs from Palette.highlight to Palette.accent (the accent pair, or a classic navy → teal).

Every draw comes from the generator's named sub-streams (palette and its retry streams, background, shape, style, type, motion, name), so a theme is a pure function of (seed, engineVersion, accessible).

Classes

VaporTone
One scene colour: lightness (× 1000), chroma (absolute, or relative to the gamut and capped) and hue.

Enums

VaporHue
Where a scene colour's hue comes from.
VaporScene
The four scene variants.

Constants

vaporwaveAccentBodyContrast → const double
vaporwaveAccentBodyDeltaE → const double
Accent vs digit / function separation (normal and simulated CVD), and the face contrast that keeps accents a lightness step away.
vaporwaveAccentChromaCapMilli → const int
vaporwaveAccentChromaRel → const IntRange
Accent chroma: rel × maxChroma(L, h), rel in permille, capped.
vaporwaveAccentPairs → const List<({VaporAccent eq, VaporAccent op, int weight})>
Accent pairs: operator and = are always one warm and one cool neon.
vaporwaveBevelCdp → const List<int>
vaporwaveClassicTitleMaxL → const double
A title bar whose start (Palette.highlight) is darker than this OKLab lightness is the classic navy one (navy L ≤ 0.34; every warm accent is ≥ 0.56).
vaporwaveCoolLMilli → const IntRange
Cool accent lightness (× 1000).
vaporwaveCornerPermille → const IntRange
Shape, style and type ranges.
vaporwaveDarkInkChromaMilli → const IntRange
vaporwaveDarkInkLMilli → const IntRange
vaporwaveDarkSceneCheckY → const double
The validator's band (a little looser than the generator's clamp).
vaporwaveDarkSceneMaxY → const double
Night scenes keep every colour at or below this luminance (and day scenes at or above vaporwaveLightSceneMinY), so one focus-ring colour is legible on the whole scene.
vaporwaveDarkSceneWeights → const List<int>
Dark themes: [dusk, midnight] weights.
vaporwaveDarkSurfaceChromaMilli → const IntRange
vaporwaveDarkSurfaceLMilli → const IntRange
vaporwaveDefinition → const FamilyDefinition
Vaporwave: square Win95 buttons with a hard two-tone bevel that inverts on touch-down (frame 1, on tint) while the label travels (+d, +d) with d = 1–2 dp (seeded); effectsFast in, 439/0.8 out (seeded × {0.9, 1, 1.1}, ζ ± 0.05); no scale (it would blur the 1 dp line and bevel); a 6 % contrast-safe state layer; display glyphs rise 6 dp on standard.normal; sound softTap, haptic light · 0.6. The palette and the sunset scene are built by buildVaporwaveCandidate.
vaporwaveDigitChromaMilli → const IntRange
vaporwaveDigitCoolGap → const int
vaporwaveDigitLMilli → const IntRange
Digit and function faces: Win95-grey lightness, pastel chroma (the digit floor 0.048 keeps every face at C ≥ 0.045 after 8-bit rounding).
vaporwaveDigitPastelFirst → const int
The pastels a digit face may take: periwinkle, lavender, lilac and baby pink (indices 2–5). Peach and mint are function-key colours only (beige digits read as a 90s office PC, Retro's keycaps); a draw of either becomes lavender before the search for a hue clear of the accents.
vaporwaveDigitPastelLast → const int
vaporwaveDigitPastelRemap → const int
vaporwaveDigitWarmGap → const int
Minimum hue distances (tenths) of the digit pastel from the warm and cool accents, and of the function pastel from both and the digit.
vaporwaveDriftPeriodMs → const int
The scene's drift period (one grid-line cycle), ms.
vaporwaveEdgeShadePermille → const IntRange
vaporwaveFunctionChromaMilli → const IntRange
vaporwaveFunctionCoolGap → const int
vaporwaveFunctionDigitGap → const int
vaporwaveFunctionLMilli → const IntRange
vaporwaveFunctionSteps → const List<({int step, int weight})>
Function-key pastel: (digit index + step) % 6, step weights.
vaporwaveFunctionWarmGap → const int
vaporwaveGlowAlpha → const int
The alpha of the horizon line's glow underlay on night scenes (0–255).
vaporwaveHazeAlpha → const int
The strongest alpha of the haze in the horizon line's colour that fades out over the floor's far 12 % (0–255): night scenes, and the lighter day-scene haze.
vaporwaveHazeAlphaLight → const int
vaporwaveHighlightPermille → const IntRange
vaporwaveHorizonMaxPermille → const int
vaporwaveHorizonMinPermille → const int
The horizon height when the scene has no display rectangle, permille of the scene height (BackgroundSpec.angleTenths).
vaporwaveLightGridFloorContrast → const double
Day scenes: the grid against the near floor (the table guarantees it).
vaporwaveLightInkChromaMilli → const IntRange
vaporwaveLightInkHueTenths → const IntRange
vaporwaveLightInkLMilli → const IntRange
Ink (key lines, window frame; Palette.shadow).
vaporwaveLightKeyFloorContrast → const double
Day scenes: the digit and function faces against the far floor (the generator darkens the far floor until it is reached).
vaporwaveLightSceneCheckY → const double
vaporwaveLightSceneMinY → const double
vaporwaveLightSceneWeights → const List<int>
Light themes: [pastel, aqua] weights.
vaporwaveLightSurfaceChromaMilli → const IntRange
vaporwaveLightSurfaceLMilli → const IntRange
Display client panel (Palette.surface).
vaporwaveOperatorFaceDeltaE → const double
Operator / = vs digit ΔEOK (normal vision; CVD is covered by vaporwaveAccentBodyDeltaE and the weight cue).
vaporwaveOutlineWidthCdp → const int
vaporwavePastels → const List<({int hueTenths, int jitterTenths, int weight})>
Pastel key hues: (centre, ± jitter, weight) in tenths, ordered by hue (peach, mint, periwinkle, lavender, lilac, baby pink).
vaporwaveSceneTones → const Map<VaporScene, List<VaporTone>>
Scene colour tables, indices 0–9 as documented in the library comment.
vaporwaveStateLayerPermille → const int
vaporwaveSunGlowDeltaE → const double
The lowest sun stripes must read against the horizon glow behind them: night skies lower the glow until ΔEOK(sun bottom, glow) reaches this.
vaporwaveTitleWeights → const List<int>
Title bar: [sunset (the accent pair), classic (navy → teal)] weights.
vaporwaveWarmAccessibleFloorMilli → const int
vaporwaveWarmAccessibleLMilli → const IntRange
vaporwaveWarmLMilli → const IntRange
Warm accent lightness (× 1000), and its range under the Accessible lock (the same draw mapped onto it, so both modes draw alike).
vaporwaveWarmPastelChromaMilli → const IntRange
Faces with a hue in 340–80° (baby pink, peach) map their chroma draw onto this range instead: at L 0.8 a peach or pink below C 0.065 reads as cardboard or dusty rose, not pastel.
vaporwaveWarmPastelHueTenths → const IntRange

Functions

buildVaporwaveCandidate(int seed, FamilyDefinition def, int engineVersion, {int attempt = 0, bool accessible = false}) → ThemeSpec
Builds one unvalidated Vaporwave candidate (the generator repairs and validates it, retries with palette/retry/n and finally falls back to a Vaporwave hero).
repairVaporwaveExtras(Palette p, ThemeSpec spec, GuardrailLimits lim, List<int> bgs) → Palette?
Family-specific repairs after labels and display texts (called from repairTheme for ThemeFamily.vaporwave specs only); null = unrepairable:
validateVaporwave(ThemeSpec spec, GuardrailLimits lim, List<int> bgs) → List<GuardrailViolation>
The family-specific guardrails (called from validateTheme for ThemeFamily.vaporwave specs only):
vaporwaveAccentApart(int a, int b) → bool
Whether accent face a stands apart from body face b (normal and CVD ΔEOK, and face contrast).
vaporwaveBevelHighlight(int face, int highlightPermille) → int
The outer bevel highlight of a key face (drawn just inside the ink line on the top and left edges at rest, on the bottom and right while pressed): with face = (L, C, h) and m = highlightPermille / 1000 (× 0.6 when L < 0.5), the colour (L + (1 − L)·m, 0.6·C, h). The key painter's bevel (render/vaporwave/vaporwave_bevel.dart) uses this exact formula, so the guardrail measures what is drawn.
vaporwaveDisplayBackdrops(ThemeSpec spec, List<int> surfaces, List<int> bgs) → List<int>?
Everything display text of spec may be drawn on: Vaporwave draws every display glyph on the window's opaque client panel (the surface), never on the scene, so surfaces alone.
vaporwaveKeyMixSamplesOf(List<int> stops) → List<int>
The in-between colours a key can sit over: the grid at alpha k / 8 (k = 1…7) over each floor sample and over the horizon haze, plus the haze itself. The painter really draws them behind the top key rows: the far end of every floor ray and the far cross lines fade in with alpha, the haze fades out, and every line has anti-aliased edges. Midway between a dark floor and a bright grid neither a warm face nor the dark ink reaches 3:1, so the boundary rule counts the key's outer bevel highlight there (vaporwaveBevelHighlight).
vaporwaveKeySamplesOf(List<int> stops) → List<int>
The plain surfaces a key is seen against: keys only ever cover the floor (the painter puts the horizon above the keypad in every layout), so the two floor stops, the floor gradient between them and the grid colour. The colours in between the grid and the floor, which the painter shows too, are vaporwaveKeyMixSamplesOf.
vaporwaveSamplesOf(List<int> stops) → List<int>
Every opaque colour of a Vaporwave scene with the ten stops: the stops, the ¼ / ½ / ¾ mixes of _vaporMixPairs, the horizon glow over the sky and the floor, and the horizon haze over the far floor (58 samples).
vaporwaveSceneSamples(BackgroundSpec bg) → List<int>?
Guardrail background samples of the family's scene (BackgroundKind.vaporSunset): the ten colours, the ¼ / ½ / ¾ mixes of every pair the painter blends or anti-aliases, the horizon glow and the horizon haze (vaporwaveSamplesOf). Null (the generic stops) for a malformed scene.
vaporwaveSceneWellFormed(BackgroundSpec bg) → bool
Whether bg is a well-formed Vaporwave scene (ten opaque colours).

Typedefs

VaporAccent = ({int hueTenths, int jitterTenths, bool warm})
One accent of a pair: centre hue (tenths), ± jitter (tenths), and whether it is the warm (darker) or the cool (lighter) neon.