summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3experimental/l3opacity/l3opacity.sty
blob: 3451a2a7c1b0a5a1e9fac38f20eadc497b613537 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
%%
%% This is file `l3opacity.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% l3opacity.dtx  (with options: `package')
%% 
%% Copyright (C) 2021 The LaTeX Project
%% 
%% It may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License (LPPL), either version 1.3c of
%% this license or (at your option) any later version.  The latest
%% version of this license is in the file:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% This file is part of the "l3experimental bundle" (The Work in LPPL)
%% and all files in that bundle must be distributed together.
%% 
%% File: l3opacity.dtx
\RequirePackage{expl3}
\ProvidesExplPackage{l3opacity}{2021-08-04}{}
  {L3 Experimental opacity support}
\cs_new_protected:Npn \opacity_select:n #1
  { \__opacity_select:nN {#1} \__opacity_backend_select:n }
\cs_new_protected:Npn \opacity_fill:n #1
  { \__opacity_select:nN {#1} \__opacity_backend_fill:n }
\cs_new_protected:Npn \opacity_stroke:n #1
  { \__opacity_select:nN {#1} \__opacity_backend_stroke:n }
\cs_new_protected:Npn \__opacity_select:nN #1#2
  { \exp_args:Ne \__opacity_select_aux:nN { \fp_eval:n {#1} } #2 }
\cs_new_protected:Npn \__opacity_select_aux:nN #1#2
  {
    \bool_lazy_or:nnTF
      { \fp_compare_p:nNn {#1} < { 0 } }
      { \fp_compare_p:nNn {#1} > { 1 } }
      { \msg_error:nnn { opacity } { out-of-range } {#1} }
      { #2 {#1} }
  }
\msg_new:nnnn { opacity } { out-of-range }
  { Opacity~value~out~of~range. }
  {
    LaTeX~was~asked~to~set~opacity~of~#1,~but~only~values~in~the~range~
    0~to~1~are~supported.
  }
%% 
%%
%% End of file `l3opacity.sty'.