[metapost] CMYK colors

Stephan Hennig mailing_list at arcor.de
Wed Jun 29 18:41:27 CEST 2011


Dan,

schrieb Dan T. Abell:

> Thanks for doing this work. Please let us know
> when you submit the mpcolornames to CTAN.

Sure.


> Now on my wish list is that one can somehow access
> the same colors in both LaTeX and MetaPost. In figure
> captions, I sometimes want to write 'red' in red to
> bring attention to some red feature in the graphic.
> Would be nice to have the red in LaTeX and MetaPost
> match one another.
> 
> Any thoughts on how to accomplish this easily?

Colour names are taken from files distributed by packages color and
xcolor.  In sec. 2.1, I can find

> description   dvips specification (68 colors)
> [...]
> source   taken from file dvipsnam.def v3.0i as distributed by
> LATEX package color v1.0j

So, as long as you stick to predefined colour names, they should match
between LaTeX and MetaPost.[1]  Is that what you're asking for?

For user-defined colour names, I think one could escape to Lua to define
matching MetaPost colour names.  But that's not the scope of the
package.  (Yet.  Contributions are welcome.)

Best regards,
Stephan Hennig

[1] For clashing colour names, additionally, you need to make sure that
the correct definitions are in effect via macros dvipsnames and
svgnames.  But since clashing colour names are of different variable
types (rgbcolor and cmykcolor) assignments should throw an error, if the
wrong names are in effect.  So, that shouldn't be a source of
mismatching colours either.


More information about the metapost mailing list