IonicWind Software

IWBasic => The Roundtable => Topic started by: JoaoAfonso on July 16, 2008, 07:42:24 AM

Title: ANSI colors
Post by: JoaoAfonso on July 16, 2008, 07:42:24 AM
Good evening.

Don't know to whom this information might be useful, but anyway, as I finally figured it out, I will post it here.

I am making a game server (text based game), and players connect to the game using telnet. To have more advantages while playing, players can use other clients rather than the telnet console which comes with every Windows OS. Those clients usually support ANSI colors, and in this way, if I want the server to send colored strings to clients, I should add before each string the following codes (color - code):

Black            CHR$(27)+"[0;30m"
Blue             CHR$(27)+"[0;34m"
Green            CHR$(27)+"[0;32m"
Cyan             CHR$(27)+"[0;36m"
Red              CHR$(27)+"[0;31m"
Purple           CHR$(27)+"[0;35m"
Brown            CHR$(27)+"[0;33m"
Gray             CHR$(27)+"[0;37m"
Dark Gray        CHR$(27)+"[1;30m"
Light Blue       CHR$(27)+"[1;34m"
Light Green      CHR$(27)+"[1;32m"
Light Cyan       CHR$(27)+"[1;36m"
Light Red        CHR$(27)+"[1;31m"
Light Purple     CHR$(27)+"[1;35m"
Yellow           CHR$(27)+"[1;33m"
White            CHR$(27)+"[1;37m"
Title: Re: ANSI colors
Post by: JoaoAfonso on July 16, 2008, 07:44:49 AM
Tested with telnet windows client itself, and colors also work.