我想将十六进制格式的颜色传递给我的arr
命令。我不想定义颜色。
\newcommand{\arr}[2]{
{\tikz{\path[draw=#1,line width=1.5mm, line join=round,line cap=round, -
{Straight Barb[scale=0.8, line join=round,line cap=round]},
rotate=#2-45,scale = 0.8] (0,0) -- (0.9,0.9);}}
}
\arr{326EC8}{90}
答案1
一种方法是在宏中定义颜色arr
:
代码:
\documentclass{article}
\usepackage{tikz}
\newcommand{\arr}[2]{%
\definecolor{myColor}{HTML}{#1}%
\tikz{%
\path[
draw=myColor,
line width=1.5mm,
line join=round,
line cap=round,
->,
rotate=#2-45,
scale = 0.8,
]
(0,0) -- (0.9,0.9);
}%
}
\begin{document}
\arr{326EC8}{90}%
\arr{232F3E}{45}%
\end{document}