Re: xterm colors
Re: xterm colors
- Subject: Re: xterm colors
- From: "Todd Larason" <email@hidden>
- Date: Fri, 31 Jan 2003 04:33:10 -0800
On 13 January 03, Eugene Lee wrote:
> Does the xterm bundled with Apple's X11 support more than 8 colors?
> If so, any suggestions for defining the palette of extra colors?
It's compiled in '16 color mode'.
I wish Apple would compile in either 88 or 256 color mode; it increases memory
usage some (but in these days of unicode characters, it's proportionally not
that much), and it's very very nice -- you're able to use much more subtle
color differences in text mode.
SGR 30-37 set foregrounds 0-7, 40-47 set backgrounds 0-7, 90-97 set
foregrounds 8-15, 100-107 backgrounds 8-15. By default, colors 8-15 are
brighter versions of colors 0-7. SGR 1 (bold) will switch to the bright
version of the foreground as well as using a bold font.
Additionally, SGR 39 switches to the default foreground, and 49 switches to
the default background. Those don't have to correspond to any of the numbered
colors, and SGR 38 and 48 can be used to set the foreground and background
color a bit more rationally -- SGR 38 5 ### selects color ### and won't switch
to a bright color just because you're using a bold font. (the copy of
ctlseqs.ms I'm looking at claims those are only available in 88 and 256 color
mode, but that's wrong).
The colors can be set via resources in any of the ways X supports that; ie,
the simplest would be to create a ~/.XDefaults file with something like the
one at the end of this mail. They can also be changed at runtime via OSC 4 --
'OSC 4 [ColorNumber Color ...] ST' will move through pairs of color numbers &
names; the names can be given in any of the normal X ways (#xxxxxx, color
name, etc). The default foreground and background color, along with cursor
and mouse &c, can be set with OSC 10 through 17.
SGR is ESC [ ... m -- outputing '^[[38;5;12m' where ^[ is escape, would switch
to foreground color 12.
OSC is ESC ] and ST is ESC \ -- outputting '^[]4;5;green^[\' will switch color
#5 to 'green'.
Sample .XDefaults
-------
XTerm*VT100.background: #1a1a1a
XTerm*VT100.foreground: wheat
xterm.VT100.color0: black
xterm.VT100.color1: PaleVioletRed
xterm.VT100.color2: SeaGreen
xterm.VT100.color3: LightGoldenrod
xterm.VT100.color4: DarkSlateBlue
xterm.VT100.color5: LightSalmon
xterm.VT100.color6: Aquamarine
xterm.VT100.color7: wheat
xterm.VT100.color8: Grey
xterm.VT100.color9: red
xterm.VT100.color10: PaleGreen
xterm.VT100.color11: yellow
xterm.VT100.color12: LightSkyBlue
xterm.VT100.color13: magenta
xterm.VT100.color14: cyan
xterm.VT100.color15: white
xterm.VT100.colorBD: white
xterm.VT100.colorUL: Turquoise
xterm.VT100.colorULMode: false
xterm.VT100.cursorColor: LightSlateBlue
xterm.VT100.pointerColor: LightSlateBlue
xterm.VT100.highlightColor: #000060
-----
--
Todd Larason | The MPAA, RIAA and their paid-for Senators don't think you need
3500238865/p | a computer you can program. Disagree? Fight back.
UIN: 2646573 | http://www.politechbot.com/docs/cbdtpa/
AIM: GothDoo | http://www.eff.org/
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe: http://www.lists.apple.com/mailman/listinfo/x11-users
Do not post admin requests to the list. They will be ignored.