(Created page with "'''IRC Colors''' (or '''mIRC Colors''') is a light-weight sub-protocol designed to added support for various text formatting to IRC. The protocol usually supports ...") |
(→Color formatting: #FC7F00 is Orange, not Olive and changed Royal blue text color to #FFFFFF (better visibility)) |
||
(13 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
− | '''IRC Colors''' (or '''[[mIRC]] Colors''') is a light-weight [[sub-protocol]] designed to | + | {{irc title|Colors}}{{Internet Relay Chat Guide}} |
+ | '''IRC Colors''' (or '''[[mirc|mIRC]] Colors''') is a light-weight [[sub-protocol]] designed to add support for various text formatting to [[irc|IRC]]. The protocol usually supports foreground, background, bold, italics, underline, and reverse. | ||
== Overview == | == Overview == | ||
− | Text formatting is done via a set of special character sequences that are parsed by the IRC client. Every new text | + | Text formatting is done via a set of special character sequences that are parsed by the IRC client. Every new segment of text formats starts with one of the formatting control character. The same control character can be used at the end of the format in order to terminate it. The [[caret notation]] is used to represent such characters. For example, the ^B character is used to specify bold text. <code>^BHello World^B</code> will display on supported IRC client as <code>'''Hello World'''</code> |
+ | |||
+ | While originally designed to be exclusively client-side, over time servers have been updated to be made aware of color codes. Some servers support various channel modes to block colors, strip colors, and ban various patterns. The exact level of support depends on the server software used. | ||
=== Format characters === | === Format characters === | ||
Line 9: | Line 12: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! Format !! [[Code point]] !! [[keyboard shortcuts|Shortcuts]] | + | ! Format !! [[Code point]] !! [[keyboard shortcuts|Shortcuts]] !! Example |
|- | |- | ||
− | | Bold || 0x02 || {{Key|Ctrl|B}} / {{Key|Cmd|B}} | + | | Bold || 0x02 || {{Key|Ctrl|B}} / {{Key|Cmd|B}} || <code>^BAA^BBB^BCC^BDD</code> = <code>'''AA'''BB'''CC'''DD</code> |
|- | |- | ||
− | | Italics || 0x1D || {{Key|Ctrl|I}} / {{Key|Opt|Cmd|I}} | + | | Italics || 0x1D || {{Key|Ctrl|I}} / {{Key|Opt|Cmd|I}} || <code>^IAA^IBB^ICC^IDD</code> = <code>''AA''BB''CC''DD</code> |
|- | |- | ||
− | | Underline || 0x1F || {{Key|Ctrl|U}} / {{Key|Opt|Cmd|U}} | + | | Underline || 0x1F || {{Key|Ctrl|U}} / {{Key|Opt|Cmd|U}} || <code>^UAA^UBB^UCC^UDD</code> = <code>{{Underline|AA}}BB{{Underline|CC}}DD</code> |
|- | |- | ||
− | | Reverse || 0x16 || {{Key|Ctrl|R}} / {{Key|Opt|Cmd|R}} | + | | Reverse || 0x16 || {{Key|Ctrl|R}} / {{Key|Opt|Cmd|R}} || <code>^RAA^RBB^RCC^RDD</code> = <code><span style="background:black;color:white;">AA</span>BB<span style="background:black;color:white;">CC</span>DD</code> |
|- | |- | ||
− | | Plain || 0x0F || {{Key|Ctrl|O}} / {{Key|Opt|Cmd|O}} | + | | Plain || 0x0F || {{Key|Ctrl|O}} / {{Key|Opt|Cmd|O}} || <code>^I^B^UAAA^OBBB</code> = <code>'''''{{Underline|AAA}}'''''BBB</code> |
|} | |} | ||
+ | The plain text character is used to restore all formatting back to default. | ||
+ | |||
+ | === Color formatting === | ||
+ | The sub-protocol supports both background and foreground coloring via the <code>0x03</code> code point. On most IRC clients, the character can be generated via the {{Key|Ctrl|K}} shortcut key (({{Key|Ctrl|C}}) in irssi). The syntax for coloring text is <code>^KN</code> (<code>^CN</code> in irssi) for just foreground color or <code>^KN,M</code> (<code>^CN,M</code> in irssi) for a background color as well. Where N and M represent any integer between 0 and 15 inclusively, allowing up to sixteen colors. <code>^K</code> alone can be used to terminate the previous sequence of colored text. | ||
+ | |||
+ | While most client allow the user to change the meaning of those values, the default values are: | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Value !! Name !! [[RGB]] !! HTML | ||
+ | |- | ||
+ | | 0 || style="background-color:#FFFFFF; color:#000000;" | White || 255,255,255 || #FFFFFF | ||
+ | |- | ||
+ | | 1 || style="background-color:#000000; color:#FFFFFF;" | Black || 0,0,0 || #000000 | ||
+ | |- | ||
+ | | 2 || style="background-color:#00007F; color:#FFFFFF;" | Navy || 0,0,127 || #00007F | ||
+ | |- | ||
+ | | 3 || style="background-color:#009300; color:#FFFFFF;" | Green || 0,147,0 || #009300 | ||
+ | |- | ||
+ | | 4 || style="background-color:#FF0000; color:#FFFFFF;" | Red || 255,0,0 || #FF0000 | ||
+ | |- | ||
+ | | 5 || style="background-color:#7F0000; color:#FFFFFF;" | Maroon || 127,0,0 || #7F0000 | ||
+ | |- | ||
+ | | 6 || style="background-color:#9C009C; color:#FFFFFF;" | Purple || 156,0,156 || #9C009C | ||
+ | |- | ||
+ | | 7 || style="background-color:#FC7F00; color:#FFFFFF;" | Orange || 252,127,0 || #FC7F00 | ||
+ | |- | ||
+ | | 8 || style="background-color:#FFFF00; color:#000000;" | Yellow || 255,255,0 || #FFFF00 | ||
+ | |- | ||
+ | | 9 || style="background-color:#00FC00; color:#000000;" | Light Green || 0,252,0 || #00FC00 | ||
+ | |- | ||
+ | | 10 || style="background-color:#009393; color:#FFFFFF;" | Teal || 0,147,147 || #009393 | ||
+ | |- | ||
+ | | 11 || style="background-color:#00FFFF; color:#000000;" | Cyan || 0,255,255 || #00FFFF | ||
+ | |- | ||
+ | | 12 || style="background-color:#0000FC; color:#FFFFFF;" | Royal blue || 0,0,252 || #0000FC | ||
+ | |- | ||
+ | | 13 || style="background-color:#FF00FF; color:#000000;" | Magenta || 255,0,255 || #FF00FF | ||
+ | |- | ||
+ | | 14 || style="background-color:#7F7F7F; color:#000000;" | Gray || 127,127,127 || #7F7F7F | ||
+ | |- | ||
+ | | 15 || style="background-color:#D2D2D2; color:#000000;" | Light Gray || 210,210,210 || #D2D2D2 | ||
+ | |} | ||
+ | |||
+ | Any new sequence of colors will override the previous (or default). If the ^K character is used without any numbers, it will reset the text format back to default. If a color sequence defines a background color and a new color sequence starts without a background color, the previous background color will be used. For example <code style="border: #7F7F7F solid 1px;">^K0,1Hello ^4There!</code> will generate the <code style="border: #7F7F7F solid 1px; background-color: #000000;"><span style="color:#FFFFFF;">Hello </span><span style="color:#FF0000;">There!</span></code> | ||
+ | |||
+ | Using the ^K character as a color terminator will not terminate any other kind of formatting such as bold. For example <code style="border: #7F7F7F solid 1px;">^B^K0,1Hello ^KThere!</code> will generate <code style="border: #7F7F7F solid 1px;"><span style="background-color: #000000; color:#FFFFFF">'''Hello'''</span> '''There!'''</code> where the bold continues on to the rest of the line. Using the ^O key, however, will restore all formats to default from that point onward. | ||
− | [[Category: | + | [[Category:internet relay chat]] |
Latest revision as of 13:08, 12 July 2020
IRC Colors (or mIRC Colors) is a light-weight sub-protocol designed to add support for various text formatting to IRC. The protocol usually supports foreground, background, bold, italics, underline, and reverse.
Overview[edit]
Text formatting is done via a set of special character sequences that are parsed by the IRC client. Every new segment of text formats starts with one of the formatting control character. The same control character can be used at the end of the format in order to terminate it. The caret notation is used to represent such characters. For example, the ^B character is used to specify bold text. ^BHello World^B
will display on supported IRC client as Hello World
While originally designed to be exclusively client-side, over time servers have been updated to be made aware of color codes. Some servers support various channel modes to block colors, strip colors, and ban various patterns. The exact level of support depends on the server software used.
Format characters[edit]
Most clients support at least bold and underline. Below are the common shortcuts for those characters:
Format | Code point | Shortcuts | Example |
---|---|---|---|
Bold | 0x02 | Ctrl+B / ⌘ Cmd+B | ^BAA^BBB^BCC^BDD = AABBCCDD
|
Italics | 0x1D | Ctrl+I / ⌥ Opt+⌘ Cmd+I | ^IAA^IBB^ICC^IDD = AABBCCDD
|
Underline | 0x1F | Ctrl+U / ⌥ Opt+⌘ Cmd+U | ^UAA^UBB^UCC^UDD = AABBCCDD
|
Reverse | 0x16 | Ctrl+R / ⌥ Opt+⌘ Cmd+R | ^RAA^RBB^RCC^RDD = AABBCCDD
|
Plain | 0x0F | Ctrl+O / ⌥ Opt+⌘ Cmd+O | ^I^B^UAAA^OBBB = AAABBB
|
The plain text character is used to restore all formatting back to default.
Color formatting[edit]
The sub-protocol supports both background and foreground coloring via the 0x03
code point. On most IRC clients, the character can be generated via the Ctrl+K shortcut key ((Ctrl+C) in irssi). The syntax for coloring text is ^KN
(^CN
in irssi) for just foreground color or ^KN,M
(^CN,M
in irssi) for a background color as well. Where N and M represent any integer between 0 and 15 inclusively, allowing up to sixteen colors. ^K
alone can be used to terminate the previous sequence of colored text.
While most client allow the user to change the meaning of those values, the default values are:
Value | Name | RGB | HTML |
---|---|---|---|
0 | White | 255,255,255 | #FFFFFF |
1 | Black | 0,0,0 | #000000 |
2 | Navy | 0,0,127 | #00007F |
3 | Green | 0,147,0 | #009300 |
4 | Red | 255,0,0 | #FF0000 |
5 | Maroon | 127,0,0 | #7F0000 |
6 | Purple | 156,0,156 | #9C009C |
7 | Orange | 252,127,0 | #FC7F00 |
8 | Yellow | 255,255,0 | #FFFF00 |
9 | Light Green | 0,252,0 | #00FC00 |
10 | Teal | 0,147,147 | #009393 |
11 | Cyan | 0,255,255 | #00FFFF |
12 | Royal blue | 0,0,252 | #0000FC |
13 | Magenta | 255,0,255 | #FF00FF |
14 | Gray | 127,127,127 | #7F7F7F |
15 | Light Gray | 210,210,210 | #D2D2D2 |
Any new sequence of colors will override the previous (or default). If the ^K character is used without any numbers, it will reset the text format back to default. If a color sequence defines a background color and a new color sequence starts without a background color, the previous background color will be used. For example ^K0,1Hello ^4There!
will generate the Hello There!
Using the ^K character as a color terminator will not terminate any other kind of formatting such as bold. For example ^B^K0,1Hello ^KThere!
will generate Hello There!
where the bold continues on to the rest of the line. Using the ^O key, however, will restore all formats to default from that point onward.