varkor / quiver

A modern commutative diagram editor for the web.
https://q.uiver.app
MIT License
2.4k stars 80 forks source link

Color definition in macro file seems not to work #201

Closed ouboub closed 9 months ago

ouboub commented 9 months ago

Hi

I put my local compiled quiver in a directory my local Apache Server can read and load the following macro file via http://localhost/quiver/src/style/quiver-macros.sty

\ProvidesPackage{quiver-macros}[2023/10/12 oub]
\newcommand{\farbboxed}[2]{\fcolorbox{black}{#1}{$\displaystyle#2$}}
\usepackage{xcolor}
\definecolor{DarkOrange}{rgb}{1.000000,0.549020,0.000000}
\definecolor{orange}{RGB}{255,127,0}
\definecolor{Lightorange}{HTML}{FAA21A}
\definecolor{Melon}{HTML}{F89E7B}
\definecolor{Melon}{RGB}{16.8,229.3,185.5}
\definecolor{Melon}{rgb}{0.972549,0.619607,0.482352}

however the color Melon is not displayed I tried HEX and rgb what do I miss?

varkor commented 9 months ago

If you open the colour palette, you will see that the colour has been loaded:

image

However, it's not currently possible to use custom colours using commands like \color, etc. You can only use the colours from the colour palette. This is due to a limitation in KaTeX (#202).

Note that you cannot use the HTML colour format yet in quiver, not are decimal points accepted in the RGB specification. It's also not necessary to use \ProvidesPackage or \usepackage{xcolor} (though it's also harmless to write them). E.g. you could just use:

\newcommand{\farbboxed}[2]{\fcolorbox{black}{#1}{$\displaystyle#2$}}
\definecolor{DarkOrange}{rgb}{1.000000,0.549020,0.000000}
\definecolor{orange}{RGB}{255,127,0}
\definecolor{Melon}{rgb}{0.972549,0.619607,0.482352}
ouboub commented 9 months ago

If you open the colour palette, you will see that the colour has been loaded: image However, it's not currently possible to use custom colours using commands like \color, etc. You can only use the colours from the colour palette. This is due to a limitation in KaTeX (#202).

Note that you cannot use the HTML colour format yet in quiver, not are decimal points accepted in the RGB specification. It's also not necessary to use \ProvidesPackage or \usepackage{xcolor} (though it's also harmless to write them). E.g. you could just use:

\newcommand{\farbboxed}[2]{\fcolorbox{black}{#1}{$\displaystyle#2$}}
\definecolor{DarkOrange}{rgb}{1.000000,0.549020,0.000000}
\definecolor{orange}{RGB}{255,127,0}
\definecolor{Melon}{rgb}{0.972549,0.619607,0.482352}

thanks for this explanation, in that case, I will then stick to the predefined colors, since the diagram I produce is not going to be published anywhere