我有以下代码,它绘制一个数组并用各种颜色填充它。当我使用红色、蓝色、绿色等一般颜色时,代码运行完美。但是当我使用colorbrewer
库时,它会出现以下错误。
! Package xcolor Error: Undefined color `Dark2-3-2'.
! Package pgf Error: Unsupported color model `='. Sorry.
代码片段如下
\documentclass[tikz, border=3mm]{standalone}
\usetikzlibrary{arrows.meta,chains,matrix,decorations.pathreplacing}
\usetikzlibrary{colorbrewer}
\begin{document}
\begin{tikzpicture}[
node distance=0pt,
start chain = A going right,
X/.style = {rectangle, draw,% styles of nodes in string (chain)
minimum width=1.5ex, minimum height=2.5ex,
outer sep=0pt, on chain}, % by default braces are mirrored
]
\node[X, fill= Dark2-3-2] {};
\node[X,fill=red] {};
\node[X,fill=blue ] {};
\node[X, fill=green] {};
\node[X,fill=yellow] {};
\node[X,fill=yellow ] {};
\end{tikzpicture}
\end{document}