Skip to content

Instantly share code, notes, and snippets.

@thomasbnt
Last active April 8, 2024 21:25
Show Gist options
  • Save thomasbnt/b6f455e2c7d743b796917fa3c205f812 to your computer and use it in GitHub Desktop.
Save thomasbnt/b6f455e2c7d743b796917fa3c205f812 to your computer and use it in GitHub Desktop.
Code colors for embed discord.js

Here is an updated list of the colors that are currently implemented with a name. To using colors on discord.js, this is a typedef Colors, Colors.Aqua to get the Aqua color.

Name Int value Hex Code
Default 0 #000000
Aqua 1752220 #1ABC9C
DarkAqua 1146986 #11806A
Green 5763719 #57F287
DarkGreen 2067276 #1F8B4C
Blue 3447003 #3498DB
DarkBlue 2123412 #206694
Purple 10181046 #9B59B6
DarkPurple 7419530 #71368A
LuminousVividPink 15277667 #E91E63
DarkVividPink 11342935 #AD1457
Gold 15844367 #F1C40F
DarkGold 12745742 #C27C0E
Orange 15105570 #E67E22
DarkOrange 11027200 #A84300
Red 15548997 #ED4245
DarkRed 10038562 #992D22
Grey 9807270 #95A5A6
DarkGrey 9936031 #979C9F
DarkerGrey 8359053 #7F8C8D
LightGrey 12370112 #BCC0C0
Navy 3426654 #34495E
DarkNavy 2899536 #2C3E50
Yellow 16776960 #FFFF00

Official Discord color palette

Name Int value Hex Code
White (Default) 16777215 #FFFFFF
Greyple 10070709 #99AAb5
Black 2303786 #23272A
DarkButNotBlack 2895667 #2C2F33
NotQuiteBlack 2303786 #23272A
Blurple 5793266 #5865F2
Green 5763719 #57F287
Yellow 16705372 #FEE75C
Fuchsia 15418782 #EB459E
Red 15548997 #ED4245

Other role colors

Name Int value Hex Code
Unnamed role color 1 6323595 #607D8B
Unnamed role color 2 5533306 #546E7A
Background black color 3553599 #36393F

Unnamed colors


✨ Don't hesitate to follow me on GitHub, also sponsoring me on GitHub.

Sponsors are people who support the development of this project. If you want to support me, you can do it by clicking on the button below.

GitHub Sponsors

Sponsors

@Resoki
Copy link

Resoki commented Oct 13, 2021

You can use 'RANDOM' too ;)

@thomasbnt
Copy link
Author

thomasbnt commented Oct 13, 2021

You can use 'RANDOM' too ;)

Yep of course!

Updated file, thanks ;)

Copy link

ghost commented Jan 22, 2022

tysm

@phil-flip
Copy link

phil-flip commented Sep 1, 2022

Hey. I thought I just let you know that colors in Discord.JS v14 have changed to lowercase.
So ex. "GREEN" becomes "Green" or "ORANGE" is now "Orange".

After testing around, unfortunately all colors need to be changed as sometimes it doesn't work, or it will use a different color... Which is kinda strange to happen.

@insomnia-creator
Copy link

that's just inconvenient, this was a useless change.

@phil-flip
Copy link

IK... the whole v14 update is unnecessary. Changed many things that they also just could leave untouched. This also made parts of the documentation completely unreadable and difficult to understand. I'm not even using it anymore and just go straight to the guide or the upgrade page from v13 to 14

@thomasbnt
Copy link
Author

IK... the whole v14 update is unnecessary. Changed many things that they also just could leave untouched. This also made parts of the documentation completely unreadable and difficult to understand. I'm not even using it anymore and just go straight to the guide or the upgrade page from v13 to 14

@FlipperLP And I thank those who made the migration guides! 😄

@phil-flip
Copy link

IK... the whole v14 update is unnecessary. Changed many things that they also just could leave untouched. This also made parts of the documentation completely unreadable and difficult to understand. I'm not even using it anymore and just go straight to the guide or the upgrade page from v13 to 14

@FlipperLP And I thank those who made the migration guides! 😄

Yea most defiantly! But I think it's also those that are making the upgrades themselves.

@thomasbnt
Copy link
Author

thomasbnt commented Sep 1, 2022

This Gist was updated due to the release of Discord.js v14 😄🌱

