PandaScience/FortySecondsCV

redefining `maincolor` does not work properly

ninohardt opened this issue ยท 3 comments

First of all, awesome template!

I redefined maincolor, like this:

\definecolor{maincolor}{rgb}{0.54, 0.29, 0.42}

While Name and mail/phone/email/flag icons appear in that color, the other sidebar section headers don't.

I believe the issue is this:

\colorlet{pseccolor}{maincolor!90}

Using !90 might not work on rgb-defined colors?
Not sure what a remedy would be.

Hi! Sorry for the late reply, we are in the middle of a move right now. ๐Ÿš› ๐Ÿƒโ€โ™‚๏ธ

You're right, the problem here are the derived colors. By the time you are redefining maincolor they are already set to whatever maincolor has been at the time of processing the respective code line.

You need to use the Class Option instead:

\documentclass[a4paper,..., maincolor=somecolor]{fortysecondscv}

However, this only works with predefined colors (dvipsnames, svgnames, x11names ๐Ÿ ฆ see xcolor docs for details). In case you want to define your own color you need to do so before loading the fortysecondscv class:

\RequirePackage[dvipsnames, svgnames, x11names]{xcolor}
\definecolor{mycolor}{rgb}{0.54, 0.29, 0.42}
\documentclass[a4paper,..., maincolor=mycolor]{fortysecondscv}

Make sure you use the exact same class options for xcolor to prevent option clash. Of course, you can also modify the class file directly and change the definition of maincolor there.

Hope that helps.

Thank you. Yes, this is great. I have used TeX for many years, but my documents would always start with \documentclass[... - I didn't even think about defining the color before it.

Great! So I will close this issue then and add a reference in the readme. ๐Ÿ‘