diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-13 16:08:13 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-13 16:08:13 -0500 |
| commit | b88d7cb0ac5009736aa0998f3ea2933050c55b76 (patch) | |
| tree | aa756de19ddc9a63dc7858fcaac202babed07477 /scripts/theme-studio/test-columns.mjs | |
| parent | 547dc4eb5194a524a4738bdb4f2b1c36591c884b (diff) | |
| download | dotemacs-b88d7cb0ac5009736aa0998f3ea2933050c55b76.tar.gz dotemacs-b88d7cb0ac5009736aa0998f3ea2933050c55b76.zip | |
Group numeric color names by stem
Diffstat (limited to 'scripts/theme-studio/test-columns.mjs')
| -rw-r--r-- | scripts/theme-studio/test-columns.mjs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/theme-studio/test-columns.mjs b/scripts/theme-studio/test-columns.mjs index 6079966a..ab88cb73 100644 --- a/scripts/theme-studio/test-columns.mjs +++ b/scripts/theme-studio/test-columns.mjs @@ -57,6 +57,14 @@ test('columnsFromPalette: Boundary - explicit color-N column ids are preserved', assert.deepEqual(columns[0].members.map(m => m.name), ['color-22', 'color-23']); }); +test('columnsFromPalette: Boundary - external numeric color names group by text stem', () => { + const pal = [['#0000ee', 'blue1'], ['#0000cd', 'blue2'], ['#bebebe', 'grey80'], ['#c0c0c0', 'grey81'], ['#cd69c9', 'orchid3']]; + const { columns } = columnsFromPalette(pal, { bg: '#000000', fg: '#ffffff' }); + assert.deepEqual(columns.map(f => f.column), ['blue', 'grey', 'orchid']); + assert.deepEqual(columnOf(columns, 'blue1').members.map(m => m.name), ['blue1', 'blue2']); + assert.deepEqual(columnOf(columns, 'grey80').members.map(m => m.name), ['grey80', 'grey81']); +}); + test('columnsFromPalette: Normal - palette order controls column order', () => { const pal = [['#67809c', 'blue'], ['#e8bd30', 'gold'], ['#5d9b86', 'green']]; const { columns } = columnsFromPalette(pal, { bg: '#000000', fg: '#ffffff' }); |
