From 1bef3d11a94c42e3952cecc0a39abfaee53749a0 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Wed, 31 Jul 2024 21:41:30 -0600 Subject: [PATCH] misc.color: oops oom --- src/modules/misc.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/misc.js b/src/modules/misc.js index 378d5db..3cb87ea 100644 --- a/src/modules/misc.js +++ b/src/modules/misc.js @@ -638,7 +638,6 @@ const colornamesMapped = colornamesRaw.map((line) => { return [hex, name]; }); const colornames = Object.fromEntries(colornamesMapped); -const colornamesFlipped = Object.fromEntries(colornamesMapped.reverse()); const color = new Command("color"); color.category = CATEGORY; @@ -653,7 +652,7 @@ color.callback = async function (msg, line, args, {truerandom}) { } if (!color.isValid) { - const colornamesHex = colornamesFlipped[line]; + const colornamesHex = Object.entries(colornames).find(([hex, name]) => name.toLowerCase().localeCompare(line))[0]; if (colornamesHex) { color = tinycolor(colornamesHex); } else {