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

@aziznatour
Copy link

Hello thx but what is the code color @aziznatour ?

#FD0061 and the dark one is #BC0057

@thomasbnt
Copy link
Author

Is updated! thx again @aziznatour !

@Rex8217
Copy link

Rex8217 commented Dec 28, 2019

Heres a website that can convert them! You go to the Decimal Numbers and then copy. https://convertingcolors.com/

@thomasbnt
Copy link
Author

Yeep thx @Rex8217

@norioffical
Copy link

tysm

@AquaBucket
Copy link

nice color codes

@Militia21
Copy link

How do you put the colours though? Do you do 00fx before the tag?

@thomasbnt
Copy link
Author

What this @Militia21 for a example of using colors in embeds

https://leovoel.github.io/embed-visualizer/

@BSweet16
Copy link

BSweet16 commented Sep 17, 2020

@Militia21 You could just a system with enumerators such as this, where card colors are in an enumerated list. The function listed afterwards could then just be given a title, message body, and card color from the enumerator.
(Such as:
displayMessage('Success', 'Congratulations, this worked correctly.', cardColors.green);
displayMessage('Warning', 'This is not the worst thing in the world.', cardColors.yellow);
displayMessage('Error', 'Something went wrong... You should be ashamed...', cardColors.red);)

Enumerator:
enum cardColors{ red = '#FD0061', green = '#008E44', yellow = '#F8C300' }

Example Template:
function displayMessage (title: string = '', content: string = '', cardColor: string = cardColors.green){ let newMessage = { "embed": { "color": cardColor, "fields": [ { "name": ${title}, "value": ${content}, "inline": false } ] } }; message.channel.send(newMessage); }

@yasserprogamer
Copy link

nice you help me so much

@insomnia-creator
Copy link

Life savior here mate

@imacodr
Copy link

imacodr commented Nov 7, 2020

Thanks! Really helped.

@Leslato
Copy link

Leslato commented Nov 12, 2020

Thanks!

@MrlolDev
Copy link

https://htmlcolorcodes.com all the colors here

@Blessedwasnotfat
Copy link

Blessedwasnotfat commented Dec 1, 2020

there's also 'RANDOM' which does exactly what you think it does.... i actually had to do this the somewhat more difficult way which was doing Math.floor(Math.random() * 16777214) + 1

@thomasbnt
Copy link
Author

Of course, any color can be used. Thanks @Blessedwasnotfat for your message 🕺☕

@Starkiller4011
Copy link

Starkiller4011 commented Jan 14, 2021

Has anyone managed to get a proper white? I tried using #FFFFFF as well as rgb(255, 255, 255) and what I end up getting on my embeds is a weird grey. If I use #FFFFFD, rgb(255, 255, 253), I get an off-white but for some reason #FFFFFF gives grey lol

@decabitrunner
Copy link

It is so helpful thanks

@real2two
Copy link

real2two commented Mar 1, 2021

Has anyone managed to get a proper white? I tried using #FFFFFF as well as rgb(255, 255, 255) and what I end up getting on my embeds is a weird grey. If I use #FFFFFD, rgb(255, 255, 253), I get an off-white but for some reason #FFFFFF gives grey lol

same thing happening to me now

EDIT: 16777214 seems to work.

@Olympic1
Copy link

Olympic1 commented Mar 7, 2021

Here is an updated list of the colors that are currently implemented with a name

Name Int value Hex Code
DEFAULT 0 #000000
AQUA 1752220 #1ABC9C
DARK_AQUA 1146986 #11806A
GREEN 3066993 #2ECC71
DARK_GREEN 2067276 #1F8B4C
BLUE 3447003 #3498DB
DARK_BLUE 2123412 #206694
PURPLE 10181046 #9B59B6
DARK_PURPLE 7419530 #71368A
LUMINOUS_VIVID_PINK 15277667 #E91E63
DARK_VIVID_PINK 11342935 #AD1457
GOLD 15844367 #F1C40F
DARK_GOLD 12745742 #C27C0E
ORANGE 15105570 #E67E22
DARK_ORANGE 11027200 #A84300
RED 15158332 #E74C3C
DARK_RED 10038562 #992D22
GREY 9807270 #95A5A6
DARK_GREY 9936031 #979C9F
DARKER_GREY 8359053 #7F8C8D
LIGHT_GREY 12370112 #BCC0C0
NAVY 3426654 #34495E
DARK_NAVY 2899536 #2C3E50
YELLOW 16776960 #FFFF00

Official Discord color palette

Name Int value Hex Code
WHITE 16777215 #FFFFFF
BLURPLE 7506394 #7289DA
GREYPLE (Default) 10070709 #99AAB5
DARK_BUT_NOT_BLACK 2895667 #2C2F33
NOT_QUITE_BLACK 2303786 #23272A

Other role colors

Name Int value Hex Code
Unnamed role color 1 6323595 #607D8B
Unnamed role color 2 5533306 #546E7A

Unnamed colors

@thomasbnt
Copy link
Author

Thanks @Olympic1, I updated the file !

@SynergyBest
Copy link

life saver, thank you so much!

@Tomtom-Skywalker
Copy link

If This Is Still Being Maintained The Embed Its Self's Colour (The Part Where The Txt Goes) is #2F3136 the RGB 47,49,54 Name Is Unknown

@Starnamics
Copy link

Embed Color: #2F3136 (Useful if you want embeds without the color)

@thomasbnt
Copy link
Author

Embed Color: #2F3136 (Useful if you want embeds without the color)

@Starnamics yeep pretty nice embed !

@nlssn
Copy link

nlssn commented Jun 7, 2021

Here are the colors from the new branding guidelines announced on May 14th 2021.
The new color called "Blurple" has replaced #7289DA (which is now referred to as "OG Blurple").

Name                             | Int value | Hex code
---------------------------------|-----------|----------
`BLURPLE`                        | 5793266   | `#5865F2`
`GREEN`                          | 5763719   | `#57F287`
`YELLOW`                         | 16705372  | `#FEE75C`
`FUSCHIA`                        | 15418782  | `#EB459E`
`RED`                            | 15548997  | `#ED4245`
`WHITE`                          | 16777215  | `#FFFFFF`
`BLACK`                          | 2303786   | `#23272A`

@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