aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/palette-actions.js
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-13 18:19:25 -0500
committerCraig Jennings <c@cjennings.net>2026-06-13 18:19:25 -0500
commit749cb0885872571b36d9b3174067911a47fd5e3b (patch)
tree4253b675c96dcdf78639611e4b57f66813929b7a /scripts/theme-studio/palette-actions.js
parentd0cf30bfa37864db12009c2f561c87f96bd66989 (diff)
downloaddotemacs-749cb0885872571b36d9b3174067911a47fd5e3b.tar.gz
dotemacs-749cb0885872571b36d9b3174067911a47fd5e3b.zip
Fix theme studio span endpoint tiles
Diffstat (limited to 'scripts/theme-studio/palette-actions.js')
-rw-r--r--scripts/theme-studio/palette-actions.js7
1 files changed, 5 insertions, 2 deletions
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);