Skip to content
Java Edition Reference Docs MC:JE 1.21.5 | DP 71 | RP 55

Colour reference

RGB Colours

Minecraft has several ways of specifying colours. The 16 core colours are often the easiest way, but usually only available for things colourable in normal gameplay. Most technical systems require the use of one of several RGB formats, such as packed integers, channel percentage arrays, or the well-known Hex Colours.

Minecraft RGB Colour format converter

Colour format converter

Packed Integer format

Colour format converter

Minecraft sometimes represents colors using a packed integer format, where an RGB color is stored as a single decimal integer. This is achieved by encoding the Red, Green, and Blue (RGB) components into a 24-bit integer (0xRRGGBB in hex, or (R << 16) | (G << 8) | B in decimal).

Each color channel (Red, Green, and Blue) is an 8-bit value (0-255), which gets packed into a single integer using this formula:

Packed_Integer = (R << 16) | (G << 8) | B;
// `<<` is a left shift and `|` is a bitwise OR
Color NameRGB (R, G, B)Hex CodePacked Integer
Red(255, 0, 0)#FF000016711680
Green(0, 255, 0)#00FF0065280
Blue(0, 0, 255)#0000FF255
Pink(255, 0, 255)#FF00FF16711935

A colour converter tool is available above to make using these colours easier.

Channel percentages (array) format

Colour format converter

Things that use Minecraft’s array RGB colour format takes a 3-item array of floating point numbers between 0 and 1 (inclusive). Each of the three floats represents a percentage of Red, Green, and Blue respectively.

e.g.

[1.0, 0, 0.0] // Red
[0.475, 0.000, 0.631] // Purple
[0.427, 0.506, 0.588] // Slate grey

A colour converter tool is available above to make using these colours easier.

16 core colours

Commonly used in game for dyes and coloured blocks, these colours are also used in several technical areas, often where RGB colours aren’t. Examples include shields, banners, and text components.

  • white
  • orange
  • magenta
  • light_blue
  • yellow
  • lime
  • pink
  • gray
  • light_gray
  • cyan
  • purple
  • blue
  • brown
  • green
  • red
  • black