Yes it's a feature, because this
color key rewrites the color value on the
textkey, I quote the 3.1 manual on page 168 (15.2 Specifying a Color):
/tikz/color=<color name> (no default) This option sets the color that
is used for fill, drawing, and text inside the current scope.
TikZ allows you to change the color value of the lines made with
draw and the color value of the coloring made with
color key, assigns the same color (
< color value >) to
fill. And since the keys are evaluated in the order in which they are written, the result you see is quite normal.
What does (no default) mean?
The majority of TikZ's usual keys can be called in 2 ways:
explicitly with for example
key to which the
red value applies is explicitly given, here the
\draw[red](0,0)rectangle(1,1);, here TikZ recognizes the color value and assigns it to the
color key. It is not mandatory to say to which
key the color value applies. TikZ implicitly assigns the color value to the
On the other hand, if you write
\draw[color], there is an error because the color value is not indicated. There is no default color. I quote the error:
Package pgfkeys Error: The key '/tikz/color' requires a value.
An example of a key that has a default value:
It is sometimes possible not to give a value to the key, in this case it takes the default value:
By example, the
double key has the default value of
white. You can omit the color and write
Which is the same as
But it is possible to specify a color value other than the default value, for example, here cyan
The options are given with the
key=value system called
pgfkeys described starting on page 946 of the 3.1 manual (86 Key Management).
- The first word on the left is always the name of the
key (the option),
- the second word is always the name of the option
color=red, the key is
color, the value is
draw=blue, the key is
draw, the value is
The color word is designated differently in the manual:
/tikz/color=< color name >
- the key is called
- The manual write
< color name > to indicate the value (red, blue, etc).
So, yes, we must be careful and specify what we are talking about. We commonly talk about "colour" but very often forget to specify whether it is the
key or its
value. This leads to confusion.
I corrected this answer and specified each time whether it is the key or its value. I hope that the answer is now clearer.