aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/set_color.txt
blob: 546889cd73636133c090d9ef362c120c3f9b8c0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
\section set_color set_color - set the terminal color

\subsection set_color-synopsis Synopsis
 <tt>set_color [-h --help] [-b --background COLOR] [COLOR]</tt>

\subsection set_color-description Description

\c set_color changes the foreground and/or background color of the terminal.
\c COLOR is one of black, red, green, brown, yellow, blue, magenta,
purple, cyan, white and normal.

If your terminal supports term256 (modern xterms and OS X Lion),
you can specify an RGB value with three or six hex digits, such
as A0FF33 or f2f. \c fish will choose the closest supported color.

The following options are available:

- \c -b, \c --background \c COLOR sets the background color.
- \c -c, \c --print-colors prints a list of all valid color names.
- \c -h, \c --help displays a help message and exit.
- \c -o, \c --bold sets bold or extra bright mode.
- \c -u, \c --underline sets underlined mode.

Calling <tt>set_color normal</tt> will set the terminal color to
the default color of the terminal.

Some terminals use the --bold escape sequence to switch to a brighter
color set. On such terminals, <code>set_color white</code> will result
in a grey font color, while <code>set_color --bold white</code> will
result in a white font color.

Not all terminal emulators support all these features.

\c set_color uses the terminfo database to look up how to change terminal
colors on whatever terminal is in use. Some systems have old and
incomplete terminfo databases, and may lack color information for
terminals that support it.

\subsection set_color-example Examples
<pre>set_color red; echo "Roses are red"
set_color blue; echo "Violets are blue"
set_color 62A ; echo "Eggplants are dark purple"
set_color normal; echo "Normal is nice too"
</pre>