tikz中箭头和文本(节点)的渐变

tikz中箭头和文本(节点)的渐变

有没有办法让向下的箭头在两种颜色之间渐变,并让文本也具有这种渐变?(砖红和深蓝)

\documentclass[a4paper, 11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[dvipsnames]{xcolor}
\usepackage{chemformula}
\usepackage{float}
\usepackage{tikz}
\usepackage{pgfplots}

\begin{document}

\begin{figure}[H]
\centering
\begin{tikzpicture}
\draw[very thick, ->] (0,0) -- (0,4) node[left]  {$H$};
\draw[BrickRed, very thick] (0.25, 3.5) -- (3, 3.5) node[midway, above] {\ch{C (s) + O2 (g)}}; 
\draw[shading=grad, thick, ->] (2.75, 3.5) -- (2.75, 0.5) node[midway, right] {$\Delta H=-282.5 \,\mathrm{kJ}$};  
\draw[NavyBlue, very thick] (2.5, 0.5) -- (5.75, 0.5) node[midway, above] {\ch{CO2 (g)}};
\end{tikzpicture}
\caption{Exemplo de um diagrama de entalpia de uma reação exotérmica}
\end{figure}

\end{document}

在此处输入图片描述

相关内容