[Tutor] ansi color coding

Gonçalo Rodrigues op73418@mail.telepac.pt
Fri Jan 3 10:17:04 2003


This is a multi-part message in MIME format.

------=_NextPart_000_000C_01C2B296.890F6040
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

----- Original Message -----=20
From: Rusty Newton=20
To: tutor@python.org=20
Sent: Thursday, January 02, 2003 6:22 PM
Subject: [Tutor] ansi color coding

>well im making a mud game or a multiuser online text game=20
>and i want to color the text, that i send to the users? does that =
explain anymore?

>-rusty

ANSI color codes are a kind of protocol to give colorize the text =
presented to the user. A table of such codes is in

http://pueblo.sourceforge.net/doc/manual/ansi_color_codes.html

Basically, it is of the form escape character (ESC, ASCII value 27) =
followed by the appropriate code sequence. So you have to interleave the =
text you send to the user with these codes and then the client must be =
able to interpret them.

You may also have to make sure the client *can* interpret ANSI color =
codes. Since it is a MUD, you use option negotiation over telnet? You =
have to check the relevant rfc's to know what's at stake. For everything =
related to the telnet protocol you can look at

http://www.networksorcery.com/enp/protocol/telnet.htm

With my best regards,
G. Rodrigues

------=_NextPart_000_000C_01C2B296.890F6040
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2716.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>----- Original Message ----- =
</FONT></DIV>
<DIV><FONT face=3DArial><FONT size=3D2><B>From:</B> </FONT></FONT><A=20
title=3Drustynewton@comcast.net =
href=3D"mailto:rustynewton@comcast.net"><FONT=20
face=3DArial size=3D2>Rusty Newton</FONT></A><FONT face=3DArial =
size=3D2> </FONT></DIV>
<DIV><FONT face=3DArial><FONT size=3D2><B>To:</B> </FONT></FONT><A=20
title=3Dtutor@python.org href=3D"mailto:tutor@python.org"><FONT =
face=3DArial=20
size=3D2>tutor@python.org</FONT></A><FONT face=3DArial size=3D2> =
</FONT></DIV>
<DIV><FONT face=3DArial><FONT size=3D2><B>Sent:</B> Thursday, January =
02, 2003 6:22=20
PM</FONT></FONT></DIV>
<DIV><FONT face=3DArial><FONT size=3D2><B>Subject:</B> [Tutor] ansi =
color=20
coding</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&gt;well im making a mud game or a =
multiuser online=20
text game </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&gt;and i want to color the text, =
that&nbsp;i send=20
to the users? does that explain anymore?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&gt;-rusty</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>
<DIV><FONT face=3DArial size=3D2>ANSI color codes are a kind of protocol =
to give=20
colorize the text presented to the user. A table of such codes is=20
in</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><A=20
href=3D"http://pueblo.sourceforge.net/doc/manual/ansi_color_codes.html">h=
ttp://pueblo.sourceforge.net/doc/manual/ansi_color_codes.html</A></FONT><=
/DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Basically, it is of the form escape =
character=20
(<FONT style=3D"FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">ESC</FONT>, =
ASCII=20
value 27) followed by the appropriate code sequence. So you have to =
</FONT><FONT=20
face=3DArial size=3D2>interleave the text you send to the user with =
these codes and=20
then the client must be able to interpret them.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>
<DIV><FONT face=3DArial size=3D2>You may also have to make sure the =
client *can*=20
interpret ANSI color codes. Since it is a MUD, you use option =
negotiation over=20
telnet? You have to check the relevant rfc's to know what's at stake. =
For=20
everything related to the telnet protocol you can look at</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><A=20
href=3D"http://www.networksorcery.com/enp/protocol/telnet.htm">http://www=
.networksorcery.com/enp/protocol/telnet.htm</A></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></DIV>
<DIV><FONT face=3DArial size=3D2>With my best regards,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>G. =
Rodrigues</FONT></DIV></DIV></BODY></HTML>

------=_NextPart_000_000C_01C2B296.890F6040--