summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3experimental/l3opacity/l3opacity.sty
blob: fb7b9c97bd39836f35b0d67179c0241938cff44f (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-2024 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}{2024-03-14}{}
  {L3 Experimental opacity support}
\fp_new:N \l__opacity_tmp_fp
\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
  {
    \fp_set:Nn \l__opacity_tmp_fp { #1 }
    \bool_lazy_or:nnTF
      { \fp_compare_p:nNn \l__opacity_tmp_fp < \c_zero_fp }
      { \fp_compare_p:nNn \l__opacity_tmp_fp > \c_one_fp }
      { \msg_error:nnn { opacity } { out-of-range } {#1} }
      { \exp_args:Ne #2 { \fp_use:N \l__opacity_tmp_fp } }
  }
\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'.