[latex3-commits] [l3svn] branch master updated: Some color docs [ci skip]

noreply at latex-project.org noreply at latex-project.org
Fri Oct 13 22:44:13 CEST 2017


This is an automated email from the git hooks/post-receive script.

joseph pushed a commit to branch master
in repository l3svn.

The following commit(s) were added to refs/heads/master by this push:
       new  ba0474c   Some color docs [ci skip]
ba0474c is described below

commit ba0474c5dbc3b26f73673fa0307d71a6a33a241f
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Oct 13 21:44:01 2017 +0100

    Some color docs [ci skip]
---
 l3trial/l3color-extras/l3color-extras.dtx |  114 +++++++++++++++++++++++++++++
 1 file changed, 114 insertions(+)

diff --git a/l3trial/l3color-extras/l3color-extras.dtx b/l3trial/l3color-extras/l3color-extras.dtx
index 84f38a8..a81206d 100644
--- a/l3trial/l3color-extras/l3color-extras.dtx
+++ b/l3trial/l3color-extras/l3color-extras.dtx
@@ -50,32 +50,139 @@
 %
 % \begin{documentation}
 %
+% \section{Color models}
+%
+% Color may be modelled in a number of ways. The model used determines how
+% many different axes a color space has. The models supported here are
+% \begin{itemize}
+%   \item \texttt{gray} Grayscale color, with a single axis running from
+%     $0$ (fully black) to $1$ (fully white)
+%   \item \texttt{rgb} Red-green-blue color, with three axes, one for each of
+%     the components
+%   \item \texttt{cmyk} Cyan-magenta-yellow-black color, with four axes, one for
+%     each of the components
+%   \item \texttt{spot} Spot (process) color, with one value, the name of the
+%    color
+% \end{itemize}
+%
+% Additional models may be created to allow mixing of spot (process) colors
+% with each other or with those from other models. See
+% Section~\ref{l3color:sec:spot} 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
+% by the detail of the model involved.
+%
+% Color models (and interconversion) are complex, and more details are given
+% in the manual to the \LaTeXe{} \pkg{xcolor} package and in the
+% \emph{PostScript Language Reference Manual}, published by Addison--Wesley.
+%
 % \section{Color expressions}
 %
+% In addition to allowing specification of color by model and values,
+% \pkg{l3color-extras} also supports color expressions. These are created
+% by combining one or more color names, with the amount of each specified
+% as a percentage. The latter is given between |!| symbols in the expression.
+% Thus for example
+% \begin{verbatim}
+%   red!50!green
+% \end{verbatim}
+% is a mixture of $50\,\%$ red and $50\,\%$ green. A trailing percentage is
+% interpreted as implicitly followed by |white|, and so 
+% \begin{verbatim}
+%   red!25
+% \end{verbatim}
+% specifies $25\,\%$ red mixed with $75\,\%$ white.
+%
+% Where the models for the mixed colors are different, the model of the first
+% color is used. Thus
+% \begin{verbatim}
+%   red!50!cyan
+% \end{verbatim}
+% will result in a color specification using the |rgb| model, made up of
+% $50\,\%$ red and  $50\,\%$ of cyan \emph{expressed in \texttt{rgb}}. As color
+% model interconversion is not exact.
+%
+% The one exception to the above is where the first model in an expression is
+% |gray|. In this case, the order of mixing is \enquote{swapped} internally, so
+% that for example
+% \begin{verbatim}
+%   black!50!red
+% \end{verbatim}
+% has the same result as
+% \begin{verbatim}
+%   red!50!black
+% \end{verbatim}
+% (the predefined colors |black| and |white| use the |gray| model).
+%
+% Where more than two colors are mixed in an expression, evaluation takes place
+% in a stepwise fashion. Thus in
+% \begin{verbatim}
+%   cyan!50!magenta!10!yellow
+% \end{verbatim}
+% the sub-expression
+% \begin{verbatim}
+%   cyan!50!magenta
+% \end{verbatim}
+% is first evaluated to give an intermediate color specification, before
+% the second step
+% \begin{verbatim}
+%   <intermediate>!10!yellow
+% \end{verbatim}
+% where |<intermediate>| represents this transitory calculated value.
+%
+% Within a color expression, |.| may be used to represent the color active
+% for typesetting (the current color). This allows for example
+% \begin{verbatim}
+%   .!50
+% \end{verbatim}
+% to mean a mixture of $50\,\%$ of current color with white.
+%
+% (Color expressions supported here are a subset of those provided by
+% the \LaTeXe{} \pkg{xcolor} package. At present, only such features as are
+% clearly useful have been added here.)
+%
 % \section{Named colors}
 %
+% Color names are stored in a single namespace, which makes them accessible
+% as part of color expressions. Whilst they are not reserved in a technical
+% sense, the names |black|, |white|, |red|, |green|, |blue|, |cyan|, |magenta|
+% and |yellow| have special meaning and should not be redefined. Color names
+% should be made up of letters, numbers and spaces only: other characters are
+% reserved for use in color expressions. In particular, |.| represents the
+% current color at the start of a color expression.
+%
 % \begin{function}{\color_set:nn}
 %   \begin{syntax}
 %     \cs{color_set:nn} \Arg{name} \Arg{color expression}
 %   \end{syntax}
+%   Evaluates the \meta{color expression} and stores the resulting
+%   color specification as the \meta{name}.
 % \end{function}
 %
 % \begin{function}{\color_set:nnn}
 %   \begin{syntax}
 %     \cs{color_set:nnn} \Arg{name} \Arg{model} \Arg{value(s)}
 %   \end{syntax}
+%   Stores the color specification equivalent to the \meta{model} and
+%   \meta{values} as the \meta{name}.
 % \end{function}
 %
 % \begin{function}{\color_set_eq:nn}
 %   \begin{syntax}
 %     \cs{color_set_eq:nn} \Arg{name1} \Arg{name2}
 %   \end{syntax}
+%   Copies the color specification in \meta{name2} to \meta{name1}. The
+%   special name |.| may be used to represent the current color, allowing
+%   it to be saved to a name.
 % \end{function}
 %
 % \begin{function}{\color_show:n}
 %   \begin{syntax}
 %     \cs{color_show:n} \Arg{name}
 %   \end{syntax}
+%   Displays the color specification stored in the \meta{name} on the
+%   terminal
 % \end{function}
 %
 % \section{Selecting colors}
@@ -84,14 +191,21 @@
 %   \begin{syntax}
 %     \cs{color_select:n} \Arg{color expression}
 %   \end{syntax}
+%   Parses the \meta{color expression} and then activates the resulting
+%   color specification for typeset material.
 % \end{function}
 %
 % \begin{function}{\color_select:nn}
 %   \begin{syntax}
 %     \cs{color_select:nn} \Arg{model} \Arg{value(s)}
 %   \end{syntax}
+%   Activates the color specification equivalent to the \meta{model} and
+%   \meta{value(s)} for typeset material.
 % \end{function}
 %
+% \section{Spot colors}
+% \label{l3color:sec:spot}
+%
 % \end{documentation}
 %
 % \begin{implementation}

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the latex3-commits mailing list