misc.color: attempt fix

This commit is contained in:
Cynthia Foxwell 2023-04-26 18:37:19 -06:00
parent f971240c03
commit 295369bbc9
1 changed files with 37 additions and 32 deletions

View File

@ -628,6 +628,42 @@ color.callback = async function (msg, line, args, {truerandom}) {
.toBuffer();
const fileName = `${color.toHex()}.png`;
const fields = [
{
name: "Hex",
value: color.toHexString(),
inline: true,
},
{
name: "RGB",
value: color.toRgbString(),
inline: true,
},
{
name: "HSL",
value: color.toHslString(),
inline: true,
},
{
name: "HSV",
value: color.toHsvString(),
inline: true,
},
{
name: "Integer",
value: color.toNumber(),
inline: true,
},
];
if (color.toName() != false) {
fields.splice(0, 0, {
name: "Name",
value: color.toName(),
inline: true,
});
}
return {
embeds: [
{
@ -636,38 +672,7 @@ color.callback = async function (msg, line, args, {truerandom}) {
thumbnail: {
url: `attachment://${fileName}`,
},
fields: [
color.toName() && {
name: "Name",
value: color.toName(),
inline: true,
},
{
name: "Hex",
value: color.toHexString(),
inline: true,
},
{
name: "RGB",
value: color.toRgbString(),
inline: true,
},
{
name: "HSL",
value: color.toHslString(),
inline: true,
},
{
name: "HSV",
value: color.toHsvString(),
inline: true,
},
{
name: "Integer",
value: color.toNumber(),
inline: true,
},
].filter((f) => f != null),
fields,
},
],
file: {