I want to use some background color on my node, but not for the whole node. Just for 75% of the node.
My code is this:
\documentclass[tikz,margin=5mm]{standalone}
\begin{document}
\tikz\node[draw, fill=gray!30]{Some Text};
\end{document}
Which produces this:
But I want more something like this:
Edit: The white and the grey part should be reversed in the second image.
Best Answer
You can use
path picture
andpath picture bounding box
:This works also if the node is a
circle
:or a
cloud
(options:cloud,cloud ignores aspect
, needs libraryshapes.symbols
):Only if the node is a rectangle, you can use the node name instead
path picture bounding box
:Update (because of a comment)
If the background should be colored in an intervall, eg. from 0.3 to 0.8, use
Replace
<name>
by the node name orpath picture bounding box
.Code: