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 {