Search for all pages containing colorrules
is an option that specifies how colors of cells should be determined from values.


ColorRules
is an option that specifies how colors of cells should be determined from values.
Details

- The rules given by ColorRules are applied to the value of each cell.
- Rules for ColorRules can involve patterns.
- If the result from applying ColorRules is None, the background color will be used.
- If none of the rules in ColorRules apply, then ColorFunction is used to determine the color.
- With the default setting ColorRules->Automatic, an explicit setting ColorFunction->f is used instead of ColorRules.
Examples
open all close allBasic Examples (4)
Use color rules for ArrayPlot:
Use color rules for MatrixPlot:
Use color rules for GeoRegionValuePlot:
Use color rules for Colorize:
Scope (4)
ColorRules can involve patterns:
If no explicit color rules apply, the default ArrayPlot coloring is used:
Color rules are applied before color function:
Cases specified as None are rendered in the background color:
Related Guides
History
Introduced in 2004 (5.1)
Text
Wolfram Research (2004), ColorRules, Wolfram Language function, https://reference.wolfram.com/language/ref/ColorRules.html.
CMS
Wolfram Language. 2004. "ColorRules." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ColorRules.html.
APA
Wolfram Language. (2004). ColorRules. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ColorRules.html
BibTeX
@misc{reference.wolfram_2025_colorrules, author="Wolfram Research", title="{ColorRules}", year="2004", howpublished="\url{https://reference.wolfram.com/language/ref/ColorRules.html}", note=[Accessed: 07-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_colorrules, organization={Wolfram Research}, title={ColorRules}, year={2004}, url={https://reference.wolfram.com/language/ref/ColorRules.html}, note=[Accessed: 07-August-2025]}