Colors

Setting the page background colour

The background colour of the entire page can be easily changed with \pagecolor. See the next example:

\pagecolor{black}
\color{white}
ColoursEx4.png

The command \pagecolor{black} set the page colour to black. This is a switch command, meaning it will take effect in the entire document unless another switch command is used to revert it. \nopagecolor will change the background back to normal.

Open an example of the xcolor package in Overleaf

Reference guide

Basic colour names available in LATEX

white, black, red, green, blue, cyan, magenta, yellow

BasicColours.png

Colour names available with the dvipsnames option

ColoursEx6.png

Last updated

Was this helpful?