Skip to content

Commit

Permalink
test if l3color model exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrike Fischer committed Feb 12, 2021
1 parent a3632ef commit 38155f4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion firstaid/xcolor-patches-tmp-ltx.sty
@@ -1,10 +1,17 @@
%% LaTeX2e file `xcolor-patches.sty'
%%
\ProvidesPackage{xcolor-patches-tmp}[2021/02/10 v0.2 patch xcolor for l3color]
\ProvidesPackage{xcolor-patches-tmp-ltx}[2021/02/10 v0.2 patch xcolor for l3color]
\@ifundefined{color_set:nn}{\RequirePackage{l3color}}{}

\ExplSyntaxOn
\cs_gset_eq:NN \@expl@color@set@@nnn \color_set:nnn
\cs_gset_protected:Npn \@expl@color@set@@nnn #1 #2 #3
{
\cs_if_exist:cT { __color_parse_model_ #2 :w }
{
\color_set:nnn {#1}{#2}{#3}
}
}
\cs_generate_variant:Nn \color_set:nn {ne}
\cs_new_protected:Npn \@expl@color@set@@ne #1 #2
{
Expand Down

2 comments on commit 38155f4

@josephwright
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you stumble across models I've not included?

@u-fischer
Copy link
Member

@u-fischer u-fischer commented on 38155f4 Feb 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josephwright I just did run a few tests and found the following are "missing":

\definecolor{duck}{named}{GreenYellow} (color+xcolor)
\definecolor{duck}{tHsb}{0.1,0.2,0.3} (xcolor)
\definecolor{duck}{cmy}{0.1,0.2,0.3}  (xcolor)

The rest seems to work (that means it doesn't gives an error, not sure yet, if they give the right color).

I don't care about them, so I tried to exclude them with the test above, but then it misses something like this:

\definecolor{TUDa-1b}{cmyk/RGB/HTML}{1,.6,0,0/0,90,169/005AA9}

so it is not yet really right.

Please sign in to comment.