Skip to content

Colour Strings

MCSulphate edited this page Jan 31, 2024 · 3 revisions

What is a Colour String?

In ChatColor, many of the features use Colour Strings to represent a player's colour. This page will help you understand the different types of Colour Strings and how to write them correctly.

Colour Strings use a combination of the & symbol, colour identifiers such as a, 4, and %red-gradient, and modifier identifiers such as l, m, and k.

Where are they Used?

They are used in /chatcolor custom add, /chatcolor group add, and /chatcolor set default-color.

Additionally, they are saved to the config files for these commands, as well as player config files if you are using them.

If you want to use colour codes in your message directly without setting your chat colour, then you need to use them in chat, like so:
&a&lHello World!

Note: Using rainbows & gradients is not supported directly in chat messages at the moment.

Types of Colours

The five types of colours in ChatColor are as follows:

  • Legacy Colours (0, 1, a, b, etc.)
  • Hex Colours (#123abc, #38f2c2, etc.)
  • Rainbow Colours (u[a,b,c], u[#123456,#abcdef], u[a,#123456,4,#abcdef], etc.)
  • Gradient Colours (g[a,b,c], g[#123456,#abcdef], g[a,#123456,4,#abcdef], etc.)
  • Custom Colours (%red-gradient, %bright-rainbow, etc.)

Informational Links:
Legacy Colour & Modifier Codes
Hex Colour Picker
Custom Colours Info

Writing Colour Strings

Using the information above about colours, you can write Colour Strings by combining exactly one colour with the & symbol, and then any number of modifiers all with a & symbol before them, with no spaces.

Examples
&a&l&n - Bright green, bold, and underlined
&#00ff00&l - Green and bold (hex version)
&u[a,b,c,d] - A rainbow of bright green, aqua, bright red, and magenta.