summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3experimental/l3opacity.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/l3experimental/l3opacity.dtx')
-rw-r--r--macros/latex/contrib/l3experimental/l3opacity.dtx31
1 files changed, 22 insertions, 9 deletions
diff --git a/macros/latex/contrib/l3experimental/l3opacity.dtx b/macros/latex/contrib/l3experimental/l3opacity.dtx
index ba251f971d..fb293fd31c 100644
--- a/macros/latex/contrib/l3experimental/l3opacity.dtx
+++ b/macros/latex/contrib/l3experimental/l3opacity.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -65,6 +65,12 @@
% particular, using Adobe Distiller, you will need to enable transparency
% in the (text-based) configuration: this is not selectable from the GUI.
%
+% For users of PDF-based routes, note that opacity only takes effect if
+% a \cs{DocumentMetadata}|{}| is added \emph{before}
+% \cs[no-index]{documentclass}, which loads and activates
+% the PDF management.
+% See \file{pdfmanagement-testphase.pdf} for more info.
+%
% \begin{function}[added = 2021-07-01]{\opacity_select:n}
% \begin{syntax}
% \cs{opacity_select:n} \Arg{expression}
@@ -96,13 +102,21 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{l3opacity}{2024-02-20}{}
+\ProvidesExplPackage{l3opacity}{2024-03-14}{}
{L3 Experimental opacity support}
% \end{macrocode}
%
+% \begin{variable}
+% Temporary storage.
+% \begin{macrocode}
+\fp_new:N \l_@@_tmp_fp
+% \end{macrocode}
+% \end{variable}
+%
% \begin{macro}{\opacity_select:n, \opacity_fill:n, \opacity_stroke:n}
-% \begin{macro}{\@@_select:nN, \@@_select_aux:nN}
-% Thin wrapper with error checking.
+% \begin{macro}{\@@_select:nN}
+% Thin wrapper with error checking. Opacity is passed to backend
+% functions as a bounded, evaluated decimal number.
% \begin{macrocode}
\cs_new_protected:Npn \opacity_select:n #1
{ \@@_select:nN {#1} \@@_backend_select:n }
@@ -111,14 +125,13 @@
\cs_new_protected:Npn \opacity_stroke:n #1
{ \@@_select:nN {#1} \@@_backend_stroke:n }
\cs_new_protected:Npn \@@_select:nN #1#2
- { \exp_args:Ne \@@_select_aux:nN { \fp_eval:n {#1} } #2 }
-\cs_new_protected:Npn \@@_select_aux:nN #1#2
{
+ \fp_set:Nn \l_@@_tmp_fp { #1 }
\bool_lazy_or:nnTF
- { \fp_compare_p:nNn {#1} < { 0 } }
- { \fp_compare_p:nNn {#1} > { 1 } }
+ { \fp_compare_p:nNn \l_@@_tmp_fp < \c_zero_fp }
+ { \fp_compare_p:nNn \l_@@_tmp_fp > \c_one_fp }
{ \msg_error:nnn { opacity } { out-of-range } {#1} }
- { #2 {#1} }
+ { \exp_args:Ne #2 { \fp_use:N \l_@@_tmp_fp } }
}
\msg_new:nnnn { opacity } { out-of-range }
{ Opacity~value~out~of~range. }