VulCode

Discord role colour

Pick a colour and get the decimal number the Discord API expects.

Category
Discord
Price
free

The tool starts in your browser.

Everything is calculated in your browser. Nothing you type is sent to our server.

How to use it in three steps

The tool as a schematic with this page's example. Each step's number stands where you take it: in the fields, at the result or outside the tool.

Discord role colour
What you enter
#414df2
  1. Pick a colour or type a hex code.

What you get
4279794
  1. Read the decimal number.

The color field in the API or an embed
  1. Paste it into the color field in the API or an embed.

Six colours turned into a number for the API

Discord stores a role colour as one RGB number: red times 65536, green times 256, plus blue. The expected column works it out straight from the channels.

ColourExpectedWhat the tool returnsResult
Colour#414df2the example from the tool's description
Expected65 × 65536 + 77 × 256 + 242 = 4279794
What the tool returns4279794
As expected
Colour#5865f2the blue of the Discord logo
Expected88 × 65536 + 101 × 256 + 242 = 5793266
What the tool returns5793266
As expected
Colour#ff0000the red channel alone
Expected255 × 65536 + 0 × 256 + 0 = 16711680
What the tool returns16711680
As expected
Colour#ffffffthe largest possible value
Expected255 × 65536 + 255 × 256 + 255 = 16777215
What the tool returns16777215
As expected
Colour#000001a black that stays a colour
Expected0 × 65536 + 0 × 256 + 1 = 1
What the tool returns1
As expected
Colour#000000for a role, 0 means no colour
Expected0 × 65536 + 0 × 256 + 0 = 0
What the tool returns0
As expected

6 of 6 cases as expected

Where the role colour shows

Discord stores a colour as one RGB integer, so #414df2 and 4279794 are the same value. A role in this colour paints the name in the member list and on every message.

Questions