Skip to content

Commit 273d6f7

Browse files
committed
Improved colourmap visibility
1 parent dab697b commit 273d6f7

1 file changed

Lines changed: 25 additions & 22 deletions

File tree

scripts/logo.js

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,38 @@ const mono = `
2525
`;
2626

2727
const chalkMap = {
28-
P: '\\033[38;5;176m',
29-
M: '\\033[38;5;211m',
30-
W: '\\033[38;5;231m',
31-
B: '\\033[38;5;111m',
32-
G: '\\033[38;5;150m',
33-
R: '\\033[38;5;210m',
34-
m: '\\033[38;5;211m',
35-
l: '\\033[38;5;225m',
36-
O: '\\033[38;5;215m',
37-
' ': '',
28+
'▓': () => '\\033[38;5;176m',
29+
'▒': () => '\\033[38;5;211m',
30+
'.': () => '\\033[38;5;231m',
31+
B: () => '\\033[38;5;111m',
32+
'₯': () => '\\033[38;5;150m',
33+
R: () => '\\033[38;5;210m',
34+
m: () => '\\033[38;5;211m',
35+
l: () => '\\033[38;5;225m',
36+
O: () => '\\033[38;5;215m',
37+
Z: () => '\\033[38;5;232m',
38+
' ': () => '\\033[38;5;16m',
39+
'?': () => `\\033[38;5;${Math.floor(Math.random() * 255) + 1}m`,
3840
};
3941

4042
const colourmap = `
41-
PPMMMMMMMMMMMWWMM
42-
PPMMMMMMMMMMMllMM
43-
PPMMMMlWWWWWmMMMM OOO RRR PPP
44-
PPMMMlWWWMmWWmMMM OOOOO GGGG PP BB RRRRR BBB GGG PPP P
45-
PPMMMMWWWlmMMMMMM OOOOOOGGGGGGG PPPPPBBB BB RRRRRRR BBBBBBB GGGGGGG PPPPPPPP
46-
⠀PMMMMMmlWWWWMMMM OO GGG GGG PPP BBB BB RR RRRBBB BBB GGG GGG PPPPPP
47-
PMMMWWWmMlWWWMMM OO GGGGGGG PP BBBBBBB RRRRRRR BBBBBBB GGGGGGG PPPPPPPP
48-
PMMMMlWWWWWlMMMM OO GGGG PP BB BBB RR RR BBBB GGGG PPP PPP
49-
PMMMMMMMMMMMMMMM BBBBBB
50-
PMMMMMMMMMMMMMMM
43+
▓▓▒▒▒▒▒▒▒▒▒▒▒..▒▒
44+
▓▓▒▒▒▒▒▒▒▒▒▒▒ll▒▒
45+
▓▓▒▒▒▒l.....▒▒▒▒▒ OOO RRR ▓▓▓
46+
▓▓▒▒▒l...▒▒..▒▒▒▒ OOOOO ₯₯₯₯ ▓▓ BB RRRRR BBB ₯₯₯ ▓▓▓ ▓
47+
▓▓▒▒▒▒...l▒▒▒▒▒▒▒ OOOOOO₯₯₯₯₯₯₯ ▓▓▓▓▓BBB BB RRRRRRR BBBBBBB ₯₯₯₯₯₯₯ ▓▓▓▓▓▓▓▓
48+
▓▒▒▒▒▒▒l....▒▒▒▒ OO ₯₯₯ ₯₯₯ ▓▓▓ BBB BB RR RRRBBB BBB ₯₯₯ ₯₯₯ ▓▓▓▓▓▓
49+
▓▒▒▒...▒▒l...▒▒▒ OO ₯₯₯₯₯₯₯ ▓▓ BBBBBBB RRRRRRR BBBBBBB ₯₯₯₯₯₯₯ ▓▓▓▓▓▓▓▓
50+
▓▒▒▒▒l.....l▒▒▒▒ OO ₯₯₯₯ ▓▓ BB BBB RR RR BBBB ₯₯₯₯ ▓▓▓ ▓▓▓
51+
▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ BBBBBB
52+
▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
5153
`.split('');
5254

5355
const result = coloured.split('').map((char, index) => {
5456
const colorKey = colourmap[index];
55-
const colorPrefix = chalkMap[colorKey] || '';
56-
return colorPrefix + char;
57+
const colorPrefix = chalkMap[colorKey] ? chalkMap[colorKey]() : '';
58+
const isSpace = colorKey === ' ';
59+
return colorPrefix + (isSpace ? '⠀' : char);
5760
});
5861

5962
const exec = require('child_process').exec;

0 commit comments

Comments
 (0)