is an option that specifies what background color to use.


Background
is an option that specifies what background color to use.
Details

- The setting for Background can be any color or opacity specification.
- Background is an option to such functions as Graphics, Plot, Text, Panel, Button, and Cell.
- When an object has option Background->color, the specified color will normally be used as a background throughout the region defined by the object.
- Style[expr,Background->color] specifies that color should be used as the background only for the region defined by the bounding box of expr.
- In constructs such as Grid, Item can be used to specify that a background should fill the complete region for a particular item.
- In a top-level cell, the background is used only for the region inside the cell frame. If the cell's background color does not match its surroundings, the cell will include cell frame margins even if no cell frame is drawn. Cells displayed as inline, attached, etc. are not similarly affected. »
- Background->None specifies that no background should be used, so that in effect the background is transparent.
- Background->Automatic specifies a background that follows the system appearance for the particular object or window used. For Inset, Background->Automatic specifies that the background should be taken from the graphic in which it appears.
- For objects such as Grid, Column, and Row, the setting for Background can be a list that specifies backgrounds for individual columns, rows, or elements.
- In Dataset, the setting for Background can be a pure function f that returns a color. The setting is given by f[item,position,data], where data is the dataset's first argument.
Examples
open all close allScope (4)
Draw a grid with a pink background:
Any valid color directive can be used:
LightDarkSwitched can be used to specify different colors in light and dark mode:
Generalizations & Extensions (5)
Orange and magenta backgrounds for the first and second horizontal positions:
Orange and magenta backgrounds for the first and last horizontal positions:
Orange and magenta backgrounds for the first and second vertical positions:
Alternating brown and gray backgrounds:
Alternating background with pink superimposed in the first and last positions:
Set the background for a subregion of the grid:
Color background by value in Dataset:
Applications (3)
Show a table with alternating row background colors:
Highlight the maximum in each column of a Dataset:
Properties & Relations (2)
Background color can be seen through a transparent object:
A cell with a contrasting background color and no cell frame draws using CellFrameMargins:
A background color matching the environment only uses CellFrameMargins if a cell frame is present:
BackgroundNone is treated as a matching background color:
CellFrameMargins is not used for cells that are displayed as inline, attached, floating, etc.:
Possible Issues (1)
Some background colors contrast with default font colors well in light mode, but poorly in dark mode:
These can be fixed by wrapping the color in LightDarkSwitched:
Other colors contrast well in dark mode, but poorly in light mode:
These can be fixed by using LightDarkSwitched with Automatic as the first argument:
See Also
Prolog PlotRegion ImageMargins Item Panel Framed CellFrame Style WindowOpacity LightDarkSwitched ThemeColor
Function Repository: HighlighterPalette
Related Workflows
- Change the Background Color of a Cell ▪
- Add Styling to Text
Related Links
History
Introduced in 1991 (2.0) | Updated in 1996 (3.0) ▪ 2007 (6.0) ▪ 2012 (9.0) ▪ 2020 (12.1)
Text
Wolfram Research (1991), Background, Wolfram Language function, https://reference.wolfram.com/language/ref/Background.html (updated 2020).
CMS
Wolfram Language. 1991. "Background." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/Background.html.
APA
Wolfram Language. (1991). Background. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Background.html
BibTeX
@misc{reference.wolfram_2025_background, author="Wolfram Research", title="{Background}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/Background.html}", note=[Accessed: 08-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_background, organization={Wolfram Research}, title={Background}, year={2020}, url={https://reference.wolfram.com/language/ref/Background.html}, note=[Accessed: 08-August-2025]}