Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

<ESC> codes and colour

0 views
Skip to first unread message

A Brown

unread,
Dec 21, 1993, 9:56:45 AM12/21/93
to
I've been fooling around with the <ESC> codes posted by Susan Loggiodice
in some ascii animations, they work, but don't do the things they are
supposed to, for example, <esc>[1m through to <esc>[8m alter the
colours of the text on the computer which I use (a PC running a terminal
emulator). This looks pretty neat when added into pictures and
animations, but as Susan said that these codes produce double size
characters and underlined characters etc, I don't know if colouring
pictures in this way will turn them into a garbled mess for some people.

Can anyone tell me how these codes are interpreted by the various
machines, and whether it is a good idea to use them at all? If needed I
will run up a quick coloured picture and post it to any interested
parties to see if their terminal will make sense of it.

Thanks,
GtB

Jared Quinn

unread,
Dec 28, 1993, 12:04:02 PM12/28/93
to
A Brown (epa...@festival.ed.ac.uk) wrote:
: I've been fooling around with the <ESC> codes posted by Susan Loggiodice

: in some ascii animations, they work, but don't do the things they are
: supposed to, for example, <esc>[1m through to <esc>[8m alter the

They are infact called 'ANSI' codes. There is a standard, and most
platforms seem to have something that does stick pretty close to the
standard.

: Can anyone tell me how these codes are interpreted by the various


: machines, and whether it is a good idea to use them at all? If needed I
: will run up a quick coloured picture and post it to any interested
: parties to see if their terminal will make sense of it.

All Machines should be able to manage the following codes:

<ESC>[0 Reset all Attributes (and set colour to White on Black)
[1 Bold Characters (Hi Intensity)
[2 Low Intensity (Linux does this - not sure about others)
[4 Underscore (Not all term emmulations do this - Linux does)
[5 Flashing Text (Not all term emmulations do this - Linux does)
[7 Inverse Video
[8 Concealed on (I've never played with this one, it has
no effect under any of Linux's Term Emms)

Foreground Background
Black <ESC>[30 [40
Red [31 [41
Green [32 [42
Yellow [33 [43
Blue [34 [44
Magneta [35 [45
Cyan [36 [46
White [37 [47


Codes can be joined together to make strings for example:

<ESC>[1;37;42m Will turn Hi Intensity on, set colour to
White on Green. It will be a bright white
(Because Hi Intensity has been turned on.)

<ESC>[2J Will Clear the Screen and move the cursor
to Position 0,0. (Should work on most
term emms. Tho some prefer Ctrl-L, you are
probably safer sticking to a <ESC>[2J)

<ESC>[x;yH Locate position x;y (where X is the Row
and Y is the column) - You'd be better off
avoiding this one unless you want to do
animations.

The above colours comply with a universal standard (ISO 6429) which means
they should be okay on any platform which is capable of displaying them.
(Ie they wont show up on a mono display :)

: Thanks,
: GtB

If this isn't totally clear, gimme an Email...

-Jared
--
Jared Quinn fu...@jungle.hna.com.au
-------------------------------------------------------------------------
"I'm not Crazy! (In an Institution) Your the one who's crazy. (In an
Institution) Your driving me crazy! (In an Institution)"
Institutionalised (Suicidal Tendencies)

Jorn Barger

unread,
Dec 30, 1993, 12:43:18 PM12/30/93
to
In article <1993Dec28....@jungle.hna.com.au>,
Jared Quinn <fu...@jungle.hna.com.au> wrote: [...]
>All Machines should be able to manage the following codes: [...]

><ESC>[x;yH Locate position x;y (where X is the Row
> and Y is the column) - You'd be better off
> avoiding this one unless you want to do
> animations. [...]

(Well, this is the *only* one I use, because it's the most universal.)

What's badly *needed* is an additional code for "WAIT n SECONDS". It
would be easy to create a replacement for 'cat' that supported this--
any suggestions as to the *least-compromised* escape sequence to assign
to this new function???

I've been resorting to shameless 'padding' of my animation experiments,
so they play okay at 9600 or better. This simple WAIT sequence could
resolve that totally, allowing much more compact animations...


jorn

ObAscii: The Killroy collection


/---\
| O O |
--oOO--U--OOo--

____
_(____)_
___ooO_(_o__o_)_Ooo___

\|||/
(o o)
----ooO-(_)-Ooo--------

( ( ( ))
) ) ) ((
( ( ( ___o___)
'. ___ .' | |====O
' (> <) ' |_____|
--ooO-(_)-Ooo--------------------


"""""""
^-O-O-^
---ooO--U--Ooo-----


......
.:||||||||:.
/ \
( o o )
--@@@@----------: :----------@@@@--

>\\\|/<
|_"""_|
(O) (o)
+----OOO--(_)--OOOo---

0 new messages