From 74ce1de432cf8a205d1efc15838775d69155d14d Mon Sep 17 00:00:00 2001 From: cpsdqs Date: Sun, 8 Oct 2017 12:03:25 +0200 Subject: [PATCH] Make themes.toHex use getColor, ensure .selectable --- js/term/screen.js | 2 +- js/term/themes.js | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/js/term/screen.js b/js/term/screen.js index 3e351de..f8d7b89 100644 --- a/js/term/screen.js +++ b/js/term/screen.js @@ -92,7 +92,7 @@ module.exports = class TermScreen extends EventEmitter { this.selection = { // when false, this will prevent selection in favor of mouse events, // though alt can be held to override it - selectable: true, + selectable: null, // selection start and end (x, y) tuples start: [0, 0], diff --git a/js/term/themes.js b/js/term/themes.js index 5c65533..ea0feb8 100644 --- a/js/term/themes.js +++ b/js/term/themes.js @@ -145,10 +145,7 @@ exports.getColor = function (i, palette = []) { exports.toHex = function (shade, themeN) { if (/^\d+$/.test(shade)) { shade = +shade - if (shade < 16) shade = themes[themeN][shade] - else { - shade = exports.buildColorTable()[shade] - } + return exports.getColor(shade, themes[themeN]) } return shade }