From 749cb0885872571b36d9b3174067911a47fd5e3b Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 13 Jun 2026 18:19:25 -0500 Subject: Fix theme studio span endpoint tiles --- scripts/theme-studio/palette-actions.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'scripts/theme-studio/palette-actions.js') diff --git a/scripts/theme-studio/palette-actions.js b/scripts/theme-studio/palette-actions.js index 11f37d2f6..7fbac701b 100644 --- a/scripts/theme-studio/palette-actions.js +++ b/scripts/theme-studio/palette-actions.js @@ -35,7 +35,7 @@ function ensureGroundEndpoints(){ } function normalizePalette(){PALETTE=PALETTE.map(normalizePaletteEntry);ensureGroundEndpoints();} // The ground column is explicit: bg pins the top endpoint, fg pins the bottom -// endpoint, and generated ground-N steps live between them. +// endpoint, and generated ground+N steps live between them. function groundColumnMembers(){ return groundColumnMembersFromPalette(PALETTE,{bg:MAP['bg'],fg:MAP['p']}); } @@ -50,10 +50,13 @@ function setGroundSpan(n){ const old=PALETTE.filter(entry=>groundRoleOfEntry(entry,{bg:MAP['bg'],fg:MAP['p']})==='step'); const bg=srgb2oklab(MAP['bg']),fg=srgb2oklab(MAP['p']); const entries=[]; + let step=1; for(let i=1;i<=n;i++){ const t=i/(n+1); const lab={L:bg.L+(fg.L-bg.L)*t,a:bg.a+(fg.a-bg.a)*t,b:bg.b+(fg.b-bg.b)*t}; - entries.push([lrgb2hex(oklab2lrgb(lab.L,lab.a,lab.b)),'ground-'+i,'ground']); + const hex=lrgb2hex(oklab2lrgb(lab.L,lab.a,lab.b)); + if(hex.toLowerCase()==='#ffffff'||hex.toLowerCase()==='#000000')continue; + entries.push([hex,'ground+'+(step++),'ground']); } for(const [oldHex,oldName] of old){ const next=entries.find(([,name])=>name===oldName); -- cgit v1.2.3