当前位置:网站首页>Three methods of adding color to latex text

Three methods of adding color to latex text

2022-07-06 06:52:00 Computer vision Archer

1 Combine red、green and blue The value of synthesizes the color we want

\usepackage{color}

\textcolor[rgb]{r,g,b}{text}

among {r,g,b} representative red、green and blue A combination of three colors , The value range is [0-1]

\textcolor[rgb]{0.5,0.6,0.7}{AIAS Programming has a way }、
\textcolor[rgb]{0.5,0.8,0.7}{AIAS Programming has a way }、
\textcolor[rgb]{0.1,0.8,0.9}{AIAS Programming has a way }

2 Combine red、green and blue The value of synthesizes the color we want

\textcolor[RGB]{R,G,B}{text}

among {R,G,B} representative red、green and blue A combination of three colors , The value range is [0-255]

\textcolor[RGB]{18,220,168}{AIAS Programming has a way }、
\textcolor[RGB]{202,12,22}{AIAS Programming has a way }、
\textcolor[RGB]{1,8,9}{AIAS Programming has a way }

3. Use defined colors directly

\usepackage{color}

\textcolor{red/blue/green/black/white/cyan/magenta/yellow}{text}

among textcolor{...} Contains the system defined colors

demonstration

\textcolor{red}{AIAS Programming has a way }、
\textcolor{blue}{AIAS Programming has a way }、
\textcolor{yellow}{AIAS Programming has a way }、 


————————————————
Copyright notice : This paper is about CSDN Blogger 「 Coreopsis 」 The original article of , follow CC 4.0 BY-SA Copyright agreement , For reprint, please attach the original source link and this statement .
Link to the original text :https://blog.csdn.net/meiqi0538/article/details/105978246

4 Customize a color , Call directly

Custom method 1:
\definecolor{ColorName}{rgb}{r,g,b}
At this time r/g/b The domain of definition is [0-1], Reference method 2.

\definecolor{ColorName}{RGB}{R,G,B}
At this time R/G/B The domain of definition is [0-255], Reference method 2.

Here is the name defined for the color ColorName, Now you can call this color scheme directly .
Call mode :\textcolor{ColorName}{text}. Refer to the method for operation mode 2.

原网站

版权声明
本文为[Computer vision Archer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060636260529.html