Skip to content

feat(background): add the edges density ramp to pixel_grid - #205

Merged
LeadcodeDev merged 1 commit into
mainfrom
feat/pixel-grid-edges-ramp
Aug 12, 2026
Merged

feat(background): add the edges density ramp to pixel_grid#205
LeadcodeDev merged 1 commit into
mainfrom
feat/pixel-grid-edges-ramp

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Owner

Follow-up to #204.

What

pixel_grid shipped with radial — dense at the centre, thinning outwards. Porting it onto a real piece showed the opposite is what a background usually needs.

Measured on the reference texture, in a horizontal band clear of its window, cell density across the tenths of the frame:

10.9 · 6.5 · 0.8 · 0.2 · 0.2 · 0.2 · 0.2 · 0.9 · 7.8 · 8.8 %

Heavy at both edges, effectively empty through the middle 60 %. A vignette — which is what keeps the texture off whatever sits in the centre (here, a terminal window). None of the five existing ramps can express it: the one-way ramps are monotonic, and radial is exactly backwards.

I had first read the texture as "denser toward the right" from two crops, and built the demo on that. Two crops from opposite sides of the frame both look like a one-way ramp; only measuring the whole width shows the symmetry.

How

One arm, and the test asserts the relationship rather than describing it:

radial(p) + edges(p) == 1     // at every sampled point

plus the vignette's own shape — zero at the centre, ~1 at both left and right edges.

Docs

SKILL.md's ramp row now says what edges is for, and that radial is its inverse.

cargo test --workspace green, cargo fmt --check and cargo clippy --all-targets -- -D warnings clean.

pixel_grid shipped with `radial` — dense at the centre, thinning outwards.
Measuring the reference texture showed the opposite is what a background
actually needs: across the tenths of a band clear of its window, density runs

    10.9 · 6.5 · 0.8 · 0.2 · 0.2 · 0.2 · 0.2 · 0.9 · 7.8 · 8.8 %

heavy at both edges, effectively empty through the middle 60 %. That is a
vignette, and it is what keeps the texture off whatever sits in the centre —
here a terminal window. None of the five existing ramps can express it: the
one-way ramps are monotonic and `radial` is its exact inverse.

`Edges` is that inverse, asserted as such in the test rather than described:
`radial(p) + edges(p) == 1` at every sampled point.
@LeadcodeDev LeadcodeDev added the enhancement New feature or request label Aug 12, 2026
@LeadcodeDev LeadcodeDev self-assigned this Aug 12, 2026
@LeadcodeDev
LeadcodeDev merged commit 3666d07 into main Aug 12, 2026
3 checks passed
@LeadcodeDev
LeadcodeDev deleted the feat/pixel-grid-edges-ramp branch August 12, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant