我怎样才能使箭头变为红色并且线条保持为蓝色?

我怎样才能使箭头变为红色并且线条保持为蓝色?

我试图画一条中间有红色箭头的蓝线,但一切都只显示为蓝色。以下是我的代码,我不知道如何修复它。请帮助我。谢谢!

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{tkz-euclide}
\usetikzlibrary{decorations.markings}

\begin{document}
\begin{tikzpicture}
    \tkzDefPoint(-3,0){A}
    \tkzDefPoint(-2,2){B}
    \draw[Blue, thick, postaction={decorate, red, decoration={
    markings,
    mark=at position 0.5 with {\arrow{stealth}}}}] (A)--(B);
\end{tikzpicture}
\end{document}

答案1

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tkz-euclide}

\begin{document}
    
    
    \begin{tikzpicture}
        \tkzDefPoint(-3,0){A}
        \tkzDefPoint(-2,2){B}
        \draw[blue, thick, postaction={decorate, decoration={
        markings,
        mark=at position 0.5 with {\arrow[red]{stealth}}}}] (A)--(B);
    \end{tikzpicture}

\end{document}

蓝线上的红色箭头

相关内容