答案1
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{shadows,shadings,shapes.symbols, calc}
\begin{document}
\begin{tikzpicture}[my node/.style={draw, cloud, cloud ignores aspect, }]
\node[my node] (a1) {Text};
\end{tikzpicture}
\begin{tikzpicture}[fill fraction/.style n args={2}{path picture={
\fill[#1] (path picture bounding box.south west) rectangle
($(path picture bounding box.north west)!#2!(path picture bounding box.north east)$);}}]
\draw (4, 0) node[cloud, cloud ignores aspect,draw,fill=blue, fill fraction={green}{0.7}] {Some
other text};
\end{tikzpicture}
\end{document}
编辑
长文本破坏了云的形状,因此需要编辑
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{shadows,shadings,shapes.symbols, calc}
\begin{document}
\begin{tikzpicture}[my node/.style={draw, cloud, cloud ignores aspect, }]
\node[my node] (a1) {Text};
\end{tikzpicture}
\begin{tikzpicture}[fill fraction/.style n args={2}{path picture={
\fill[#1] (path picture bounding box.south west) rectangle
($(path picture bounding box.north west)!#2!(path picture bounding box.north east)$);}}]
\draw (4, 0) node[cloud, cloud ignores aspect,draw,fill=blue, fill fraction={green}{0.7}] {text};
\end{tikzpicture}
\end{document}
结果是