[latex3-commits] [l3svn] 02/04: Add \color_show:n
noreply at latex-project.org
noreply at latex-project.org
Wed Oct 11 18:38:52 CEST 2017
This is an automated email from the git hooks/post-receive script.
joseph pushed a commit to branch master
in repository l3svn.
commit aaa91782e8fb845df06d6268cd31ed643012832e
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Wed Oct 11 17:00:14 2017 +0100
Add \color_show:n
---
l3trial/l3color-extra/l3color-extra.dtx | 63 +++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)
diff --git a/l3trial/l3color-extra/l3color-extra.dtx b/l3trial/l3color-extra/l3color-extra.dtx
index f79300e..349828e 100644
--- a/l3trial/l3color-extra/l3color-extra.dtx
+++ b/l3trial/l3color-extra/l3color-extra.dtx
@@ -72,6 +72,12 @@
% \end{syntax}
% \end{function}
%
+% \begin{function}{\color_show:n}
+% \begin{syntax}
+% \cs{color_show:n} \meta{name}
+% \end{syntax}
+% \end{function}
+%
% \section{Selecting colors}
%
% \begin{function}{\color_select:n}
@@ -591,6 +597,53 @@
\color_set:nnn { blue } { rgb } { 0 , 0 , 1 }
% \end{macrocode}
%
+% \subsection{Diagnostics}
+%
+% \begin{macro}{\color_show:n}
+% \begin{macro}[aux]{\@@_show:n}
+% \begin{macro}[aux]{\@@_show:w}
+% \begin{macro}[aux]{\@@_show_gray:w, \@@_show_rgb:w, \@@_show_cmyk:w}
+% Extract the information about a color and format for the user: the approach
+% is similar to the keys module here.
+% \begin{macrocode}
+\cs_new_protected:Npn \color_show:n #1
+ {
+ \@@_if_defined:nTF {#1}
+ {
+ \__msg_show_pre:nnxxxx { LaTeX / color } { show }
+ {#1} { t } { } { }
+ \exp_args:Nv \@@_show:n { l_@@_named_ #1 _tl }
+ }
+ {
+ \__msg_show_pre:nnxxxx { LaTeX / color } { show }
+ {#1} { f } { } { }
+ \__msg_show_wrap:n { }
+ }
+ }
+\cs_new_protected:Npn \@@_show:n #1
+ { \@@_show:w #1 \q_stop }
+\cs_new_protected:Npn \@@_show:w #1 ~ #2 \q_stop
+ {
+ \use:x
+ {
+ \__msg_show_wrap:n
+ {
+ \exp_not:N \__msg_show_item_unbraced:nn { model }
+ {#1}
+ \exp_not:N \__msg_show_item_unbraced:nn { value }
+ { \use:c { @@_show_ #1 :w } #2 \q_stop }
+ }
+ }
+ }
+\cs_new:Npn \@@_show_gray:w #1 \q_stop { #1 }
+\cs_new:Npn \@@_show_rgb:w #1 ~ #2 ~ #3 \q_stop { #1 ,~ #2 ,~ #3 }
+\cs_new:Npn \@@_show_cmyk:w #1 ~ #2 ~ #3 ~ #4 \q_stop { #1 ,~ #2 ,~ #3 ,~ #4 }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
% \subsection{Messages}
%
% \begin{macrocode}
@@ -608,6 +661,16 @@
}
% \end{macrocode}
%
+% \begin{macrocode}
+\__msg_kernel_new:nnn { color } { show }
+ {
+ The~color~#1~
+ \str_if_eq:nnTF {#2} { t }
+ { has~the~properties: }
+ { is~undefined. }
+ }
+% \end{macrocode}
+%
% \begin{macrocode}
%</initex|package>
% \end{macrocode}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the latex3-commits
mailing list