Understanding Discord Colors
A deep dive into how Discord handles role and embed colors.
Color Formats in Discord
Depending on whether you are using the Discord Client, the API, or a bot library (like discord.js or discord.py), you will encounter three main color formats:
Hexadecimal (HEX)
Standard for web and the Discord desktop app. Hex codes like #5865F2 are 6-digit representations of Red, Green, and Blue values.
RGB (Red, Green, Blue)
A combination of three numbers ranging from 0 to 255. Most design tools use this format to define color intensity.
Discord Integer (Decimal)
The Discord API expects colors as raw 24-bit integers. For example, #5865F2 becomes 5793266. This is common when sending embeds via Webhooks or Bot code.
How to convert HEX to Integer?
If you want to do the math yourself: Convert the Hex code (e.g., 5865F2) to a decimal number. Our Color Picker tool does this automatically for you, ensuring you never get the "invalid color" error from the Discord API.
Pro Tip: Discord "Pure Black"
Discord does not allow roles to have the color #000000. If you set a role to pure black, it will default to the standard "No Color" (grey). To get a black role, use #010101 instead.