
為什麼\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}