modern-irc icon indicating copy to clipboard operation
modern-irc copied to clipboard

ANSI colors for first 16 IRC colors?

Open jwodder opened this issue 5 months ago • 3 comments

The "Colors" section of the "IRC Formatting" page lists recommended ANSI color codes for IRC colors 16 through 98 but not for colors 0 through 15, and I'm not 100% sure what ANSI colors the latter should map to.

Assuming the first 16 IRC colors should map to the first 16 ANSI colors, the most obvious mappings are:

IRC ANSI
White (0) Bright White (15)
Black (1) Black (0)
Blue (2) Blue (4)
Green (3) Green (2)
Red (4) Red (1) [^1]
Brown (5) ???
Magenta (6) Magenta (5)
Orange (7) ???
Yellow (8) Bright Yellow (11) [^1]
Light Green (9) Bright Green (10)
Cyan (10) Cyan (6)
Light Cyan (11) Bright Cyan (14)
Light Blue (12) Bright Blue (12)
Pink (13) Bright Magenta (13) [^1]
Grey (14) Bright Black (8) [^1]
Light Grey (15) White (7) [^1]

[^1]: Guess, could be wrong

This leaves the ANSI colors yellow (3) and bright red (9) unused. My understanding is that ANSI yellow is normally used as a "brown" color, but the colored square shown on the page for IRC brown looks more like ANSI (dark/non-bright) red to me. On top of that, none of the first 16 ANSI colors look like orange (I'd personally pick ANSI 172 for that).

Are there any pre-existing conventions for the ANSI color codes for IRC colors 0-16? Could such a mapping be added to the page?

jwodder avatar Jul 11 '25 23:07 jwodder

The note in the docs adequately sums it up:

NOTE: The colors displayed here are simply a guide. The actual RGB values used for these codes will depend on what the client author has defined, and are often defined by the terminal color scheme for terminal-based clients.

There is no definitive answer. If you are writing a client and you want to be "correct" when displaying colored ascii art, look at what the clients of that time period were doing.

https://en.wikipedia.org/wiki/ANSI_escape_code#Colors https://www.mirc.com/colors.html https://weechat.org/files/doc/stable/weechat_user.en.html#colors_support https://github.com/irssi/irssi/blob/master/docs/formats.txt

...

tommyrot avatar Jul 12 '25 01:07 tommyrot

Interesting. The linked clients all seem to map IRC red (4) to ANSI light/bright red (9) and IRC brown (5) to ANSI (dark) red. Then IRC yellow (8) and orange (7) are presumably ANSI bright yellow (11) and (dark) yellow (3), respectively.

jwodder avatar Jul 12 '25 10:07 jwodder

Here is what senpai does: https://git.sr.ht/~delthas/senpai/tree/master/item/ui/style.go#L19

delthas avatar Jul 12 '25 14:07 delthas