[¤¤¤å³n¥óªí CNapps LIST] FAQ

How do I get color into my email/Usenet messages?

Written: 16 May 1995 Carol Oliver
Revised: 1996 Jan 08 Nelson Chin for CNapps LIST
Keywords: vt100 color email

ANSWER:

You can add color to messages using ANSI escape sequences (also known as "control codes"). Viewing the color requires a color screen and ANSI color compatible software. Different programs respond differently; if you read your mail with MacSamson, pine's default settings let you view the color messages. "more" and "cat" and "less -r" will respond to the codes; "less" alone will show you the codes. The codes are also visible using the default settings for elm or within emacs.

Here's a list of the codes which produce color. Note that "ESC" represents an escape character. You can insert this character using emacs by typing:

        
        Control-Q Control-[

From <URL:ftp://sashimi.wwa.com/pub/Scarecrow/AAResources>:

Set Graphics Rendition:
         ESC[#;#;....;#m              Set display attributes where # is
                                            0 for normal display
                                            1 for bold on
                                            4 underline (mono only)
					    5 blink on
                                            7 reverse video on
                                            8 nondisplayed (invisible)
                                            30 black foreground
                                            31 red foreground
                                            32 green foreground
                                            33 yellow foreground
                                            34 blue foreground
                                            35 magenta foreground
                                            36 cyan foreground
                                            37 white foreground
                                            40 black background
                                            41 red background
                                            42 green background
                                            43 yellow background
                                            44 blue background
                                            45 magenta background
                                            46 cyan background
                                            47 white background
You may notice some variation in how these colors actually display on your screen. This is due to how the software you are using has chosen to implement these codes.

You can use just one code, or you can string several together to combine effects. For example:

        ESC[4m         Simply underlines text
        ESC[4;5m       Underlines text and makes it blink
        ESC[43;35m     Write in Magenta on a Yellow background
	ESC[34;41m     Write in Blue on a Red background

As a matter of good manners, include the line

        ESC[0m

at the end of your messages. Not all programs handle the codes as nicely as others, and this will reset the screen for whoever is reading your mail or posting.


1997(c) copyrighted and maintained by Nelson Chin, cyl@ifcss.org. Hosted by Chinese Community Info. Ctr.. Created: 1997.01.05 Updated: 1997.04.27