When sending color codes `0—9`, clients may use either the one-digit `(3)` or two-digit `(03)` versions of it. However,
since two digits are always used if available, if the text following the color code starts with a digit, the last
`<COLOR>` MUST use the two-digit version to be displayed correctly. This ensures that the first character of the text
does not get interpreted as part of the formatting code.
If the text immediately following a code setting a foreground color consists of something like `",13"`, it will get
interpreted as setting the background rather than text. In this example, clients can put the color code either after the
comma character or before the character in front of the comma character to avoid this. They can also put a different
formatting code after the comma to ensure that the number does not get interpreted as part of the color code (for
instance, two bold characters in a row, which will cancel each other out as they are toggles).
### Hex Color
`ASCII 0x04`
Some clients support an alternate form of conveying colors using hex codes.
Following this character are six hex digits representing the Red, Green and Blue values of the color to display (e.g.
`FF0000` means <span style="color:#ff0000">bright red</span>).
Keep the [Forms of Color Codes](#forms-of-color-codes) section above in mind, as this method of formatting keeps these
same rules – the exceptions being that `<CODE>` represents the hex color character `(0x04)` and `<COLOR>` represents a
six-digit hex value as `RRGGBB`.
This method of formatting is not as widely-supported as the colors above, but clients are fine to parse them without any
negative effects.
### Reverse Color
`ASCII 0x16`
This formatting character works as a toggle. When reverse color is enabled, the foreground and background text colors
are reversed. For instance, if you enable reverse color and then send the line
"<spanclass="reverse">C</span>3,13Test!", you will end up with pink foreground text and green background text while the
reverse color is in effect.
This code isn't super well-supported, and mIRC seems to always treat it as applying the reverse of the default
foreground and background characters, rather than the current fore/background as set by prior mIRC color codes in the
message.
### Reset
`ASCII 0x0F`
This formatting character resets all formatting. It removes the bold, italics, and underline formatting, and sets the
foreground and background colors back to the default for the client display. The text following this character will use
or display no formatting, until other formatting characters are encountered.
---
## Examples
In this section, the color formatting character `(0x03)` is displayed as <spanclass="reverse">C</span>, the bold
character `(0x02)` is displayed as <spanclass="reverse">B</span>, the italics character `(0x1D)` is displayed as
<spanclass="reverse">I</span>, and the reset character `(0x0F)` is displayed as <spanclass="reverse">O</span>.
Each example displays both the raw IRC code sent, and then a formatted version of the output.
| Code: | <tt>I love <spanclass="reverse">C</span>3IRC! <spanclass="reverse">C</span>It is the <spanclass="reverse">C</span>7best protocol ever!</tt> |
| ------- | - |
| Output: | <tt>I love <spanirc_foreground=3>IRC! </span>It is the <spanirc_foreground=7>best protocol ever!</span></tt> |
| Code: | <tt>This is a <spanclass="reverse">I</span><spanclass="reverse">C</span>13,9cool <spanclass="reverse">C</span>message</tt> |
| ------- | - |
| Output: | <tt>This is a <spanirc_italic><spanirc_foreground=13irc_background=9>cool </span>message</span></tt> |
| Code: | <tt>Rules: Don't spam 5<spanclass="reverse">C</span>13,8,6<spanclass="reverse">C</span>,7,8, and especially not <spanclass="reverse">B</span>9<spanclass="reverse">B</span><spanclass="reverse">I</span>!</tt> |
| ------- | - |
| Output: | <tt>Don't spam 5<spanirc_foreground=13irc_background=8>,6</span>,7,8, and especially not <spanirc_bold>9</span><spanirc_italic>!</span></tt> |