From beba756e14d035ba3fa4ec4617dd5b002aab2fbf Mon Sep 17 00:00:00 2001 From: Ulrike Fischer Date: Sun, 5 Nov 2023 23:27:09 +0100 Subject: [PATCH] document color changes --- CHANGES.md | 4 ++++ fontspec-doc-featset.tex | 52 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 10841c1..19cfb7e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ Change history ============== +## [Unreleased] + + * added support for named colors from l3color + * support with lualatex spotcolors and cmyk colors in the pdf. ## v2.8a (2022/01/15) diff --git a/fontspec-doc-featset.tex b/fontspec-doc-featset.tex index 5dc275f..94eb3dc 100644 --- a/fontspec-doc-featset.tex +++ b/fontspec-doc-featset.tex @@ -351,17 +351,61 @@ \subsection{Colour} \definecolor{Foo}{rgb}{0.3,0.4,0.5} \fontspec[Color=Foo]{Verdana} ... \end{Verbatim} -The \pkg{color} package is \emph{not} supported; use \pkg{xcolor} instead. -You may specify the transparency with a named colour using the \feat{Opacity} -feature which takes an decimal from zero to one corresponding to -transparent to opaque respectively: +You may also use named colours defined with the color commands of the L3 +programming layer: +\begin{Verbatim} + \ExplSyntaxOn + \color_set:nnn{Foo}{rgb}{0.3,0.4,0.5} +\ExplSyntaxOff + ... + \fontspec[Color=Foo]{Verdana} ... +\end{Verbatim} + +Color expressions (\verb+red!50!blue+) are not supported. The \pkg{color} +package is \emph{not} supported neither. + +The code will at first test for color names of the L3 layer, then for xcolor +names and at last try to use the argument as a hexadecimal value. + +You may specify the transparency with a named colour using the \feat{Opacity} +feature which takes an decimal from zero to one corresponding to transparent +to opaque respectively: \begin{Verbatim} \fontspec[Color=red,Opacity=0.7]{Verdana} ... \end{Verbatim} It is still possible to specify a colour in six-char hexadecimal form while defining opacity in this way, if you like. +\subsubsection{Color models} + +With \XeTeX\ color are always written in the rgb color model into the PDF. +When using \LuaTeX, colors with the commands of the L3 layer can be written +as rgb or cmyk or as spot color depending on their definition and of the +value of the variable \verb+\l_color_fixed_model_tl+. + +\subsubsection{Spot colors} +With \LuaTeX\ it is possible to use spot colors. This requires the use of the +PDF management: +\begin{Verbatim} +\DocumentMetadata{} +\documentclass{article} +\usepackage{fontspec} +\ExplSyntaxOn + \color_model_new:nnn { sepblue } { Separation } + { + name = PANTONE~3005~U , + alternative-model = cmyk , + alternative-values = {1, 0.56, 0,0}, + } + \color_set:nnn{spotblue}{sepblue}{1} +\ExplSyntaxOff +... +\fontspec[Color=spotblue]{texgyreheros} +\end{Verbatim} + + + \subsection{Scale} \cmdbox{