Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colons e.g. in \definecolor{⋯}{rgb:Hsb}{⋯} not allowed between \ExplSyntaxOn/\ExplSyntaxOff #962

Closed
dbitouze opened this issue Jul 4, 2021 · 5 comments
Assignees
Labels
bug Something isn't working l3color Issues with the l3color package

Comments

@dbitouze
Copy link
Contributor

dbitouze commented Jul 4, 2021

(Original report here.)

The following MCE:

% \RequirePackage{pdfmanagement-testphase}
% \DeclareDocumentMetadata{}
\documentclass{article}
\usepackage{xcolor}
\ExplSyntaxOn
\definecolor{blue3}{rgb:Hsb}{240,0.67,0.70}
\ExplSyntaxOff
\begin{document}
Test.
\end{document}

compiles like a charm but, as soon as the two first lines are commented out, throws the error:

! LaTeX3 Error: Unknown color model 'rgb:Hsb'.

For immediate help type H .
...

l.6 \definecolor{blue3}{rgb:Hsb}{240,0.67,0.70}

@u-fischer
Copy link
Member

looks like a l3color problem. The docu says To allow parsing of data from xcolor, any leading model up the first : will be discarded; the approach of selecting an internal form for data is not used in l3color., but actually it doesn't work if the colon has catcode letter:

\documentclass{article}
\ExplSyntaxOn
%\color_set:nnn{test}{rgb:Hsb}{240,0.67,0.70} %fails
\exp_args:Nnx
\color_set:nnn{test}{rgb\c_colon_str Hsb}{240,0.67,0.70}
\color_show:n{test}
\ExplSyntaxOff
\begin{document}
blub
\end{document}

@josephwright what do you think?

@josephwright
Copy link
Member

I guess I'd been thinking of colons here as document-level syntax: I'll look to fix.

@josephwright josephwright transferred this issue from latex3/pdfresources Jul 8, 2021
@josephwright josephwright self-assigned this Jul 8, 2021
@josephwright josephwright added bug Something isn't working l3color Issues with the l3color package labels Jul 8, 2021
@lvjr
Copy link
Contributor

lvjr commented Sep 8, 2021

There is a similar problem here: https://tex.stackexchange.com/questions/614621/tabularray-and-rgb-xcolor-option

Is it a bug of xcolor or my wrong usage of xcolor package in ninecolors package?

If it is the former, should I open an issue at https://github.com/latex3/xcolor/issues?

@u-fischer
Copy link
Member

@lvjr This bug here has been resolved. Your problem is another one I opened an issue about it in the xcolor repo. But at a first glance it is not trivial to sort out, so it would be better if you defined your colors in a simpler way, e.g. convert them first.

@davidcarlisle
Copy link
Member

@lvjr Ulrike just opened latex3/xcolor#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working l3color Issues with the l3color package
Projects
None yet
Development

No branches or pull requests

5 participants