discordjs / discord.js

A powerful JavaScript library for interacting with the Discord API
https://discord.js.org
Apache License 2.0
25.36k stars 3.97k forks source link

ColorResolvable RGB array does not work properly #7405

Closed mohammadaboalnadar closed 2 years ago

mohammadaboalnadar commented 2 years ago

Which package is this bug report for?

discord.js

Issue description

https://discord.js.org/#/docs/discord.js/stable/typedef/ColorResolvable

I am making an embed with the color set to [45, 151, 299] but it shows the embed green when it should be blue image image image

Code sample

client.on('messageCreate', (message) => {
    const embed = new MessageEmbed()
    embed.setDescription(message.content)
    embed.setColor([45, 151, 299])

    message.reply({embeds: [embed]})
})

Package version

discordjs/rest@0.3.0 | discord.js@13.6.0

Node.js version

v17.4.0

Operating system

Windows 10

Priority this issue should have

Low

Which partials do you have configured?

Not applicable (subpackage bug)

Which gateway intents are you subscribing to?

Not applicable (subpackage bug)

I haven't tested this issue on a development release

I tried but it just breaks my whole bot

monbrey commented 2 years ago

RGB values lie in the range 0-255. Your 299 value for blue is not valid and is therefore being ignored, which would create green.

That color picker you're using is trash.

mohammadaboalnadar commented 2 years ago

I don't know how I never noticed that. Sorry for the issue.