[latex3-commits] [latex3/fontspec] l3color: document color changes (beba756)

github at latex-project.org github at latex-project.org
Sun Nov 5 23:27:09 CET 2023


Repository : https://github.com/latex3/fontspec
On branch  : l3color
Link       : https://github.com/latex3/fontspec/commit/beba756e14d035ba3fa4ec4617dd5b002aab2fbf

>---------------------------------------------------------------

commit beba756e14d035ba3fa4ec4617dd5b002aab2fbf
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sun Nov 5 23:27:09 2023 +0100

    document color changes


>---------------------------------------------------------------

beba756e14d035ba3fa4ec4617dd5b002aab2fbf
 CHANGES.md               |  4 ++++
 fontspec-doc-featset.tex | 50 +++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 51 insertions(+), 3 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 @@ of writing the colours in hexadecimal.
  \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 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:
+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{





More information about the latex3-commits mailing list.