aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/palette-actions.js
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-13 17:57:30 -0500
committerCraig Jennings <c@cjennings.net>2026-06-13 17:57:30 -0500
commit421cd8dccb595e9fc22a4fda7776294eb49215f7 (patch)
treee4352c2df3710884321e38c12f468c2e3f3f6f5e /scripts/theme-studio/palette-actions.js
parentd6c9098a65d14a5b26e07711a1884ba4c1f60497 (diff)
downloaddotemacs-421cd8dccb595e9fc22a4fda7776294eb49215f7.tar.gz
dotemacs-421cd8dccb595e9fc22a4fda7776294eb49215f7.zip
Fix theme studio fg endpoint selection
Diffstat (limited to 'scripts/theme-studio/palette-actions.js')
-rw-r--r--scripts/theme-studio/palette-actions.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/theme-studio/palette-actions.js b/scripts/theme-studio/palette-actions.js
index a7b3b28e4..11f37d2f6 100644
--- a/scripts/theme-studio/palette-actions.js
+++ b/scripts/theme-studio/palette-actions.js
@@ -28,7 +28,12 @@ function normalizePaletteEntry(entry){
const hex=entry&&entry[0],name=(entry&&entry[1])||'color';
return [hex,name,(entry&&entry[2])||columnIdOf(entry)];
}
-function normalizePalette(){PALETTE=PALETTE.map(normalizePaletteEntry);}
+function ensureGroundEndpoints(){
+ const ground={bg:MAP['bg'],fg:MAP['p']};
+ if(ground.bg&&!PALETTE.some(entry=>groundRoleOfEntry(entry,ground)==='bg'))PALETTE.unshift([ground.bg,'bg','ground']);
+ if(ground.fg&&!PALETTE.some(entry=>groundRoleOfEntry(entry,ground)==='fg'))PALETTE.push([ground.fg,'fg','ground']);
+}
+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.
function groundColumnMembers(){