summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3experimental/l3color.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-08-08 03:01:09 +0000
committerNorbert Preining <norbert@preining.info>2020-08-08 03:01:09 +0000
commit1c9455caf30309c8b8ba69afdc5a16a83d9f9a58 (patch)
tree0bc3971e599005a7420c53782539e789de57b40d /macros/latex/contrib/l3experimental/l3color.dtx
parent3710c23789342d9d88783cbe9ad23eb5263a7c33 (diff)
CTAN sync 202008080301
Diffstat (limited to 'macros/latex/contrib/l3experimental/l3color.dtx')
-rw-r--r--macros/latex/contrib/l3experimental/l3color.dtx565
1 files changed, 553 insertions, 12 deletions
diff --git a/macros/latex/contrib/l3experimental/l3color.dtx b/macros/latex/contrib/l3experimental/l3color.dtx
index 91cb13e0b4..42151e2a41 100644
--- a/macros/latex/contrib/l3experimental/l3color.dtx
+++ b/macros/latex/contrib/l3experimental/l3color.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Released 2020-07-17}
+% \date{Released 2020-08-07}
%
% \maketitle
%
@@ -95,7 +95,7 @@
%
% Additional models may be created to allow mixing of spot colors
% with each other or with those from other models. See
-% Section~\ref{l3color:sec:spot} for more detail of spot color support.
+% Section~\ref{l3color:sec:new-models} for more detail of spot color support.
%
% When color is selected by model, the \meta{values} given are specified as
% a comma-separated list. The length of the list will therefore be determined
@@ -215,6 +215,9 @@
%
% \section{Selecting colors}
%
+% General selection of color is safe when split across pages: a stack is
+% used to ensure that the correct color is re-selected on the new page.
+%
% \begin{function}{\color_select:n}
% \begin{syntax}
% \cs{color_select:n} \Arg{color expression}
@@ -237,6 +240,37 @@
% and similar are not influenced by this setting.
% \end{variable}
%
+% \section{Colors for drawing: fills and strokes}
+%
+% Colors for drawing operations and so forth are split into strokes and fills
+% (the latter may also be referred to as non-stroke color). These operations
+% \emph{may} apply to text, but this is backend-depended and the general
+% \cs{color_select:n(n)} should be used for typeset text. In contrast to
+% general color, these operations are \emph{not} stacked and thus must
+% \emph{not} split across pages. Also, an appropriate scope must be applied
+% to the color change, for example \cs{draw_begin:}/\cs{draw_end:}.
+%
+% \begin{function}{\color_fill:n, \color_stroke:n}
+% \begin{syntax}
+% \cs{color_fill:n} \Arg{color expression}
+% \end{syntax}
+% Parses the \meta{color expression} and then activates the resulting
+% color specification for filling or stroking.
+% \end{function}
+%
+% \begin{function}{\color_fill:nn, \color_stroke:nn}
+% \begin{syntax}
+% \cs{color_fill:nn} \Arg{model(s)} \Arg{value(s)}
+% \end{syntax}
+% Activates the color specification equivalent to the \meta{model(s)} and
+% \meta{value(s)} for filling or stroking.
+% \end{function}
+%
+% \begin{variable}{color.fc, color.sc}
+% When using \texttt{dvips}, these PostScript variables hold the fill and
+% stroke color, respectively.
+% \end{variable}
+%
% \section{Multiple color models}
%
% When selecting or setting a color with an explicit model, it is possible
@@ -302,8 +336,59 @@
% assigns the data to the \meta{tl}.
% \end{function}
%
-% \section{Spot colors}
-% \label{l3color:sec:spot}
+% \section{Creating new color models}
+% \label{l3color:sec:new-models}
+%
+% Additional color models are required to support specialist workflows, for
+% example those involving separations (see
+% \url{https://helpx.adobe.com/indesign/using/spot-process-colors.html}
+% for details of the use of separations in print). Color models may be split
+% into families; in the case of the basic \texttt{cmyk}, \texttt{gray}
+% and \texttt{rgb} models, the family and the model itself are synonymous. This
+% is not generally the case: see the PDF reference for more details.
+%
+% \begin{function}{\color_model_new:nnn}
+% \begin{syntax}
+% \cs{color_model_new:nnn} \Arg{model} \Arg{family} \Arg{params}
+% \end{syntax}
+% Creates a new \meta{model} which is derived from the color model \meta{family}.
+% The latter should be one of
+% \begin{itemize}
+% \item \texttt{Separation}
+% \end{itemize}
+% (The \meta{family} may be given in mixed case as-in the PDF reference:
+% internally, case of these strings is folded.)
+% Depending on the \meta{family}, one or more \meta{params} are mandatory or
+% optional.
+% \end{function}
+%
+% For a \texttt{Separation} space, there are three \emph{compulsory} keys.
+% \begin{itemize}
+% \item \texttt{name} The name of the Separation, for example the formal
+% name of a spot color ink. Such a \meta{name} may contain spaces, etc.,
+% which are not permitted in the \meta{model}.
+% \item \texttt{alternative-model} An alternative device colorspace, one of
+% \texttt{cmyk}, \texttt{rgb}, \texttt{gray} or \texttt{cielab}. The three
+% parameter-based models work as described above; see below for
+% details of CIELAB colors.
+% \item \texttt{alternative-values} A comma-separated list of values
+% appropriate to the \texttt{alternative-model}. This information is used by
+% the PDF application if the \texttt{Separation} is not available.
+% \end{itemize}
+%
+% CIELAB color separations are created using the
+% \texttt{alternative-model = cielab} setting. These colors must also have an
+% \texttt{illuminant} key, one of \texttt{a}, \texttt{c}, \texttt{e},
+% \texttt{d50}, \texttt{d55}, \texttt{d65} or \texttt{d75}. The
+% \texttt{alternative-values} in this case are the three parameters $L*$, $a*$
+% and $b*$ of the CIELAB model. Full details of this device-independent color
+% approach are given in the documentation to the \pkg{colorspace} package.
+%
+% CIELAB colors \emph{cannot} be converted into other device-dependent color
+% spaces, and as such, mixing can only occur if colors set up using the CIELAB
+% model are also given with an alternative parameter-based model. If that is
+% not the case, \pkg{l3color} will fallback to using black as the colorant in
+% any mixing.
%
% \end{documentation}
%
@@ -312,7 +397,7 @@
% \section{\pkg{l3color} Implementation}
%
% \begin{macrocode}
-%<*initex|package>
+%<*package>
% \end{macrocode}
%
% \begin{macrocode}
@@ -320,10 +405,8 @@
% \end{macrocode}
%
% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage{l3color}{2020-07-17}{}
+\ProvidesExplPackage{l3color}{2020-08-07}{}
{L3 Experimental color support}
-%</package>
% \end{macrocode}
%
% \subsection{Predefined color names}
@@ -419,10 +502,12 @@
\cs_generate_variant:Nn \@@_convert:nnN { VV }
\cs_new_protected:Npn \@@_convert:nnnN #1#2#3#4
{
- \str_if_eq:nnT {#1} { spot } % TO DO!!!
- { }
\tl_set:Nx #4
- { \use:c { @@_convert_ #1 _ #2 :w } #3 ~ 0 ~ 0 ~ 0 \s_@@_stop }
+ {
+ \cs_if_exist:cTF { @@_convert_ #1 _ #2 :w }
+ { \use:c { @@_convert_ #1 _ #2 :w } #3 ~ 0 ~ 0 ~ 0 \s_@@_stop }
+ { \use:c { c_@@_fallback_ #2 _tl } }
+ }
}
\cs_generate_variant:Nn \@@_convert:nnnN { nV , nnV }
\cs_new:Npn \@@_convert_gray_rgb:w #1 ~ #2 \s_@@_stop
@@ -993,6 +1078,41 @@
% \end{macro}
% \end{macro}
%
+% \subsection{Fill and stroke color}
+%
+% \begin{macro}{\color_fill:n, \color_stroke:n}
+% \begin{macro}{\color_fill:nn, \color_stroke:nn}
+% \begin{macro}{\@@_draw:nnn}
+% \begin{macrocode}
+\cs_new_protected:Npn \color_fill:n #1
+ {
+ \@@_parse:nN {#1} \l_@@_current_tl
+ \exp_after:wN \@@_draw:nnn \l_@@_current_tl { fill }
+ }
+\cs_new_protected:Npn \color_stroke:n #1
+ {
+ \@@_parse:nN {#1} \l_@@_current_tl
+ \exp_after:wN \@@_draw:nnn \l_@@_current_tl { stroke }
+ }
+\cs_new_protected:Npn \color_fill:nn #1#2
+ {
+ \@@_select_main:Nw \l_@@_current_tl
+ #1 / / \s_@@_mark #2 / / \s_@@_stop
+ \exp_after:wN \@@_draw:nnn \l_@@_current_tl { fill }
+ }
+\cs_new_protected:Npn \color_stroke:nn #1#2
+ {
+ \@@_select_main:Nw \l_@@_current_tl
+ #1 / / \s_@@_mark #2 / / \s_@@_stop
+ \exp_after:wN \@@_draw:nnn \l_@@_current_tl { stroke }
+ }
+\cs_new_protected:Npn \@@_draw:nnn #1#2#3
+ { \use:c { @@_backend_ #3 _ #1 :n } {#2} }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
% \subsection{Defining named colors}
%
% \begin{variable}{\l_@@_named_tl}
@@ -1279,6 +1399,357 @@
% \end{macro}
% \end{macro}
%
+% \subsection{Additional color models}
+%
+% \begin{variable}{\l_@@_internal_prop}
+% \begin{macrocode}
+\prop_new:N \l_@@_internal_prop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\g_@@_separation_int}
+% A tracker for the total number of separations.
+% \begin{macrocode}
+\int_new:N \g_@@_separation_int
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}
+% {
+% \c_@@_model_whitepoint_cielab_a_tl ,
+% \c_@@_model_whitepoint_cielab_b_tl ,
+% \c_@@_model_whitepoint_cielab_e_tl ,
+% \c_@@_model_whitepoint_cielab_d50_tl ,
+% \c_@@_model_whitepoint_cielab_d55_tl ,
+% \c_@@_model_whitepoint_cielab_d65_tl ,
+% \c_@@_model_whitepoint_cielab_d75_tl
+% }
+% Whitepoint data for the CIELAB profiles.
+% \begin{macrocode}
+\tl_const:Nn \c_@@_model_whitepoint_cielab_a_tl { 1.0985 ~ 1 ~ 0.3558 }
+\tl_const:Nn \c_@@_model_whitepoint_cielab_b_tl { 0.9807~ 1 ~ 1.1822 }
+\tl_const:Nn \c_@@_model_whitepoint_cielab_e_tl { 1 ~ 1 ~ 1 }
+\tl_const:cn { c_@@_model_whitepoint_cielab_d50_tl } { 0.9642 ~, 1 ~ 0.8251 }
+\tl_const:cn { c_@@_model_whitepoint_cielab_d55_tl } { 0.9568 ~ 1 ~ 0.9214 }
+\tl_const:cn { c_@@_model_whitepoint_cielab_d65_tl } { 0.9504 ~ 1 ~ 1.0888 }
+\tl_const:cn { c_@@_model_whitepoint_cielab_d75_tl } { 0.9497 ~ 1 ~ 1.2261 }
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\c_@@_model_range_cielab_tl}
+% The range for CIELAB color spaces.
+% \begin{macrocode}
+\tl_const:Nn \c_@@_model_range_cielab_tl { -128 ~ 127 ~ -128 ~ 127 }
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\color_model_new:nnn, \@@_model_new:nnn}
+% \begin{macro}{\@@_model_separation:n}
+% \begin{macro}{\@@_model_separation:nn}
+% \begin{macro}{\@@_model_separation:nnn}
+% \begin{macro}{\@@_model_separation:w}
+% \begin{macro}
+% {
+% \@@_model_separation_cmyk:nnnnnn ,
+% \@@_model_separation_gray:nnnnnn ,
+% \@@_model_separation_rgb:nnnnnn
+% }
+% \begin{macro}{\@@_model_convert:nnn}
+% \begin{macro}{\@@_model_separation_cielab:nnnnnn}
+% \begin{macro}{\@@_model_separation_cielab:nnnnnnn}
+% \begin{macro}{\@@_model_separation_init:nnnnn}
+% \begin{macro}{\@@_model_separation_init_cielab:n}
+% \begin{macro}{\@@_model_separation_init_cielab:nnnnn}
+% Set up a new model: in general this has to be handled by a family-dependent
+% function. To avoid some \enquote{interesting} questions with casing, we
+% fold the case of the family name. The key--value list should always be
+% present, so we convert it up-front to a |prop|, then deal with the detail
+% on a per-family basis.
+% \begin{macrocode}
+\cs_new_protected:Npn \color_model_new:nnn #1#2#3
+ {
+ \exp_args:Nee \@@_model_new:nnn
+ { \tl_to_str:n {#1} }
+ { \str_foldcase:n {#2} } {#3}
+ }
+\cs_new_protected:Npn \@@_model_new:nnn #1#2#3
+ {
+ \cs_if_exist:cTF { @@_parse_model_ #1 :w }
+ {
+ \__kernel_msg_error:nnn { color } { model-already-defined } {#1}
+ }
+ {
+ \cs_if_exist:cTF { @@_model_ #2 :n }
+ {
+ \prop_set_from_keyval:Nn \l_@@_internal_prop {#3}
+ \use:c { @@_model_ #2 :n } {#1}
+ }
+ {
+ \__kernel_msg_error:nnn { color } { unknown-model-type } {#2}
+ }
+ }
+ }
+% \end{macrocode}
+% Separations must have a \enquote{real} name, which is pretty easy to find.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_model_separation:n #1
+ {
+ \prop_get:NnNTF \l_@@_internal_prop { name }
+ \l_@@_internal_tl
+ {
+ \exp_args:NV \@@_model_separation:nn
+ \l_@@_internal_tl {#1}
+ }
+ {
+ \__kernel_msg_error:nnn { color }
+ { separation-requires-name } {#1}
+ }
+ }
+% \end{macrocode}
+% We have two keys to find at this stage: the alternative space model
+% and linked values.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_model_separation:nn #1#2
+ {
+ \prop_get:NnNTF \l_@@_internal_prop { alternative-model }
+ \l_@@_internal_tl
+ {
+ \exp_args:NV \@@_model_separation:nnn
+ \l_@@_internal_tl {#2} {#1}
+ }
+ {
+ \__kernel_msg_error:nnn { color }
+ { separation-alternative-model } {#2}
+ }
+ }
+\cs_new_protected:Npn \@@_model_separation:nnn #1#2#3
+ {
+ \cs_if_exist:cTF { @@_model_separation_ #1 :nnnnnn }
+ {
+ \prop_get:NnNTF \l_@@_internal_prop { alternative-values }
+ \l_@@_internal_tl
+ {
+ \exp_after:wN \@@_model_separation:w \l_@@_internal_tl
+ , 0 , 0 , 0 , 0 \s_@@_stop {#2} {#3} {#1}
+ }
+ {
+ \__kernel_msg_error:nnn { color }
+ { separation-alternative-values } {#2}
+ }
+ }
+ {
+ \__kernel_msg_error:nnn { color }
+ { unknown-alternative-model } {#1}
+ }
+ }
+% \end{macrocode}
+% As each alternative space leads to a different requirement for conversion,
+% and as there are only a small number of choices, we manually split the data
+% and then set up. Notice that mixing tints is really just the same
+% as mixing \texttt{gray}. The \texttt{white} color is special, as it allows
+% tints to be adjusted without an additional color space. To make sure the
+% data is set for that at all group levels, we need to work on a per-level
+% basis. Within the output, only the set-up needs the \enquote{real} name
+% of the colorspace: we use a simple tracking number for general usage
+% as this is a clear namespace without issues of escaping chars.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_model_separation:w
+ #1 , #2 , #3 , #4 , #5 \s_@@_stop #6#7#8
+ {
+ \int_gincr:N \g_@@_separation_int
+ \tl_const:cn { c_@@_fallback_ #6 _tl } { 1 }
+ \cs_new_eq:cN { @@_parse_mix_ #6 :nw } \@@_parse_mix_gray:nw
+ \cs_new:cpn { @@_parse_model_ #6 :w } ##1 , ##2 \s_@@_stop
+ { {#6} { \@@_parse_number:n {##1} } }
+ \clist_map_inline:nn { fill , stroke , select }
+ {
+ \cs_new_protected:cpx { @@_backend_ ##1 _ #6 :n } ####1
+ {
+ \exp_not:c { @@_backend_ ##1 _ separation:nn }
+ { color \int_use:N \g_@@_separation_int } {####1}
+ }
+ }
+ \use:c { @@_model_separation_ #8 :nnnnnn }
+ {#6} {#7} {#1} {#2} {#3} {#4}
+ \cs_new_protected:cpx { @@_model_ #6 _white: }
+ {
+ \prop_put:Nnn \exp_not:N \l_@@_named_white_prop {#6} { 0 }
+ \exp_not:N \int_compare:nNnF { \tex_currentgrouplevel:D } = 0
+ { \group_insert_after:N \exp_not:c { @@_model_ #6 _ white: } }
+ }
+ \use:c { @@_model_ #6 _white: }
+ }
+\cs_new_protected:Npn \@@_model_separation_cmyk:nnnnnn #1#2#3#4#5#6
+ {
+ \cs_new:cpn { @@_convert_ #1 _cmyk:w } ##1 ~ ##2 \s_@@_stop
+ {
+ \fp_eval:n {##1 * #3} ~
+ \fp_eval:n {##1 * #4} ~
+ \fp_eval:n {##1 * #5} ~
+ \fp_eval:n {##1 * #6}
+ }
+ \@@_model_convert:nnn {#1} { cmyk } { rgb }
+ \@@_model_convert:nnn {#1} { cmyk } { gray }
+ \@@_model_separation_init:nnnnn {#2} { /DeviceCMYK } { }
+ { 0 ~ 0 ~ 0 ~ 0 } { #3 ~ #4 ~ #5 ~ #6 }
+ }
+\cs_new_protected:Npn \@@_model_separation_rgb:nnnnnn #1#2#3#4#5#6
+ {
+ \cs_new:cpn { @@_convert_ #1 _rgb:w } ##1 ~ ##2 \s_@@_stop
+ {
+ \fp_eval:n {##1 * #3} ~
+ \fp_eval:n {##1 * #4} ~
+ \fp_eval:n {##1 * #5}
+ }
+ \@@_model_convert:nnn {#1} { rgb } { cmyk }
+ \@@_model_convert:nnn {#1} { rgb } { gray }
+ \@@_model_separation_init:nnnnn {#2} { /DeviceRGB } { }
+ { 0 ~ 0 ~ 0 } { #3 ~ #4 ~ #5 }
+ }
+\cs_new_protected:Npn \@@_model_separation_gray:nnnnnn #1#2#3#4#5#6
+ {
+ \cs_new:cpn { @@_convert_ #1 _cmyk:w } ##1 ~ ##2 \s_@@_stop
+ {
+ \fp_eval:n {##1 * #3} ~
+ \fp_eval:n {##1 * #3} ~
+ \fp_eval:n {##1 * #3} ~
+ \fp_eval:n {##1 * #3}
+ }
+ \cs_new:cpn { @@_convert_ #1 _gray:w } ##1 ~ ##2 \s_@@_stop
+ { \fp_eval:n {##1 * #3} }
+ \cs_new:cpn { @@_convert_ #1 _rgb:w } ##1 ~ ##2 \s_@@_stop
+ {
+ \fp_eval:n {##1 * #3} ~
+ \fp_eval:n {##1 * #3} ~
+ \fp_eval:n {##1 * #3}
+ }
+ \@@_model_separation_init:nnnnn {#2} { /DeviceGray } { } { 0 } {#3}
+ }
+% \end{macrocode}
+% Generic model conversion \emph{via} an alternative intermediate.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_model_convert:nnn #1#2#3
+ {
+ \cs_new:cpx { @@_convert_ #1 _ #3 :w } ##1 ~ ##2 \s_@@_stop
+ {
+ \exp_not:N \exp_args:NNe \exp_not:N \use:nn
+ \exp_not:c { @@_convert_ #2 _ #3 :w }
+ { \exp_not:c { @@_convert_ #1 _ #2 :w } ##1 ~ ##2 \s_@@_stop }
+ \c_space_tl \exp_not:N \s_@@_stop
+ }
+ }
+% \end{macrocode}
+% Setting up for CIELAB needs a bit more work: there is the illuminant and
+% the need for an appropriate object.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_model_separation_cielab:nnnnnn #1#2#3#4#5#6
+ {
+ \prop_get:NnNF \l_@@_internal_prop { illuminant }
+ \l_@@_internal_tl
+ {
+ \__kernel_msg_error:nnn { color }
+ { cielab-requires-illuminant } {#1}
+ \tl_set:Nn \l_@@_internal_tl { d50 }
+ }
+ \exp_args:NV \@@_model_separation_cielab:nnnnnnn
+ \l_@@_internal_tl {#1} {#2} {#3} {#4} {#5} {#6}
+ }
+% \end{macrocode}
+% If a CIELAB space is being set up, we need the illuminant, then create
+% the appropriate set up. At present, this doesn't include \texttt{BlackPoint}
+% or \texttt{Range} data, but that may be added later. As CIELAB colors
+% cannot be converted to anything else, we fallback to producing black: the
+% user should set up a second model for colors set up this way.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_model_separation_cielab:nnnnnnn #1#2#3#4#5#6#7
+ {
+ \tl_if_exist:cTF { c_@@_model_whitepoint_cielab_ #1 _tl }
+ {
+ \@@_model_separation_init_cielab:n {#1}
+ \@@_model_separation_init_cielab:nnnnn {#2} {#3} {#4} {#5} {#6}
+ \cs_new:cpn { @@_convert_ #2 _cmyk:w } ##1 ~ ##2 \s_@@_stop
+ { 0 ~ 0 ~ 0 ~ 1 }
+ \cs_new:cpn { @@_convert_ #2 _rgb:w } ##1 ~ ##2 \s_@@_stop
+ { 1 ~ 1 ~ 1 }
+ \cs_new:cpn { @@_convert_ #2 _gray:w } ##1 ~ ##2 \s_@@_stop
+ { 1 }
+ }
+ {
+ \__kernel_msg_error:nnn { color }
+ { unknown-cielab-illuminant } {#1}
+ }
+ }
+% \end{macrocode}
+% Initialising the PDF structures needs two parts: creating an object
+% containing the \enquote{real} name of the Separation, then adding a reference
+% to that to each page. The latter uses the internal name of the \texttt{cs}.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_model_separation_init:nnnnn #1#2#3#4#5
+ {
+ \pdf_object_now:nx { array }
+ {
+ /Separation
+ / \str_convert_pdfname:n {#1} ~ #2 ~
+ <<
+ /FunctionType ~ 2
+ /Domain ~ [0 ~ 1]
+ \tl_if_blank:nF {#3} { /Range ~ [#3] }
+ /C0 ~ [#4] ~
+ /C1 ~ [#5] /N ~ 1
+ >>
+ }
+ \use:x
+ {
+ \pdfcoredict_gput:nnn
+ { Page / Resources / ColorSpace }
+ { color \int_use:N \g_@@_separation_int }
+ { \pdf_object_last: }
+ }
+ }
+\cs_if_exist:NF \pdf_object_now:nn
+ { \cs_gset_protected:Npn \@@_model_separation_init:nnnnn #1#2#3#4#5 { } }
+% \end{macrocode}
+% For CIELAB colors, we need one object per document for the illuminant,
+% plus initialisation of the color space referencing that object.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_model_separation_init_cielab:n #1
+ {
+ \pdf_object_new:nn { @@_illuminant_cielab_ #1 } { array }
+ \pdf_object_write:nx { @@_illuminant_cielab_ #1 }
+ {
+ /Lab ~
+ <<
+ /WhitePoint ~
+ [ \tl_use:c { c_@@_model_whitepoint_cielab_ #1 _tl } ]
+ /Range ~ [ \c_@@_model_range_lab_tl ]
+ >>
+ }
+ }
+\cs_if_exist:NF \pdf_object_new:nn
+ { \cs_gset_protected:Npn \@@_model_separation_init_cielab:n #1 { } }
+\cs_new_protected:Npn \@@_model_separation_init_cielab:nnnnn #1#2#3#4#5
+ {
+ \@@_model_separation_init:nnnnn
+ {#2}
+ { \pdf_object_ref:n { @@_illuminant_cielab_ #1 } }
+ { \c_@@_model_range_lab_tl }
+ { 100 ~ 0 ~ 0 }
+ { #3 ~ #4 ~ #5 }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
% \subsection{Diagnostics}
%
% \begin{macro}{\color_show:n}
@@ -1313,24 +1784,94 @@
% \subsection{Messages}
%
% \begin{macrocode}
+\__kernel_msg_new:nnnn { color } { cielab-requires-illuminant }
+ { CIELAB~color~space~'#1'~require~an~illuminant. }
+ {
+ LaTeX~has~been~asked~to~create~a~separation~color~space~using~
+ CIELAB~specifications,~but~no~\\ \\
+ \iow_indent:n { illuminant = <basis> }
+ \\ \\
+ key~was~given~with~the~correct~information.~LaTeX~will~use~illuminant~
+ 'd50'~for~recovery.
+ }
+\__kernel_msg_new:nnnn { color } { conversion-not-available }
+ { No~model~conversion~available~from~'#1'~to~'#2'. }
+ {
+ LaTeX~has~been~asked~to~convert~a~color~from~model~'#1'~
+ to~model'#2',~but~there~is~no~method~available~to~do~that.
+ }
+\__kernel_msg_new:nnnn { color } { model-already-defined }
+ { Color~model~'#1'~already~defined. }
+ {
+ LaTeX~was~asked~to~define~a~new~color~model~called~'#1',~but~
+ this~color~model~already~exists.
+ }
+\__kernel_msg_new:nnnn { color } { separation-alternative-model }
+ { Separation~color~space~'#1'~require~an~alternative~model. }
+ {
+ LaTeX~has~been~asked~to~create~a~separation~color~space,~
+ but~no~\\ \\
+ \iow_indent:n { alternative-model = <model> }
+ \\ \\
+ key~was~given~with~the~correct~information.
+ }
+\__kernel_msg_new:nnnn { color } { separation-alternative-values }
+ { Separation~color~space~'#1'~require~values~for~the~alternative~space. }
+ {
+ LaTeX~has~been~asked~to~create~a~separation~color~space,~
+ but~no~\\ \\
+ \iow_indent:n { alternative-values = <model> }
+ \\ \\
+ key~was~given~with~the~correct~information.
+ }
+\__kernel_msg_new:nnnn { color } { separation-requires-name }
+ { Separation~color~space~'#1'~require~a~formal~name. }
+ {
+ LaTeX~has~been~asked~to~create~a~separation~color~space,~
+ but~no~\\ \\
+ \iow_indent:n { name = <formal~name> }
+ \\ \\
+ key~was~given~with~the~correct~information.
+ }
\__kernel_msg_new:nnnn { color } { unknown-color }
{ Unknown~color~'#1'. }
{
LaTeX~has~been~asked~to~use~a~color~named~'#1',~
but~this~has~never~been~defined.
}
+\__kernel_msg_new:nnnn { color } { unknown-alternative-model }
+ { Separation~color~space~'#1'~require~an~valid~alternative~space. }
+ {
+ LaTeX~has~been~asked~to~create~a~separation~color~space,~
+ but~the~model~given~as\\ \\
+ \iow_indent:n { alternative-model = <model> }
+ \\ \\
+ is~unknown.
+ }
\__kernel_msg_new:nnnn { color } { unknown-export-format }
{ Unknown~export~format~'#1'. }
{
LaTeX~has~been~asked~to~export~a~color~in~format~'#1',~
but~this~has~never~been~defined.
}
+\__kernel_msg_new:nnnn { color } { unknown-cielab-illuminant }
+ { Unknown~illuminant~model~'#1'. }
+ {
+ LaTeX~has~been~asked~to~use~create~a~color~space~using~CIELAB~
+ illuminant~'#1',~but~this~does~not~exist.
+ }
\__kernel_msg_new:nnnn { color } { unknown-model }
{ Unknown~color~model~'#1'. }
{
LaTeX~has~been~asked~to~use~a~color~model~called~'#1',~
but~this~model~is~not~set~up.
}
+\__kernel_msg_new:nnnn { color } { unknown-model-type }
+ { Unknown~color~model~type~'#1'. }
+ {
+ LaTeX~has~been~asked~to~create~a~new~color~model~called~'#1',~
+ but~this~type~of~model~was~never~set~up.
+ }
% \end{macrocode}
%
% \begin{macrocode}
@@ -1344,7 +1885,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-%</initex|package>
+%</package>
% \end{macrocode}
%
% \end{implementation}