C.7 Window Color Options
You can use the following command-line options to specify the colors to use for various parts of the Emacs display. Colors may be specified using either color names or RGB triplets (see Colors).
β-fg colorββ
β--foreground-color=colorββ
Specify the foreground color, overriding the color specified by the default face (see Faces).
β-bg colorββ
β--background-color=colorββ
Specify the background color, overriding the color specified by the default face.
β-bd colorββ
β--border-color=colorββ
Specify the color of the border of the X window. This has no effect if Emacs is compiled with GTK+ support.
β-cr colorββ
β--cursor-color=colorββ
Specify the color of the Emacs cursor which indicates where point is.
β-ms colorββ
β--mouse-color=colorββ
Specify the color for the mouse cursor when the mouse is in the Emacs window.
β-rββ
β-rvββ
β--reverse-videoββ
Reverse video: swap the foreground and background colors.
β--color=modeββ
Set the color support mode when Emacs is run on a text terminal. This option overrides the number of supported colors that the character terminal advertises in its termcap or terminfo database. The parameter mode can be one of the following:
βneverββ
βnoββ
Donβt use colors even if the terminalβs capabilities specify color support.
βdefaultββ
βautoββ
Same as when --color is not used at all: Emacs detects at startup whether the terminal supports colors, and if it does, turns on colored display.
βalwaysββ
βyesββ
βansi8ββ
Turn on the color support unconditionally, and use color commands specified by the ANSI escape sequences for the 8 standard colors.
βnumββ
Use color mode for num colors. If num is -1, turn off color support (equivalent to βneverβ); if it is 0, use the default color support for this terminal (equivalent to βautoβ); otherwise use an appropriate standard mode for num colors. Depending on your terminalβs capabilities, Emacs might be able to turn on a color mode for 8, 16, 88, or 256 as the value of num. If there is no mode that supports num colors, Emacs acts as if num were 0, i.e., it uses the terminalβs default color support mode.
If mode is omitted, it defaults to ansi8.
For example, to use a coral mouse cursor and a slate blue text cursor, enter:
emacs -ms coral -cr 'slate blue' &
You can reverse the foreground and background colors through the β-rvβ option or with the X resource βreverseVideoβ.
The β-fgβ, β-bgβ, and β-rvβ options function on text terminals as well as on graphical displays.