CMYKColor
Details
- CMYKColor is a subtractive color model, typically used in printing. CMYK refers to the cyan, magenta, yellow and black inks used in printing.
- For any positive value of
, the same color can be produced by subtracting
from other color components. This is commonly used to save on color ink consumption by using more black ink. - Color and opacity levels outside the range 0 to 1 will be clipped. »
- If no black component is specified, CMYKColor[c,m,y] is equivalent to CMYKColor[c,m,y,0].
- CMYKColor specifications are automatically converted to RGBColor when simulated lighting calculations are done. »
- If no opacity has been specified, CMYKColor[c,m,y,k] is equivalent to CMYKColor[c,m,y,k,1].
- CMYKColor[c,m,y,k,a] is equivalent to {CMYKColor[c,m,y,k],Opacity[a]}.
- The alternative forms CMYKColor[{c,m,y,k}] and CMYKColor[{c,m,y,k,a}] can also be used.
- ColorConvert can be used to convert CMYKColor to other color spaces.
- The following wrappers can be used around colors:
-
ColorsNear[color,…] specifies a region around color Directive[…,color,…] specifies a color in combination with other directives » Glow[color] specifies color independent of lighting » Opacity[a,color] specifies a color with an opacity a Style[expr,color] displays expr with the specified color » - For 3D surfaces, explicit CMYKColor directives define surface colors; the final shading depends on lighting and contributions from specularity and glow. »
Examples
open all close allBasic Examples (4)
Specify the color of graphics primitives:
Graphics[{CMYKColor[0, 1, 1, .25], Disk[]}]Specify the color with opacity:
Graphics3D[{CMYKColor[1, 0, 1, 0, .5], Sphere[]}]Specify the output color of expressions:
Style[x ^ 2 + y ^ 2, CMYKColor[1, .8, 0, .25]]Plot[Sin[x ^ 2], {x, 0, 2Pi}, PlotStyle -> CMYKColor[0.3, 1, 0, .25]]Scope (3)
Colors in 3D (1)
Graphics3D[{CMYKColor[0, 0.4, 1, 0], Sphere[]}]Use diffuse and specular surface color:
Graphics3D[{CMYKColor[0, 0.4, 1, 0], Specularity[White, 20], Sphere[]}]Use glow color, setting the diffuse surface color to black:
Graphics3D[{Black, Glow[CMYKColor[0, 0.4, 1, 0]], Sphere[]}]Color Operations (2)
Use Blend to mix two or more colors:
{Graphics[{CMYKColor[0, 1, 0, 0], Disk[]}],
Graphics[{Blend[{CMYKColor[0, 1, 0, 0], CMYKColor[0, 0, 1, 0]}], Disk[]}],
Graphics[{CMYKColor[0, 0, 1, 0], Disk[]}]}Use Lighter and Darker to mix with white and black, respectively:
{Graphics[{Lighter[CMYKColor[0, 0, 1, 0], .4], Disk[]}],
Graphics[{CMYKColor[0, 0, 1, 0], Disk[]}],
Graphics[{Darker[CMYKColor[0, 0, 1, 0], .4], Disk[]}]}Generalizations & Extensions (2)
CMYKColor[{c,y,m,k}] is equivalent to CMYKColor[c,y,m,k]:
{Graphics[{CMYKColor[{1, 0, 0, .25}], Disk[]}], Graphics[{CMYKColor[1, 0, 0, .25], Disk[]}]}Map[Graphics[{CMYKColor[#], Disk[]}]&, {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}}]Table[Graphics[{CMYKColor[1, 0, 0, 0], Disk[{1, 0}], Opacity[a], CMYKColor[0, 1, 0, 0], Disk[]}], {a, 0, 1, .33}]Use the opacity argument in CMYKColor directly:
Table[Graphics[{CMYKColor[1, 0, 0, 0], Disk[{1, 0}], CMYKColor[0, 1, 0, 0, a], Disk[]}], {a, 0, 1, .33}]Properties & Relations (3)
CMYKColor is related to RGBColor in the following way:
RGBToCMY[RGBColor[r_, g_, b_]] := CMYKColor[1 - r, 1 - g, 1 - b, 0]c = RGBColor@@RandomReal[{0, 1}, 3];
{Graphics[{c, Rectangle[]}], Graphics[{RGBToCMY[c], Rectangle[]}]}For economy of printing, black is usually separated out:
RGBToCMYK[RGBColor[r_, g_, b_]] := Block[{k = Min[1 - r, 1 - g, 1 - b]}, CMYKColor[1 - r - k, 1 - g - k, 1 - b - k, k]]c = RGBColor@@RandomReal[{0, 1}, 3];
{Graphics[{c, Rectangle[]}], Graphics[{RGBToCMYK[c], Rectangle[]}]}By using the same parameters in CMYKColor and RGBColor, you get complementary colors:
DynamicModule[{m = (1/2), y = (1/2)}, {Slider2D[Dynamic[{m, y}], {{0, 0}, {1, 1}}], Dynamic[Graphics[{{CMYKColor[0, m, y, 0], Rectangle[{0, 0}]}, {RGBColor[0, m, y], Rectangle[{1, 0}]}}]]}]CMY values are complementary to RGB values:
{Graphics[{CMYKColor[0, 1, 1, 0], Disk[]}], Graphics[{RGBColor[1, 0, 0], Disk[]}]}{Graphics[{CMYKColor[1, 0, 1, 0], Disk[]}], Graphics[{RGBColor[0, 1, 0], Disk[]}]}{Graphics[{CMYKColor[1, 1, 0, 0], Disk[]}], Graphics[{RGBColor[0, 0, 1], Disk[]}]}Possible Issues (1)
Values outside of the 0, 1 range will be clipped:
Graphics[Table[{CMYKColor[c, 0, 0, 0], EdgeForm[Gray], Rectangle[{4c, 0}]}, {c, 0 - 1 / 4, 1 + 1 / 4, 1 / 4}]]In plot functions, use ColorFunctionScaling to control global scaling of variables:
Table[DensityPlot[x, {x, -1, 2}, {y, 0, 1}, FrameTicks -> None, ColorFunction -> (CMYKColor[#, 0, 0, 0]&), ColorFunctionScaling -> t], {t, {False, True}}]Neat Examples (2)
Visualizing the CMY color space:
Graphics3D[{Opacity[.7], {CMYKColor[#], Cuboid[#, # + .1]}& /@ Tuples[Range[0, 1, .2], 3]}, Axes -> True, AxesLabel -> {"Cyan", "Magenta", "Yellow"}, Lighting -> "Neutral"]Graphics[{Pink, Disk[{100, 100}, 40], Raster[RandomReal[1, {200, 200, 5}], ColorFunction -> CMYKColor]}]Related Guides
History
Introduced in 1991 (2.0) | Updated in 2007 (6.0) ▪ 2008 (7.0) ▪ 2021 (12.3)
Text
Wolfram Research (1991), CMYKColor, Wolfram Language function, https://reference.wolfram.com/language/ref/CMYKColor.html (updated 2021).
CMS
Wolfram Language. 1991. "CMYKColor." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/CMYKColor.html.
APA
Wolfram Language. (1991). CMYKColor. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CMYKColor.html
BibTeX
@misc{reference.wolfram_2026_cmykcolor, author="Wolfram Research", title="{CMYKColor}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/CMYKColor.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_cmykcolor, organization={Wolfram Research}, title={CMYKColor}, year={2021}, url={https://reference.wolfram.com/language/ref/CMYKColor.html}, note=[Accessed: 12-June-2026]}