aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/theme-studio')
-rw-r--r--scripts/theme-studio/app.js1
-rw-r--r--scripts/theme-studio/previews.js29
-rw-r--r--scripts/theme-studio/test_generate.py2
-rw-r--r--scripts/theme-studio/theme-studio.html30
4 files changed, 61 insertions, 1 deletions
diff --git a/scripts/theme-studio/app.js b/scripts/theme-studio/app.js
index baf9c5e3..34ba6995 100644
--- a/scripts/theme-studio/app.js
+++ b/scripts/theme-studio/app.js
@@ -574,6 +574,7 @@ const PACKAGE_PREVIEWS={
tmr:renderTmrPreview,wttrin:renderWttrinPreview,alert:renderAlertPreview,
orgsuperstar:renderOrgSuperstarPreview,nerdiconscompletion:renderNerdIconsCompletionPreview,
ghostel:renderGhostelPreview,alltheicons:renderAllTheIconsPreview,
+ ansicolor:renderAnsiColorPreview,
erc:renderErcPreview,orgdrill:renderOrgdrillPreview,orgnoter:renderOrgnoterPreview,signel:renderSignelPreview,
pearl:renderPearlPreview,slack:renderSlackPreview,telega:renderTelegaPreview,shr:renderShrPreview,
nerdicons:renderNerdIconsPreview
diff --git a/scripts/theme-studio/previews.js b/scripts/theme-studio/previews.js
index 596ea8a4..8f8c7698 100644
--- a/scripts/theme-studio/previews.js
+++ b/scripts/theme-studio/previews.js
@@ -900,6 +900,35 @@ function renderNerdIconsCompletionPreview(){const a='nerd-icons-completion',L=[]
L.push(' '+os(a,'nerd-icons-completion-dir-face','')+' modules/');
L.push('  app.js · file icons keep their own nerd-icons faces');
return previewLines(L);}
+function renderAnsiColorPreview(){const a='ansi-color',L=[];
+ // ansi-color.el applies the 16 SGR palette faces to any buffer holding raw
+ // escape codes (compilation, comint, shell, eshell output). eat/vterm's
+ // color faces :inherit these, so theming ansi-color-* is what drives the
+ // terminal palette across the whole config. Literal names for the gate.
+ const C={black:'ansi-color-black',red:'ansi-color-red',green:'ansi-color-green',
+ yellow:'ansi-color-yellow',blue:'ansi-color-blue',magenta:'ansi-color-magenta',
+ cyan:'ansi-color-cyan',white:'ansi-color-white','bright-black':'ansi-color-bright-black',
+ 'bright-red':'ansi-color-bright-red','bright-green':'ansi-color-bright-green',
+ 'bright-yellow':'ansi-color-bright-yellow','bright-blue':'ansi-color-bright-blue',
+ 'bright-magenta':'ansi-color-bright-magenta','bright-cyan':'ansi-color-bright-cyan',
+ 'bright-white':'ansi-color-bright-white'};
+ const c=(f,t)=>os(a,C[f],t);
+ L.push('*compilation* — ansi-color renders the SGR codes make emits:');
+ L.push(c('bright-blue','make')+'['+c('yellow','1')+']: Entering directory');
+ L.push(c('green','✔')+' compiling modules/ai-term.el');
+ L.push(c('green','✔')+' compiling modules/calendar-sync.el');
+ L.push(c('yellow','⚠')+' warning: unused lexical variable '+c('cyan','x'));
+ L.push(c('red','✘')+' error: void-function '+c('bright-red','cj/frob'));
+ L.push('');
+ L.push('M-x shell — ls --color and a git log pipe theme the same way:');
+ L.push(c('blue','src/')+' '+c('bright-green','run.sh')+' '+c('cyan','latest')+' -> '+c('blue','v2.1/')+' '+c('red','backup.tar.gz'));
+ L.push(c('yellow','a1b2c3d')+' '+c('bright-cyan','(HEAD -> ')+c('bright-green','main')+c('bright-cyan',')')+' land the ansi-color scene');
+ L.push(c('bright-black','· dim context line drawn in bright-black (ANSI 8)'));
+ L.push('');
+ L.push('the 16 SGR slots ansi-color paints:');
+ L.push('normal '+c('black','■')+c('red','■')+c('green','■')+c('yellow','■')+c('blue','■')+c('magenta','■')+c('cyan','■')+c('white','■'));
+ L.push('bright '+c('bright-black','■')+c('bright-red','■')+c('bright-green','■')+c('bright-yellow','■')+c('bright-blue','■')+c('bright-magenta','■')+c('bright-cyan','■')+c('bright-white','■'));
+ return previewLines(L);}
function renderGhostelPreview(){const a='ghostel',L=[],d=t=>os(a,'ghostel-default',t);
// Literal face names (the coverage gate matches verbatim, not constructed):
const COLOR={black:'ghostel-color-black',red:'ghostel-color-red',green:'ghostel-color-green',
diff --git a/scripts/theme-studio/test_generate.py b/scripts/theme-studio/test_generate.py
index 4ae9b3d0..d4f36372 100644
--- a/scripts/theme-studio/test_generate.py
+++ b/scripts/theme-studio/test_generate.py
@@ -860,7 +860,7 @@ class BespokePreviewFaceCoverage(unittest.TestCase):
"emms", "org-roam", "hl-todo", "symbol-overlay",
"highlight-indent-guides", "yasnippet", "prescient", "flyspell-correct",
"tmr", "wttrin", "alert", "org-superstar", "nerd-icons-completion",
- "ghostel", "all-the-icons",
+ "ghostel", "all-the-icons", "ansi-color",
]
def test_every_face_appears_in_the_renderer(self):
diff --git a/scripts/theme-studio/theme-studio.html b/scripts/theme-studio/theme-studio.html
index 89c9b5ad..ca4c8646 100644
--- a/scripts/theme-studio/theme-studio.html
+++ b/scripts/theme-studio/theme-studio.html
@@ -3568,6 +3568,35 @@ function renderNerdIconsCompletionPreview(){const a='nerd-icons-completion',L=[]
L.push(' '+os(a,'nerd-icons-completion-dir-face','')+' modules/');
L.push('  app.js · file icons keep their own nerd-icons faces');
return previewLines(L);}
+function renderAnsiColorPreview(){const a='ansi-color',L=[];
+ // ansi-color.el applies the 16 SGR palette faces to any buffer holding raw
+ // escape codes (compilation, comint, shell, eshell output). eat/vterm's
+ // color faces :inherit these, so theming ansi-color-* is what drives the
+ // terminal palette across the whole config. Literal names for the gate.
+ const C={black:'ansi-color-black',red:'ansi-color-red',green:'ansi-color-green',
+ yellow:'ansi-color-yellow',blue:'ansi-color-blue',magenta:'ansi-color-magenta',
+ cyan:'ansi-color-cyan',white:'ansi-color-white','bright-black':'ansi-color-bright-black',
+ 'bright-red':'ansi-color-bright-red','bright-green':'ansi-color-bright-green',
+ 'bright-yellow':'ansi-color-bright-yellow','bright-blue':'ansi-color-bright-blue',
+ 'bright-magenta':'ansi-color-bright-magenta','bright-cyan':'ansi-color-bright-cyan',
+ 'bright-white':'ansi-color-bright-white'};
+ const c=(f,t)=>os(a,C[f],t);
+ L.push('*compilation* — ansi-color renders the SGR codes make emits:');
+ L.push(c('bright-blue','make')+'['+c('yellow','1')+']: Entering directory');
+ L.push(c('green','✔')+' compiling modules/ai-term.el');
+ L.push(c('green','✔')+' compiling modules/calendar-sync.el');
+ L.push(c('yellow','⚠')+' warning: unused lexical variable '+c('cyan','x'));
+ L.push(c('red','✘')+' error: void-function '+c('bright-red','cj/frob'));
+ L.push('');
+ L.push('M-x shell — ls --color and a git log pipe theme the same way:');
+ L.push(c('blue','src/')+' '+c('bright-green','run.sh')+' '+c('cyan','latest')+' -> '+c('blue','v2.1/')+' '+c('red','backup.tar.gz'));
+ L.push(c('yellow','a1b2c3d')+' '+c('bright-cyan','(HEAD -> ')+c('bright-green','main')+c('bright-cyan',')')+' land the ansi-color scene');
+ L.push(c('bright-black','· dim context line drawn in bright-black (ANSI 8)'));
+ L.push('');
+ L.push('the 16 SGR slots ansi-color paints:');
+ L.push('normal '+c('black','■')+c('red','■')+c('green','■')+c('yellow','■')+c('blue','■')+c('magenta','■')+c('cyan','■')+c('white','■'));
+ L.push('bright '+c('bright-black','■')+c('bright-red','■')+c('bright-green','■')+c('bright-yellow','■')+c('bright-blue','■')+c('bright-magenta','■')+c('bright-cyan','■')+c('bright-white','■'));
+ return previewLines(L);}
function renderGhostelPreview(){const a='ghostel',L=[],d=t=>os(a,'ghostel-default',t);
// Literal face names (the coverage gate matches verbatim, not constructed):
const COLOR={black:'ghostel-color-black',red:'ghostel-color-red',green:'ghostel-color-green',
@@ -3812,6 +3841,7 @@ const PACKAGE_PREVIEWS={
tmr:renderTmrPreview,wttrin:renderWttrinPreview,alert:renderAlertPreview,
orgsuperstar:renderOrgSuperstarPreview,nerdiconscompletion:renderNerdIconsCompletionPreview,
ghostel:renderGhostelPreview,alltheicons:renderAllTheIconsPreview,
+ ansicolor:renderAnsiColorPreview,
erc:renderErcPreview,orgdrill:renderOrgdrillPreview,orgnoter:renderOrgnoterPreview,signel:renderSignelPreview,
pearl:renderPearlPreview,slack:renderSlackPreview,telega:renderTelegaPreview,shr:renderShrPreview,
nerdicons:renderNerdIconsPreview