Note: ^K means I'm referring to CTRL+K.
mIRC only accepts colors ^K00 through ^K15, as actual colors. However, you can still use ^K16 through ^K99, newer versions of mIRC will ignore these color codes. While older versions, as mentioned above, will just reuse the 00-15 colors over and over again.
A few things to keep in mind, if you're writing your own IRC client and want it to be completely compatible with mIRC's control codes.
^O, terminates all other control codes.
^B, signifies bold. Only ends when another ^B or ^O terminates it.
^U, signifies underline. It's just like bold. Only ^U and ^O terminate it.
^R, signifies reverse. This swaps your channels 'foreground' and 'background' colors. This overwrites any ^K color control on the screen. Meaning if a ^K starts inside of a ^R area, you have to stop it from displaying on your screen.
^K has several ways to be used: ^K# -- ^K## -- ^K#,# -- ^K##,# -- ^K#,## -- ^K##,## ...
Please note that by using ^K##,## Text1 ^K## Text2
The "Text2" will still have the same 'background color' that you set for "Text1," even though the foreground color was changed. The background color will not end until either the background color changes, or, the color is terminated with ^O or a plain ^K with no foreground numbers specified.
Foreground color is terminated upon ^O or a plain ^K. Also is obviously terminated when a new foreground color is set.
Lastly, you can always make up your own color system. However, you may want to strip your own color codes out of your text, before allowing the client to send it to the server.