为什么会将\shadedraw
颜色改为青色,使用时如何才能获得相同的颜色\shadedraw
?
\documentclass[tikz]{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{calc, shapes.arrows}
\usetikzlibrary{decorations.pathreplacing}
\begin{document}
\def\ccolor{cyan}
\begin{tikzpicture}
\draw[fill=\ccolor] (0,0) rectangle ++(2,3);
\shadedraw[top color=\ccolor, bottom color=white, draw=black] (3,0) rectangle ++(2,3);
\end{tikzpicture}
\end{document}
给出:
谢谢!
答案1
cyan
你可以按照自己想要的方式定义自己
\documentclass[tikz, border=1cm]{standalone}
\begin{document}
\begin{tikzpicture}
\definecolor{cyan}{RGB}{0, 255, 255}
\draw[fill=cyan] (0,0) rectangle ++(2,3);
\shadedraw[top color=cyan, bottom color=white, draw=black] (3,0) rectangle ++(2,3);
\end{tikzpicture}
\end{document}
或者您可以在整个文档中使用 RGB 颜色模型
\documentclass[tikz, rgb, border=1cm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw[fill=cyan] (0,0) rectangle ++(2,3);
\shadedraw[top color=cyan, bottom color=white, draw=black] (3,0) rectangle ++(2,3);
\end{tikzpicture}
\end{document}
- 或 CMYK 模型\documentclass[tikz, cmyk, border=1cm]{standalone}