From 55b80c4f939e62c1b5bf466ebc5bd7eada7a7141 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 21 Jul 2017 10:36:15 +0200 Subject: [PATCH] Improved colourmap visibility --- scripts/logo.js | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/scripts/logo.js b/scripts/logo.js index d842a0e7afe2..5bfd53c8e330 100644 --- a/scripts/logo.js +++ b/scripts/logo.js @@ -25,35 +25,38 @@ const mono = ` `; const chalkMap = { - P: '\\033[38;5;176m', - M: '\\033[38;5;211m', - W: '\\033[38;5;231m', - B: '\\033[38;5;111m', - G: '\\033[38;5;150m', - R: '\\033[38;5;210m', - m: '\\033[38;5;211m', - l: '\\033[38;5;225m', - O: '\\033[38;5;215m', - ' ': '', + '▓': () => '\\033[38;5;176m', + '▒': () => '\\033[38;5;211m', + '.': () => '\\033[38;5;231m', + B: () => '\\033[38;5;111m', + '₯': () => '\\033[38;5;150m', + R: () => '\\033[38;5;210m', + m: () => '\\033[38;5;211m', + l: () => '\\033[38;5;225m', + O: () => '\\033[38;5;215m', + Z: () => '\\033[38;5;232m', + ' ': () => '\\033[38;5;16m', + '?': () => `\\033[38;5;${Math.floor(Math.random() * 255) + 1}m`, }; const colourmap = ` -PPMMMMMMMMMMMWWMM -PPMMMMMMMMMMMllMM -PPMMMMlWWWWWmMMMM OOO RRR PPP -PPMMMlWWWMmWWmMMM OOOOO GGGG PP BB RRRRR BBB GGG PPP P -PPMMMMWWWlmMMMMMM OOOOOOGGGGGGG PPPPPBBB BB RRRRRRR BBBBBBB GGGGGGG PPPPPPPP -⠀PMMMMMmlWWWWMMMM OO GGG GGG PPP BBB BB RR RRRBBB BBB GGG GGG PPPPPP - PMMMWWWmMlWWWMMM OO GGGGGGG PP BBBBBBB RRRRRRR BBBBBBB GGGGGGG PPPPPPPP - PMMMMlWWWWWlMMMM OO GGGG PP BB BBB RR RR BBBB GGGG PPP PPP - PMMMMMMMMMMMMMMM BBBBBB - PMMMMMMMMMMMMMMM +▓▓▒▒▒▒▒▒▒▒▒▒▒..▒▒ +▓▓▒▒▒▒▒▒▒▒▒▒▒ll▒▒ +▓▓▒▒▒▒l.....▒▒▒▒▒ OOO RRR ▓▓▓ +▓▓▒▒▒l...▒▒..▒▒▒▒ OOOOO ₯₯₯₯ ▓▓ BB RRRRR BBB ₯₯₯ ▓▓▓ ▓ +▓▓▒▒▒▒...l▒▒▒▒▒▒▒ OOOOOO₯₯₯₯₯₯₯ ▓▓▓▓▓BBB BB RRRRRRR BBBBBBB ₯₯₯₯₯₯₯ ▓▓▓▓▓▓▓▓ + ▓▒▒▒▒▒▒l....▒▒▒▒ OO ₯₯₯ ₯₯₯ ▓▓▓ BBB BB RR RRRBBB BBB ₯₯₯ ₯₯₯ ▓▓▓▓▓▓ + ▓▒▒▒...▒▒l...▒▒▒ OO ₯₯₯₯₯₯₯ ▓▓ BBBBBBB RRRRRRR BBBBBBB ₯₯₯₯₯₯₯ ▓▓▓▓▓▓▓▓ + ▓▒▒▒▒l.....l▒▒▒▒ OO ₯₯₯₯ ▓▓ BB BBB RR RR BBBB ₯₯₯₯ ▓▓▓ ▓▓▓ + ▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ BBBBBB + ▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `.split(''); const result = coloured.split('').map((char, index) => { const colorKey = colourmap[index]; - const colorPrefix = chalkMap[colorKey] || ''; - return colorPrefix + char; + const colorPrefix = chalkMap[colorKey] ? chalkMap[colorKey]() : ''; + const isSpace = colorKey === ' '; + return colorPrefix + (isSpace ? '⠀' : char); }); const exec = require('child_process').exec;