@phil-flip
Copy link

Nice! Thank you ^^

@ERICA-04
Copy link

You can use 'RANDOM' too ;)

hot to use the random? i kept gettin and error -- TypeError [ColorConvert]: Unable to convert color to a number.

@Resoki
Copy link

Resoki commented Sep 24, 2022

You can use 'RANDOM' too ;)

hot to use the random? i kept gettin and error -- TypeError [ColorConvert]: Unable to convert color to a number.

Because Its DJS14 now ^^

@thomasbnt
Copy link
Author

You can use 'RANDOM' too ;)

hot to use the random? i kept gettin and error -- TypeError [ColorConvert]: Unable to convert color to a number.

Because Its DJS14 now ^^

Yes @Resoki, random was removed. Thanks for tell me this modification.
@ERICA-04 you can create a function to have a random color in your embeds messages.

@insomnia-creator
Copy link

Why was 'RANDOM' removed? Any idea?

@thomasbnt
Copy link
Author

Why was 'RANDOM' removed? Any idea?

RANDOM was a good idea but d.js maintainers really like changing all good choices.

@sirlupusdev
Copy link

As a note:
If you use discord.js' Embed Builder (and not @discordjs/builder), you're actually able to use hex colors, colour names or rgb values. However, the names are not completely uppercase anymore, just capitalised (for example, Random instead of RANDOM).

Source: https://discord.js.org/#/docs/discord.js/main/class/EmbedBuilder
ColorResolvable and List of Colours: https://discord.js.org/#/docs/discord.js/main/typedef/ColorResolvable

@HEPOSHEIKKI
Copy link

Does anyone happen to know where I could find an article or such about using what logic exactly are the colors converted to an int?

Cheers!

@thomasbnt
Copy link
Author

thomasbnt commented Sep 14, 2023

Does anyone happen to know where I could find an article or such about using what logic exactly are the colors converted to an int?

Cheers!

Hello @HEPOSHEIKKI ! You can see this page about logic and converting hexa to int or also this page "Hexadecimal to Decimal Converter"

@HEPOSHEIKKI
Copy link

Does anyone happen to know where I could find an article or such about using what logic exactly are the colors converted to an int?
Cheers!

Hello @HEPOSHEIKKI ! You can see this page about logic and converting hexa to int or also this page "Hexadecimal to Decimal Converter"

Thanks

@theace13
Copy link

theace13 commented Oct 21, 2023

TypeError [ColorConvert]: Unable to convert color to a number.
at resolveColor (C:\Users\user\Documents\Nmybot\node_modules\discord.js\src\util\Util.js:289:63)
at EmbedBuilder.setColor (C:\Users\user\Documents\Nmybot\node_modules\discord.js\src\structures\EmbedBuilder.js:23:36)
at Object.createEmbed (C:\Users\user\Documents\Nmybot\modules\utility.js:20:15)
at exports.run (C:\Users\user\Documents\Nmybot\commands\Owner\setup.js:37:25)
at C:\Users\user\Documents\Nmybot\events\interactionCreate.js:41:35
at Array.forEach ()
at module.exports (C:\Users\user\Documents\Nmybot\events\interactionCreate.js:36:20)
at Client.emit (node:events:514:28)
at InteractionCreateAction.handle (C:\Users\user\Documents\Nmybot\node_modules\discord.js\src\client\actions\InteractionCreate.js:97:12)
at module.exports [as INTERACTION_CREATE] (C:\Users\user\Documents\Nmybot\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)

@thomasbnt
Copy link
Author

[-] Error has been issued: Unable to convert color to a number.

Hello, any more informations about your error?

@theace13
Copy link

what

@thomasbnt
Copy link
Author

@theace13 Thanks Lidor for your report. But I can't help with your error, especially for what you're going to do with it.

@theace13
Copy link

why can not you?

@thomasbnt
Copy link
Author

why can not you?

Just updated the doc, but for your information, a Nitro sniper is not legal and against ToS of Discord.

@theace13
Copy link

i know..

@theace13
Copy link

It's just a bot like these fake detection

@theace13
Copy link

so you can pls help me?

@thomasbnt
Copy link
Author

so you can pls help me?

I already helped you. See the doc.

@hextodec
Copy link

hextodec commented Nov 2, 2023

You can also use our tool, Hexa to Decimal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment