{18, "brown", "\x1B {18, "brown", "\x1B[38;5;094m"},[/code]However that would only work on certain clients - some players might see strange flashing colours, or black text on a white background, or the actual escape code, or even no text at all. So in practice you're going to need to differentiate between the old ANSI colours and the xterm colours, with some way for the player to indicate which they support, and some sort of conversion algorithm (or an alternative colour in the table entry).
My snippet automatically determines xterm 256 colour support, and converts to normal ANSI colour when necessary.
{18, "brown", "\x1B {18, "brown", "\x1B[38;5;094m"},[/code]However that would only work on certain clients - some players might see strange flashing colours, or black text on a white background, or the actual escape code, or even no text at all. So in practice you're going to need to differentiate between the old ANSI colours and the xterm colours, with some way for the player to indicate which they support, and some sort of conversion algorithm (or an alternative colour in the table entry).
My snippet automatically determines xterm 256 colour support, and converts to normal ANSI colour when necessary.
[/quote]
Oh ok, I never really looked into it, thx for the explanation. I always overided colors in my client so I never bothered before I saw this thread.
With xterm 256 colors it's possible to handle the tertiary colors, which is the mixture of a primary and secondary colors. As following:
cyan + blue = azure, blue + magenta = violet, magenta + red = rose, red + yellow = orange, yellow + green = chartreuse, green + cyan = spring green
Traditional MUD color systems use letters to indicate colors, with r, g, b, y, m, c being taken by primary and secondary colors. w is typically white, and d (dark?) is typically used for black. The 6 tertiary colors (azure, violet, rose, orange, chartreuse, and spring green) unfortunately overlap. I came up with the following:
C –> C+B = A = Azure
M –> M+R = P = Pink (Rose)
R –> R+Y = O = Orange
Y –> Y+G = L = Lime or Lawn (Chartreuse)
G –> G+C = S = Spring green
B –> B+M = V = Violet
There may be options I haven't thought of.
Most MUDs will want to convert a 256 color to a 16 color code for older clients, I'll probably do that as following:
B –> Azure
R –> Pink
R –> Orange
G –> Lime or Lawn
G –> Spring green
B –> Violet
For displaying bold I'm leaning toward using intensity 2 for the secondary color, and 5 for the primary color, and for dim 1 and 3 respectively.
I think this covers all the notable colors besides white, grey, and black. Thoughts?