ColorQ
Details
- ColorQ tests whether an expression is a valid color that can be used for styling graphics primitives or used with images as padding, background and more.
- ColorQ returns True for any valid color directive specified in any of the following color spaces:
-
GrayLevel gray level specifying the brightness RGBColor standard sRGB CMYKColor CMYK Hue hue, saturation, brightness XYZColor CIE 1931 LABColor CIE 1976 LCHColor CIE LUVColor CIE 1976
Examples
open allclose allBasic Examples (2)
Scope (2)
Generalizations & Extensions (1)
ColorQ works on expressions where color components are specified as a list:
Applications (2)
Possible Issues (1)
Unevaluated expressions that correspond to valid colors still give True:
However, if the expression is not yet a valid color, ColorQ will not evaluate it:
This is also true for expressions that need an evaluation to be marked as numerical:
Compare with the results from RealValuedNumberQ:
Text
Wolfram Research (2014), ColorQ, Wolfram Language function, https://reference.wolfram.com/language/ref/ColorQ.html.
CMS
Wolfram Language. 2014. "ColorQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ColorQ.html.
APA
Wolfram Language. (2014). ColorQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ColorQ.html