Support for ANSI 256-colors

Post your suggestions here
Post Reply
Jakob Hubbard
Posts: 1226
Joined: Fri Nov 24, 2017 3:16 am
Team: Phil's
Location: Cold
Contact:

Support for ANSI 256-colors

Post by Jakob Hubbard »

Currently the sim chat is limited to only the basic ANSI colors

The following produces this output

Code: Select all

echo -n $'xpasswordbroadcast \x1b[31mred \x1b[38;5;208morange \x1b[33myellow\x1b[0m' > /dev/udp/127.0.0.1/19800
echo -n $'xpasswordbroadcast \x1b[38;5;208morange\x1b[0m' > /dev/udp/127.0.0.1/19800
Image

Not sure how difficult it would be to implement but would be a nice expansion to the chat for sure
Image
jlv
Site Admin
Posts: 15558
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Support for ANSI 256-colors

Post by jlv »

There are some other sequences that could be nice too. I really need to improve that!
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Jakob Hubbard
Posts: 1226
Joined: Fri Nov 24, 2017 3:16 am
Team: Phil's
Location: Cold
Contact:

Re: Support for ANSI 256-colors

Post by Jakob Hubbard »

Looks like modern terminals actually support all rgb color code combinations. That would be truly ideal as it would allow endless customization but if 256 colors are easier then that would be fine too.

Code: Select all

echo $'\x1b[38;2;255;0;0mtest\x1b[0m' # red
echo $'\x1b[38;2;255;255;0mtest\x1b[0m' # yellow
echo $'\x1b[38;2;255;0;255mtest\x1b[0m' # purple
Image
jlv
Site Admin
Posts: 15558
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Support for ANSI 256-colors

Post by jlv »

Definitely nice to have the sequences work in terminals.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Post Reply