mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2007
Posts: 34
C
cygnusx Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Jan 2007
Posts: 34
Hey,can you tell me which colors mIRC can accept.I'm asking that because i'm deleoping an IRC client...what if i send color code(with the text message)which is not supported by mIRC(or other clients),or...as far as i know in some channels it's not allowed to send colored text,and then the message is just not send to the channel!!!How can i determine whether the channel can accept colored text?

Last edited by cygnusx; 22/03/07 12:18 PM.
Joined: Jan 2003
Posts: 1,063
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
checking if a channel accepts coloured text is a bit hard because the channel mode isn't the same for all server software. sometimes it's +C, +c or +S or something totally different.

you can always notice by the error reply you get if the message was indeed blocked...

next to that: mIRC only supports the normal 16 colours available for IRC. as you can see when using mIRC yourself, it sends the colour in the format of ascii code 3 followed by a number (0-15).
the actual display colour is not directly defined since users can change that in their own client but check out the defaults mIRC has.

it's best to stick with those 16 colours because you will be sure almost all clients will be able to understand that.


If it ain't broken, don't fix it!
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
That said, mIRC will "loop" the colors up to 99. 16 is 0, 17 is 1, 18 is 2, etc.

So, you could create a client with more colors, but you'd have to remember that those will be "translated" into whatever color the mIRC user has for the looped number. If you were to try that method, I'd recommend having the colors be shades of the looped color. Example: Color 3 in mIRC is dark green. If you want to have color 19 (this would be color 3 in mIRC) be another color, I'd recommend that you keep it a shade of dark green. That way, it will at least look similar to what you intended rather than completely different.


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
From v6.11 onwards mIRC no longer rotates through colours greater than 15, they're all treated as black.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Oh. Ignore my post. I guess I should have checked to see if it still worked. Oops. blush


Invision Support
#Invision on irc.irchighway.net
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
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.

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
^K99 does have meaning to mIRC. It is treated as the default colour for the foreground/background (depending on where it's used). I think some other clients support this too.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
Well yes.. It's going to revert to the default text color for whatever event you are using.

echo -ac action ^K99 Test, is going to be in whatever color your action is.

I'm not saying it's a termination color code. However it can work to terminate another foreground color. Just as ^K05 would terminate another color and then begin a new one.

My 'theory' is that the actual code (in C++) recognizes ^K99 as the start of a new color, and will end any other foreground color that came before it. However, it does not have a specific color assigned to it, so my guess is that he's not inputting the start of a new color.

You can't actually prove me wrong on this unless you've seen the source code of course. smile Because what you're saying is really no different than what I'm saying. I think it'd be easier to not draw a foreground color at all, than to 'layer' the line's default foreground color on top of the text when it's not needed.

But what do I know. :P


Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Well what I meant was that ^K99 has always had this behaviour, unlike ^K16-98, and this behaviour is emulated in some other IRC clients which may treat ^K16-98 differently (ie. as additional colours), so it's important that any IRC client developers implementing the colour scheme realise that if they want to plow ahead and use additional colours for numbers >16 they should still treat ^K99 as a "return to default" instead of trying to make it a specific colour.


Spelling mistakes, grammatical errors, and stupid comments are intentional.

Link Copied to Clipboard