# defining new color

I'm using

\usepackage[dvipsnames]{xcolor}


to use RoyalPurple color, but now I wanted to redefine it to

\definecolor{light-RoyalPurple}{RoyalPurple}{0.85}


But I get

! Package xcolor Error: Undefined color model RoyalPurple'.

that doesn't happen with

\definecolor{light-gray}{gray}{0.85}


So I think that \definecolor just works with "normal" colors... how to solve it?

• The first argument has to be a color model, that is, html, rgb, or whatever format you'd like to provide your definition of the color in. – carsten Nov 13 '16 at 23:02
• @carsten I suppose it, the problem I would like to solve is how to do the same with the others colors :( – UnPerrito Nov 14 '16 at 2:27

It's not working because you're giving the command an unexpected value. The second argument of \definecolor expects one of the color models from this list:

natural, rgb, cmy, cmyk, hsb, gray, RGB, HTML, HSB, Gray


That's why gray worked in your case. Try replacing that with blue and you'll get the same error. If you want a lighter version of RoyalPurple, use \colorlet.

## Code

\documentclass[margin=10pt]{standalone}
\usepackage[dvipsnames]{xcolor}

\colorlet{lRP}{RoyalPurple!85}

\begin{document}\Huge\bfseries
Black \textcolor{lRP}{Light} \textcolor{RoyalPurple}{Regular}
\end{document}
`
• Thanks, but it doesn't work yet :( – UnPerrito Nov 14 '16 at 1:01
• @UnPerrito Pasting the code above in a separate document doesn't work? You mean you get an error? – Alenanno Nov 14 '16 at 1:16
• it works in another document, yep. – UnPerrito Nov 14 '16 at 1:41
• @UnPerrito Ah well, as explained in my answer, that is a wrong command, it will never work as you intend it to. Use the one I have in my code example. – Alenanno Nov 14 '16 at 13:18
• I was getting a problem with "Light-RoyalPurple" so now I changed it for lRP and now it's working haha I'm sorry! Eu fico muito obrigado com você! – UnPerrito Nov 14 '16 at 13:31