Add showcase presets (Lumen/Aurora/Bloom/Etching) with art defaults on - #46
Merged
Conversation
Adds `Option<RgbColor>` accent param to `temporal_modulate` and `colorize_subpixel`. When `None`, behavior is byte-identical to before. Threads the parameter down through `TerminalRenderer::set_temporal`, `FrameBuffer::from_downsampled` / `_at` / `create_cell`, `render_colored_cell`, and `export::png::save_frame_as_png`. All call sites pass `None`; visual regression unchanged (51/51).
Add Preset::Lumen, Aurora, Bloom, Etching to test_presets_valid so all 34 presets are covered by automated validation. Also fixes a typo in the ReactiveSwarm FromStr arm: "reactive_swar" → "reactive_swarm" (the trailing 'm' was missing, causing --preset reactive_swarm to fail to parse).
Add visual regression golden tests for the four showcase presets introduced in Task 6: lumen, aurora, bloom, and etching (braille). Update README Gallery section from 30 to 34 presets and add one-line descriptions for each new preset.
…export accent
temporal_modulate's Accent mode mixes the base color toward an accent in
OKLch. When the accent (or the palette hot-end fallback, e.g. Slime/Neon)
is achromatic, srgb_to_oklch returns a NaN ('powerless') hue; the old
linear interpolation oa.h + (ob.h - oa.h)*t then yields NaN for every t
(NaN*0 == NaN), so oklch_to_srgb produced garbage (green rendered as its
magenta complement) for every temporal-on cell, not just growing fronts.
- mix_oklch: short-circuit t<=0/t>=1 (no lossy round-trip) and interpolate
hue via NaN-safe, short-arc lerp_hue (achromatic endpoint -> use the
chromatic endpoint's hue, per CSS Color 4 missing-component rules).
- Hue mode: leave achromatic bases unchanged (no hue to rotate).
- Export paths (print/capture/gif/webm) now thread the resolved
temporal_accent instead of hardcoding None, so hand-picked accents reach
GIF/PNG output (and the ws6 gallery), matching the interactive renderer.
Regenerates the 4 showcase goldens and corrects the pre-existing
temporal_color_accent golden (was generated with the bug). 3 new regression
tests cover achromatic accent/base and exact endpoints.
…rk Aurora) Keep every temporal-colored cell on the active palette's own gradient, per the requirement that added front colors must agree with the palette: - Accent-mode default accent now samples the palette's own vivid stop (palette_accent_color, brightness 0.85) instead of the hot end (1.0), which is white/desaturated on many palettes (Slime, Cosmic) and washed the front. - All four showcase presets use Accent mode with palette-derived accents (temporal_accent: None); dropped the foreign hand-picked gold/cyan and the off-palette hue-mode drift (Aurora/Bloom were hue). - Rework Aurora: deep Ocean palette + restrained afterglow (0.15) + higher white-point (max_brightness 26) so the luminous network reads against a dark body instead of washing to a pale fill. Regenerates the 4 showcase goldens and temporal_color_accent (now reflects the palette-derived accent). All existing presets remain byte-identical.
The lumen preset's temporal accent-mode render exercises the heaviest OKLch float path (srgb_to_oklch -> mix -> oklch_to_srgb with cbrt/powf/atan2). One cell in the seed-42 frame lands on a libm rounding boundary where macOS (arm64) and Linux (x86_64) diverge by 1 ULP, flipping a u8 channel and thus the golden bytes. CI runs on Linux, so the golden is pinned to Linux output (regenerated in a rust:latest container). The other three showcase goldens and temporal_color_accent are byte-identical across both platforms.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #36.
Adds four showcase presets that ship the merged art-direction levers ON via per-preset render/sim defaults, so opting into one gives an "alive" look out of the box.
Presets
Payload extension
Extends the per-preset
RenderArtDefaultspayload with temporal-color (strength/lag/mode/accent), palette, and charset — allOption/identity so the 30 existing presets stay byte-identical. CLI flags always override per-preset defaults; saved configs gain atemporal_accentfield with serde-default back-compat.Color correctness
Fixes a temporal accent-mode bug surfaced by these presets: an achromatic accent (or palette hot-end fallback) has a NaN OKLch hue, which the old linear hue interpolation propagated (NaN·0 = NaN), corrupting every temporal-on cell to its color complement. Now uses a NaN-safe short-arc hue lerp with endpoint short-circuits, and the accent defaults to the palette's own vivid stop so added front colors stay on the active gradient. Export paths now thread the resolved accent.
Tests
cargo fmt,cargo clippy --all-targets --all-features -- -D warnings,cargo test(850 lib + integration),cargo test --test visual_regression(55) — all green.Notes