How can I bind this to another command?
\definecolor{thisismycolor}{rgb}{0.012,0.11,0.5}
Normally:
\draw[color=thisismycolor]
But, I want this:
\draw[color=mycolor]
So i want to connect thisismycolor
and mycolor
For example:
\newcommand{\mycolor}{\thisismycolor}
but dont work
In summary: When \thisismycolor
changes as let the \mycolor
change too.
Best Answer
Rather than a simple
\colorlet{newcolor}{existingcolor}
, which will allow a new color to be defined in terms of existing color(s) (see Shades of colors, Defining a Color using another), it seems the OP wants a shortcut for a long color name. In particular the desire seems to be that, when the longcolorname changes, the shorthand will change with it.If this is the case, then
\colorlet{newcolor}{existingcolor}
will not suffice, as the color known asnewcolor
will not revise itself whenexistingcolor
gets subsequently updated. Indeed, a\colorlet
is a one-time assignment, but not a "linkage". After the\colorlet
is executed, a change in the specification ofexistingcolor
will, by design, have no effect on the specification ofnewcolor
.In that case, use a shorthand macro to refer to the long name, in the manner of
\newcommand\mycolor{thisismycolor}
. This way, you can refer to\mycolor
whenever a color is called for, and it will take on the current value ofthisismycolor
. The key here to understanding is that the color that is defined isthisismycolor
. The term\mycolor
is not, itself, a color, but merely a macro that gets replaced with a color name.