Skip to content
Color in RGB and CMYK
NeoMath

Color in RGB and CMYK

How to choose equation color in RGB or in the four CMYK inks, and how each format, the API, MCP and NeoScript receive the color.

On this page

For publishing use, the equation text color can be chosen in RGB or CMYK. In CMYK the EPS carries the four exact inks, ready for the printer.

In the app#

  1. Open the color button in the toolbar.
  2. Use the RGB | CMYK switch. In CMYK, the palette colors are converted.
  3. For exact values, open More colors… and type Cyan, Magenta, Yellow and Black (0 to 100%).

The choice is stored in the modo_cor setting. Used colors stay under Custom.

How each format stores it#

Destination How the color is written
MathML mathcolor="device-cmyk(C% M% Y% K%)"; RGB stays #RRGGBB
EPS c m y k setcmykcolor with the four exact inks, including black only with K
SVG and PNG equivalent RGB
Word equivalent RGB
LaTeX \textcolor[cmyk]{c,m,y,k}{...}, values from 0 to 1

The equivalent RGB uses the formula R = 255 × (1 − C) × (1 − K), and the same for G and B, with no ICC profile.

Accepted JSON forms#

The API, MCP, batch style and NeoScript accept color in any of these forms:

JSON
"#1F4E79"
"blue"
"cmyk(0, 100, 100, 0)"
"device-cmyk(0 1 1 0)"
[0, 100, 100, 0]
[31, 78, 121]
{ "cmyk": [0, 100, 100, 0] }
{ "c": 0, "m": 100, "y": 100, "k": 0 }
{ "rgb": [31, 78, 121] }

A list of four numbers is CMYK from 0 to 100; a list of three is RGB from 0 to 255.

In each tool#

Tool How to use
Command line --cor "cmyk(0,100,100,0)" or --cmyk 0,100,100,0 in eps, svg, png and lote
Batch style (CLI) --cmyk instead of --cor and --cmyk-de with --cor-politica somente
MCP color_cmyk: [c, m, y, k] in the generation tools; color.cmyk and color.from_cmyk in restyle_folder
NeoScript neo.corCmyk(c, m, y, k) or neo.cor("cmyk(C, M, Y, K)")
HTTP API "cor": [0, 100, 100, 0] or "cmyk": [...] in opcoes

Color by part#

Besides the general color, each part can have its own color:

LaTeX
\textcolor{red}{x} + \textcolor[HTML]{1A2B3C}{y} + {\color{blue} z}

In MathML, use mathcolor="#1A2B3C". A part’s own color takes priority over the equation’s general color.