I have a custom shape defined using TikZ. This shape has an optional part; if this is to be drawn, the colour has to be specified.
So I'd like to be able to use the following syntax:
\node [MyShape] at (0,0) {}; % Draw the shape without the optional part
\node [MyShape, mycolour=blue] at (0,1) {}; % Draw the shape with the optional part in blue
I know how to use boolean keys to turn options on and off. I know how to use keys to pass colour parameters. But here I need to do both at once!
\tikzset{/tikz/set and colour/.style={mycolour=#1,draw the optional part=true}}– Andrew Stacey Sep 24 '12 at 13:28