misc.color: oops oom
This commit is contained in:
parent
3d7b918130
commit
1bef3d11a9
1 changed files with 1 additions and 2 deletions
|
@ -638,7 +638,6 @@ const colornamesMapped = colornamesRaw.map((line) => {
|
||||||
return [hex, name];
|
return [hex, name];
|
||||||
});
|
});
|
||||||
const colornames = Object.fromEntries(colornamesMapped);
|
const colornames = Object.fromEntries(colornamesMapped);
|
||||||
const colornamesFlipped = Object.fromEntries(colornamesMapped.reverse());
|
|
||||||
|
|
||||||
const color = new Command("color");
|
const color = new Command("color");
|
||||||
color.category = CATEGORY;
|
color.category = CATEGORY;
|
||||||
|
@ -653,7 +652,7 @@ color.callback = async function (msg, line, args, {truerandom}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!color.isValid) {
|
if (!color.isValid) {
|
||||||
const colornamesHex = colornamesFlipped[line];
|
const colornamesHex = Object.entries(colornames).find(([hex, name]) => name.toLowerCase().localeCompare(line))[0];
|
||||||
if (colornamesHex) {
|
if (colornamesHex) {
|
||||||
color = tinycolor(colornamesHex);
|
color = tinycolor(colornamesHex);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue