Changes

Jump to navigation Jump to search
318 bytes added ,  16:38, 27 August 2022
→‎The basics: - another typo
{{Color_navigation_Trial}} [[MetaPost]] only supports the RGB color space, although with the help of [[MetaFun - MetaPost in ConTeXt|MetaFun]] you can face transparency and CMYK colors. This article describes the use of colors in MetaPost and MetaFun.
== The basics ==
Colors are defined as vectors with three components: a red, green and blue one. Like pens, colors have their a {{code|with...}} command:
withcolor (.4,.5,.,6)
You can define color variables like so:
color darkred ; darkred := (.625,0.,0) ;
% use the color
withcolor darkred
<context source=yes>
% MKII% \runMPgraphicstrue
\setupcolors[state=start]
\starttext
</pre>
The settings will be in {{code|tex/texmf/web2c/texmf.cnf}} or {{code|tex/texmf-context/web2c/context.cnf}} inside your ConTeXt tree. If you are using ConTeXt from the Debian/Ubuntu distribution of TeX, instead of via the recommended [[ConTeXt Standalone]], you need to edit ''/etc/texmf/texmf.d/95NonPath.cnf'':, instead. The part you need to edit will look something like this.
<pre>
* Comment out the .mpost line (MetaFun uses the main_memory value of 1000000; the difference in values is the cause of the problem).
* Regenerate {{code|/etc/texmf/texmf.cnf}} (If you are not using the standalone, regenerate your TeX with {{code|sudo update-texmf}}; )* then Lastly, regenerate the MetaFun format with {{code|texexec --make metafun}}* transparency . Transparency should work now. [[Category:Color]][[Category:Graphics]]
174

edits

Navigation menu