blj28

导航

【Markdown笔记】设置字体颜色——转载https://blog.csdn.net/u012028275/article/details/115445362


【Markdown笔记】设置字体颜色

 这篇博客详细介绍了在Markdown和LaTeX中设置字体颜色及背景颜色的方法,包括HTML和LaTeX的用法,以及如何自定义颜色。还列举了大量颜色名称和RGB值的示例,适用于CSDN Markdown编辑器和Typora等工具。
摘要由CSDN通过智能技术生成

【Markdown笔记】设置字体颜色

 

 

在Markdown下设置字体颜色和给字体背景设置颜色,主要使用HTML和LaTeX

以下部分内容CSDN Markdown下不支持,我使用的Typora是支持的。

HTML

字体颜色 Font colors

修改字体颜色,选择颜色名称,例如:

<font color=Blue>Test</font>,效果为Test

或者是

<font color="Blue">Test</font>,效果为Test

修改字体颜色,选择16进制颜色值,例如:

<font color=#0000FF>Test</font>,效果为Test

或者是

<font color=#"0000FF">Test</font>,效果为Test

背景颜色 Background color

该部分内容CSDN Markdown下不支持,我使用的Typora是支持的。

修改背景颜色,选择颜色名称,例如:

<font style=background:red>Test</font>

<font style="background:red">Test</font>

或者是

<span style=background:red>Test</span>

<span style="background:red">Test</span>

修改背景颜色,选择16进制颜色值,例如:

<font style=background:#FF0000>Test</font>

<font style="background:#FF0000">Test</font>

或者是

<span style=background:#FF0000>Test</span>

<span style="background:#FF0000">Test</span>

支持的颜色

颜色可以选择下表的颜色名称,或者根据RGB值。

支持的各种颜色名称如下:

HTML示例示例效果颜色名称16进制
<font color=AliceBlue> <font color=AliceBlue>Test</font> Test AliceBlue #F0F8FF
<font color=AntiqueWhite> <font color=AntiqueWhite>Test</font> Test AntiqueWhite #FAEBD7
<font color=Aqua> <font color=Aqua>Test</font> Test Aqua #00FFFF
<font color=Aquamarine> <font color=Aquamarine>Test</font> Test Aquamarine #7FFFD4
<font color=Azure> <font color=Azure>Test</font> Test Azure #F0FFFF
<font color=Beige> <font color=Beige>Test</font> Test Beige #F5F5DC
<font color=Bisque> <font color=Bisque>Test</font> Test Bisque #FFE4C4
<font color=Black> <font color=Black>Test</font> Test Black #000000
<font color=BlanchedAlmond> <font color=BlanchedAlmond>Test</font> Test BlanchedAlmond #FFEBCD
<font color=Blue> <font color=Blue>Test</font> Test Blue #0000FF
<font color=BlueViolet> <font color=BlueViolet>Test</font> Test BlueViolet #8A2BE2
<font color=Brown> <font color=Brown>Test</font> Test Brown #A52A2A
<font color=BurlyWood> <font color=BurlyWood>Test</font> Test BurlyWood #DEB887
<font color=CadetBlue> <font color=CadetBlue>Test</font> Test CadetBlue #5F9EA0
<font color=Chartreuse> <font color=Chartreuse>Test</font> Test Chartreuse #7FFF00
<font color=Chocolate> <font color=Chocolate>Test</font> Test Chocolate #D2691E
<font color=Coral> <font color=Coral>Test</font> Test Coral #FF7F50
<font color=CornflowerBlue> <font color=CornflowerBlue>Test</font> Test CornflowerBlue #6495ED
<font color=Cornsilk> <font color=Cornsilk>Test</font> Test Cornsilk #FFF8DC
<font color=Crimson> <font color=Crimson>Test</font> Test Crimson #DC143C
<font color=Cyan> <font color=Cyan>Test</font> Test Cyan #00FFFF
<font color=DarkBlue> <font color=DarkBlue>Test</font> Test DarkBlue #00008B
<font color=DarkCyan> <font color=DarkCyan>Test</font> Test DarkCyan #008B8B
<font color=DarkGoldenRod> <font color=DarkGoldenRod>Test</font> Test DarkGoldenRod #B8860B
<font color=DarkGray> <font color=DarkGray>Test</font> Test DarkGray #A9A9A9
<font color=DarkGreen> <font color=DarkGreen>Test</font> Test DarkGreen #006400
<font color=DarkKhaki> <font color=DarkKhaki>Test</font> Test DarkKhaki #BDB76B
<font color=DarkMagenta> <font color=DarkMagenta>Test</font> Test DarkMagenta #8B008B
<font color=DarkOliveGreen> <font color=DarkOliveGreen>Test</font> Test DarkOliveGreen #556B2F
<font color=Darkorange> <font color=Darkorange>Test</font> Test Darkorange #FF8C00
<font color=DarkOrchid> <font color=DarkOrchid>Test</font> Test DarkOrchid #9932CC
<font color=DarkRed> <font color=DarkRed>Test</font> Test DarkRed #8B0000
<font color=DarkSalmon> <font color=DarkSalmon>Test</font> Test DarkSalmon #E9967A
<font color=DarkSeaGreen> <font color=DarkSeaGreen>Test</font> Test DarkSeaGreen #8FBC8F
<font color=DarkSlateBlue> <font color=DarkSlateBlue>Test</font> Test DarkSlateBlue #483D8B
<font color=DarkSlateGray> <font color=DarkSlateGray>Test</font> Test DarkSlateGray #2F4F4F
<font color=DarkTurquoise> <font color=DarkTurquoise>Test</font> Test DarkTurquoise #00CED1
<font color=DarkViolet> <font color=DarkViolet>Test</font> Test DarkViolet #9400D3
<font color=DeepPink> <font color=DeepPink>Test</font> Test DeepPink #FF1493
<font color=DeepSkyBlue> <font color=DeepSkyBlue>Test</font> Test DeepSkyBlue #00BFFF
<font color=DimGray> <font color=DimGray>Test</font> Test DimGray #696969
<font color=DodgerBlue> <font color=DodgerBlue>Test</font> Test DodgerBlue #1E90FF
<font color=Feldspar> <font color=Feldspar>Test</font> Test Feldspar #D19275
<font color=FireBrick> <font color=FireBrick>Test</font> Test FireBrick #B22222
<font color=FloralWhite> <font color=FloralWhite>Test</font> Test FloralWhite #FFFAF0
<font color=ForestGreen> <font color=ForestGreen>Test</font> Test ForestGreen #228B22
<font color=Fuchsia> <font color=Fuchsia>Test</font> Test Fuchsia #FF00FF
<font color=Gainsboro> <font color=Gainsboro>Test</font> Test Gainsboro #DCDCDC
<font color=GhostWhite> <font color=GhostWhite>Test</font> Test GhostWhite #F8F8FF
<font color=Gold> <font color=Gold>Test</font> Test Gold #FFD700
<font color=GoldenRod> <font color=GoldenRod>Test</font> Test GoldenRod #DAA520
<font color=Gray> <font color=Gray>Test</font> Test Gray #808080
<font color=Green> <font color=Green>Test</font> Test Green #008000
<font color=GreenYellow> <font color=GreenYellow>Test</font> Test GreenYellow #ADFF2F
<font color=HoneyDew> <font color=HoneyDew>Test</font> Test HoneyDew #F0FFF0
<font color=HotPink> <font color=HotPink>Test</font> Test HotPink #FF69B4
<font color=IndianRed> <font color=IndianRed>Test</font> Test IndianRed #CD5C5C
<font color=Indigo> <font color=Indigo>Test</font> Test Indigo #4B0082
<font color=Ivory> <font color=Ivory>Test</font> Test Ivory #FFFFF0
<font color=Khaki> <font color=Khaki>Test</font> Test Khaki #F0E68C
<font color=Lavender> <font color=Lavender>Test</font> Test Lavender #E6E6FA
<font color=LavenderBlush> <font color=LavenderBlush>Test</font> Test LavenderBlush #FFF0F5
<font color=LawnGreen> <font color=LawnGreen>Test</font> Test LawnGreen #7CFC00
<font color=LemonChiffon> <font color=LemonChiffon>Test</font> Test LemonChiffon #FFFACD
<font color=LightBlue> <font color=LightBlue>Test</font> Test LightBlue #ADD8E6
<font color=LightCoral> <font color=LightCoral>Test</font> Test LightCoral #F08080
<font color=LightCyan> <font color=LightCyan>Test</font> Test LightCyan #E0FFFF
<font color=LightGoldenRodYellow> <font color=LightGoldenRodYellow>Test</font> Test LightGoldenRodYellow #FAFAD2
<font color=LightGrey> <font color=LightGrey>Test</font> Test LightGrey #D3D3D3
<font color=LightGrey> <font color=LightGrey>Test</font> Test LightGreen #90EE90
<font color=LightPink> <font color=LightPink>Test</font> Test LightPink #FFB6C1
<font color=LightSalmon> <font color=LightSalmon>Test</font> Test LightSalmon #FFA07A
<font color=LightSeaGreen> <font color=LightSeaGreen>Test</font> Test LightSeaGreen #20B2AA
<font color=LightSkyBlue> <font color=LightSkyBlue>Test</font> Test LightSkyBlue #87CEFA
<font color=LightSlateBlue> <font color=LightSlateBlue>Test</font> Test LightSlateBlue #8470FF
<font color=LightSlateGray> <font color=LightSlateGray>Test</font> Test LightSlateGray #778899
<font color=LightSteelBlue> <font color=LightSteelBlue>Test</font> Test LightSteelBlue #B0C4DE
<font color=LightYellow> <font color=LightYellow>Test</font> Test LightYellow #FFFFE0
<font color=Lime> <font color=Lime>Test</font> Test Lime #00FF00
<font color=LimeGreen> <font color=LimeGreen>Test</font> Test LimeGreen #32CD32
<font color=Linen> <font color=Linen>Test</font> Test Linen #FAF0E6
<font color=Magenta> <font color=Magenta>Test</font> Test Magenta #FF00FF
<font color=Maroon> <font color=Maroon>Test</font> Test Maroon #800000
<font color=MediumAquaMarine> <font color=MediumAquaMarine>Test</font> Test MediumAquaMarine #66CDAA
<font color=MediumBlue> <font color=MediumBlue>Test</font> Test MediumBlue #0000CD
<font color=MediumOrchid> <font color=MediumOrchid>Test</font> Test MediumOrchid #BA55D3
<font color=MediumPurple> <font color=MediumPurple>Test</font> Test MediumPurple #9370D8
<font color=MediumSeaGreen> <font color=MediumSeaGreen>Test</font> Test MediumSeaGreen #3CB371
<font color=MediumSlateBlue> <font color=MediumSlateBlue>Test</font> Test MediumSlateBlue #7B68EE
<font color=MediumSpringGreen> <font color=MediumSpringGreen>Test</font> Test MediumSpringGreen #00FA9A
<font color=MediumTurquoise> <font color=MediumTurquoise>Test</font> Test MediumTurquoise #48D1CC
<font color=MediumVioletRed> <font color=MediumVioletRed>Test</font> Test MediumVioletRed #C71585
<font color=MidnightBlue> <font color=MidnightBlue>Test</font> Test MidnightBlue #191970
<font color=MintCream> <font color=MintCream>Test</font> Test MintCream #F5FFFA
<font color=MistyRose> <font color=MistyRose>Test</font> Test MistyRose #FFE4E1
<font color=Moccasin> <font color=Moccasin>Test</font> Test Moccasin #FFE4B5
<font color=NavajoWhite> <font color=NavajoWhite>Test</font> Test NavajoWhite #FFDEAD
<font color=Navy> <font color=Navy>Test</font> Test Navy #000080
<font color=OldLace> <font color=OldLace>Test</font> Test OldLace #FDF5E6
<font color=Olive> <font color=Olive>Test</font> Test Olive #808000
<font color=OliveDrab> <font color=OliveDrab>Test</font> Test OliveDrab #6B8E23
<font color=Orange> <font color=Orange>Test</font> Test Orange #FFA500
<font color=OrangeRed> <font color=OrangeRed>Test</font> Test OrangeRed #FF4500
<font color=Orchid> <font color=Orchid>Test</font> Test Orchid #DA70D6
<font color=PaleGoldenRod> <font color=PaleGoldenRod>Test</font> Test PaleGoldenRod #EEE8AA
<font color=PaleGreen> <font color=PaleGreen>Test</font> Test PaleGreen #98FB98
<font color=PaleTurquoise> <font color=PaleTurquoise>Test</font> Test PaleTurquoise #AFEEEE
<font color=PaleVioletRed> <font color=PaleVioletRed>Test</font> Test PaleVioletRed #D87093
<font color=PapayaWhip> <font color=PapayaWhip>Test</font> Test PapayaWhip #FFEFD5
<font color=PeachPuff> <font color=PeachPuff>Test</font> Test PeachPuff #FFDAB9
<font color=Peru> <font color=Peru>Test</font> Test Peru #CD853F
<font color=Pink> <font color=Pink>Test</font> Test Pink #FFC0CB
<font color=Plum> <font color=Plum>Test</font> Test Plum #DDA0DD
<font color=PowderBlue> <font color=PowderBlue>Test</font> Test PowderBlue #B0E0E6
<font color=Purple> <font color=Purple>Test</font> Test Purple #800080
<font color=Red> <font color=Red>Test</font> Test Red #FF0000
<font color=RosyBrown> <font color=RosyBrown>Test</font> Test RosyBrown #BC8F8F
<font color=RoyalBlue> <font color=RoyalBlue>Test</font> Test RoyalBlue #4169E1
<font color=SaddleBrown> <font color=SaddleBrown>Test</font> Test SaddleBrown #8B4513
<font color=Salmon> <font color=Salmon>Test</font> Test Salmon #FA8072
<font color=SandyBrown> <font color=SandyBrown>Test</font> Test SandyBrown #F4A460
<font color=SeaGreen> <font color=SeaGreen>Test</font> Test SeaGreen #2E8B57
<font color=SeaShell> <font color=SeaShell>Test</font> Test SeaShell #FFF5EE
<font color=Sienna> <font color=Sienna>Test</font> Test Sienna #A0522D
<font color=Silver> <font color=Silver>Test</font> Test Silver #C0C0C0
<font color=SkyBlue> <font color=SkyBlue>Test</font> Test SkyBlue #87CEEB
<font color=SlateBlue> <font color=SlateBlue>Test</font> Test SlateBlue #6A5ACD
<font color=SlateGray> <font color=SlateGray>Test</font> Test SlateGray #708090
<font color=Snow> <font color=Snow>Test</font> Test Snow #FFFAFA
<font color=SpringGreen> <font color=SpringGreen>Test</font> Test SpringGreen #00FF7F
<font color=SteelBlue> <font color=SteelBlue>Test</font> Test SteelBlue #4682B4
<font color=Tan> <font color=Tan>Test</font> Test Tan #D2B48C
<font color=Teal> <font color=Teal>Test</font> Test Teal #008080
<font color=Thistle> <font color=Thistle>Test</font> Test Thistle #D8BFD8
<font color=Tomato> <font color=Tomato>Test</font> Test Tomato #FF6347
<font color=Turquoise> <font color=Turquoise>Test</font> Test Turquoise #40E0D0
<font color=Violet> <font color=Violet>Test</font> Test Violet #EE82EE
<font color=VioletRed> <font color=VioletRed>Test</font> Test VioletRed #D02090
<font color=Wheat> <font color=Wheat>Test</font> Test Wheat #F5DEB3
<font color=White> <font color=White>Test</font> Test White #FFFFFF
<font color=WhiteSmoke> <font color=WhiteSmoke>Test</font> Test WhiteSmoke #F5F5F5
<font color=Yellow> <font color=Yellow>Test</font> Test Yellow #FFFF00
<font color=YellowGreen> <font color=YellowGreen>Test</font> Test YellowGreen #9ACD32

LaTeX

CSDN Markdown下使用的KaTeX,以下内容支持度不高。

字体颜色 Font colors

1.使用\color

修改字体颜色使用LaTeX公式$\color{options}{text}$options选择颜色,text选择公式内容。

如以下示例程序:

序号LaTeX公式LaTeX示例效果
1 $\color{Green}{y = ax^2 + bx + c}$ y = a x 2 + b x + c \color{Green}{y = ax^2 + bx + c}y=ax2+bx+c
2 $\color{Orange}{y} = \color{Red}{kx} + \color{Blue}{b}$ y = k x + b \color{Orange}{y} = \color{Red}{kx} + \color{Blue}{b}y=kx+b
3 ${\color{Emerald}z^2} = {\color{Yellow}x^2} + {\color{Cyan}y^2}$ z 2 = x 2 + y 2 {\color{Emerald}z^2} = {\color{Yellow}x^2} + {\color{Cyan}y^2}z2=x2+y2

2.使用\textcolor

修改字体颜色使用LaTeX公式$\textcolor{options}{text}$options选择颜色,text选择公式内容。

如以下示例程序:

序号LaTeX公式LaTeX示例效果
1 $\textcolor{Green}{y = ax^2 + bx + c}$ y = a x 2 + b x + c \textcolor{Green}{y = ax^2 + bx + c}y=ax2+bx+c
2 $\textcolor{Orange}{y} = \textcolor{Red}{kx} + \textcolor{Blue}{b}$ y = k x + b \textcolor{Orange}{y} = \textcolor{Red}{kx} + \textcolor{Blue}{b}y=kx+b
3 ${\textcolor{Emerald}z^2} = {\textcolor{Yellow}x^2} + {\textcolor{Cyan}y^2}$ z 2 = x 2 + y 2 {\textcolor{Emerald}z^2} = {\textcolor{Yellow}x^2} + {\textcolor{Cyan}y^2}z2=x2+y2

背景颜色 Background color

修改背景颜色使用LaTeX公式$\colorbox{options}{text}$options选择颜色,text选择文本内容。

如以下示例程序:

序号LaTeX公式LaTeX示例效果
1 $\colorbox{Green}{y = ax + bx + c}$ y = ax + bx + c \colorbox{Green}{y = ax + bx + c}y = ax + bx + c
2 $\colorbox{Orange}{y} = \colorbox{Red}{kx} + \colorbox{Blue}{b}$ y = kx + b \colorbox{Orange}{y} = \colorbox{Red}{kx} + \colorbox{Blue}{b}y=kx+b
3 ${\colorbox{Emerald}z^2} = {\colorbox{Yellow}x^2} + {\colorbox{Cyan}y^2}$ z 2 = x 2 + y 2 {\colorbox{Emerald}z^2} = {\colorbox{Yellow}x^2} + {\colorbox{Cyan}y^2}z2=x2+y2

默认支持颜色 Colors supported

该部分内容CSDN Markdown下,部分颜色是不支持的,我使用的Typora是支持的。

下面列举支持的颜色名称。

序号LaTeX公式LaTeX示例LaTeX示例效果名称说明
1 $\color{Apricot}$ $\color{Apricot}Test$ T e s t \color{Apricot}TestTest Apricot 杏黄色
2 $\color{Aquamarine}$ $\color{Aquamarine}Test$ T e s t \color{Aquamarine}TestTest Aquamarine 碧绿色
3 $\color{Bittersweet}$ $\color{Bittersweet}Test$ T e s t \color{Bittersweet}TestTest Bittersweet 深桔红色
4 $\color{Black}$ $\color{Black}Test$ T e s t \color{Black}TestTest Black 黑色
5 $\color{Blue}$ $\color{Blue}Test$ T e s t \color{Blue}TestTest Blue 蓝色
6 $\color{BlueGreen}$ $\color{BlueGreen}Test$ T e s t \color{BlueGreen}TestTest BlueGreen 蓝绿色
7 $\color{BlueViolet}$ $\color{BlueViolet}Test$ T e s t \color{BlueViolet}TestTest BlueViolet 蓝紫色
8 $\color{BrickRed}$ $\color{BrickRed}Test$ T e s t \color{BrickRed}TestTest BrickRed 砖红色
9 $\color{Brown}$ $\color{Brown}Test$ T e s t \color{Brown}TestTest Brown 棕色
10 $\color{BurntOrange}$ $\color{BurntOrange}Test$ T e s t \color{BurntOrange}TestTest BurntOrange 深橙黄色
11 $\color{CadetBlue}$ $\color{CadetBlue}Test$ T e s t \color{CadetBlue}TestTest CadetBlue 军蓝色
12 $\color{CarnationPink}$ $\color{CarnationPink}Test$ T e s t \color{CarnationPink}TestTest CarnationPink 康乃馨粉
13 $\color{Cerulean}$ $\color{Cerulean}Test$ T e s t \color{Cerulean}TestTest Cerulean 天蓝色
14 $\color{CornflowerBlue}$ $\color{CornflowerBlue}Test$ T e s t \color{CornflowerBlue}TestTest CornflowerBlue 矢菊花蓝
15 $\color{Cyan}$ $\color{Cyan}Test$ T e s t \color{Cyan}TestTest Cyan 青色
16 $\color{Dandelion}$ $\color{Dandelion}Test$ T e s t \color{Dandelion}TestTest Dandelion 蒲公英
17 $\color{DarkOrchid}$ $\color{DarkOrchid}Test$ T e s t \color{DarkOrchid}TestTest DarkOrchid 深兰花紫
18 $\color{Emerald}$ $\color{Emerald}Test$ T e s t \color{Emerald}TestTest Emerald 祖母绿
19 $\color{ForestGreen}$ $\color{ForestGreen}Test$ T e s t \color{ForestGreen}TestTest ForestGreen 森林绿
20 $\color{Fuchsia}$ $\color{Fuchsia}Test$ T e s t \color{Fuchsia}TestTest Fuchsia 紫红色
21 $\color{Goldenrod}$ $\color{Goldenrod}Test$ T e s t \color{Goldenrod}TestTest Goldenrod 金麒麟色
22 $\color{Gray}$ $\color{Gray}Test$ T e s t \color{Gray}TestTest Gray 灰色
23 $\color{Green}$ $\color{Green}Test$ T e s t \color{Green}TestTest Green 绿色
24 $\color{GreenYellow}$ $\color{GreenYellow}Test$ T e s t \color{GreenYellow}TestTest GreenYellow 黄绿色
25 $\color{JungleGreen}$ $\color{JungleGreen}Test$ T e s t \color{JungleGreen}TestTest JungleGreen 深草绿
26 $\color{Lavender}$ $\color{Lavender}Test$ T e s t \color{Lavender}TestTest Lavender 淡紫色
27 $\color{LimeGreen}$ $\color{LimeGreen}Test$ T e s t \color{LimeGreen}TestTest LimeGreen 橙绿色
28 $\color{Magenta}$ $\color{Magenta}Test$ T e s t \color{Magenta}TestTest Magenta 品红色
29 $\color{Mahogany}$ $\color{Mahogany}Test$ T e s t \color{Mahogany}TestTest Mahogany 红褐色
30 $\color{Maroon}$ $\color{Maroon}Test$ T e s t \color{Maroon}TestTest Maroon 褐红色
31 $\color{Melon}$ $\color{Melon}Test$ T e s t \color{Melon}TestTest Melon  
32 $\color{MidnightBlue}$ $\color{MidnightBlue}Test$ T e s t \color{MidnightBlue}TestTest MidnightBlue 午夜蓝
33 $\color{Mulberry}$ $\color{Mulberry}Test$ T e s t \color{Mulberry}TestTest Mulberry 深紫红色
34 $\color{NavyBlue}$ $\color{NavyBlue}Test$ T e s t \color{NavyBlue}TestTest NavyBlue 藏青色
35 $\color{OliveGreen}$ $\color{OliveGreen}Test$ T e s t \color{OliveGreen}TestTest OliveGreen 橄榄绿
36 $\color{Orange}$ $\color{Orange}Test$ T e s t \color{Orange}TestTest Orange 橙色
37 $\color{OrangeRed}$ $\color{OrangeRed}Test$ T e s t \color{OrangeRed}TestTest OrangeRed 橙红色
38 $\color{Orchid}$ $\color{Orchid}Test$ T e s t \color{Orchid}TestTest Orchid 淡紫色
39 $\color{Peach}$ $\color{Peach}Test$ T e s t \color{Peach}TestTest Peach 桃红色
40 $\color{Periwinkle}$ $\color{Periwinkle}Test$ T e s t \color{Periwinkle}TestTest Periwinkle 蔓长春花
41 $\color{PineGreen}$ $\color{PineGreen}Test$ T e s t \color{PineGreen}TestTest PineGreen 松绿色
42 $\color{Plum}$ $\color{Plum}Test$ T e s t \color{Plum}TestTest Plum 紫红色
43 $\color{ProcessBlue}$ $\color{ProcessBlue}Test$ T e s t \color{ProcessBlue}TestTest ProcessBlue 工艺蓝
44 $\color{Purple}$ $\color{Purple}Test$ T e s t \color{Purple}TestTest Purple 紫色
45 $\color{RawSienna}$ $\color{RawSienna}Test$ T e s t \color{RawSienna}TestTest RawSienna 黄赭色
46 $\color{Red}$ $\color{Red}Test$ T e s t \color{Red}TestTest Red 红色
47 $\color{RedOrange}$ $\color{RedOrange}Test$ T e s t \color{RedOrange}TestTest RedOrange 橘红色
48 $\color{RedViolet}$ $\color{RedViolet}Test$ T e s t \color{RedViolet}TestTest RedViolet 紫红色
49 $\color{Rhodamine}$ $\color{Rhodamine}Test$ T e s t \color{Rhodamine}TestTest Rhodamine 罗丹明
50 $\color{RoyalBlue}$ $\color{RoyalBlue}Test$ T e s t \color{RoyalBlue}TestTest RoyalBlue 宝蓝色
51 $\color{RoyalPurple}$ $\color{RoyalPurple}Test$ T e s t \color{RoyalPurple}TestTest RoyalPurple 蓝紫色
52 $\color{RubineRed}$ $\color{RubineRed}Test$ T e s t \color{RubineRed}TestTest RubineRed 宝石红
53 $\color{Salmon}$ $\color{Salmon}Test$ T e s t \color{Salmon}TestTest Salmon 鲜肉色
54 $\color{SeaGreen}$ $\color{SeaGreen}Test$ T e s t \color{SeaGreen}TestTest SeaGreen 海绿色
55 $\color{Sepia}$ $\color{Sepia}Test$ T e s t \color{Sepia}TestTest Sepia 棕黑色
56 $\color{SkyBlue}$ $\color{SkyBlue}Test$ T e s t \color{SkyBlue}TestTest SkyBlue 天蓝色
57 $\color{SpringGreen}$ $\color{SpringGreen}Test$ T e s t \color{SpringGreen}TestTest SpringGreen 春绿色
58 $\color{Tan}$ $\color{Tan}Test$ T e s t \color{Tan}TestTest Tan 棕褐色
59 $\color{TealBlue}$ $\color{TealBlue}Test$ T e s t \color{TealBlue}TestTest TealBlue 水鸭蓝
60 $\color{Thistle}$ $\color{Thistle}Test$ T e s t \color{Thistle}TestTest Thistle 蓟色
61 $\color{Turquoise}$ $\color{Turquoise}Test$ T e s t \color{Turquoise}TestTest Turquoise 蓝绿色
62 $\color{Violet}$ $\color{Violet}Test$ T e s t \color{Violet}TestTest Violet 紫罗兰色
63 $\color{VioletRed}$ $\color{VioletRed}Test$ T e s t \color{VioletRed}TestTest VioletRed 紫红色
64 $\color{White}$ $\color{White}Test$ T e s t \color{White}TestTest White 白色
65 $\color{WildStrawberry}$ $\color{WildStrawberry}Test$ T e s t \color{WildStrawberry}TestTest WildStrawberry 野草莓
66 $\color{Yellow}$ $\color{Yellow}Test$ T e s t \color{Yellow}TestTest Yellow 黄色
67 $\color{YellowGreen}$ $\color{YellowGreen}Test$ T e s t \color{YellowGreen}TestTest YellowGreen 黄绿色
68 $\color{YellowOrange}$ $\color{YellowOrange}Test$ T e s t \color{YellowOrange}TestTest YellowOrange 黄橙色
           

使用RGB颜色 Use RGB color

该部分内容CSDN Markdown下不支持,我使用的Typora是支持的。

1.RGB

要使用RGB颜色,使用LaTeX公式$\color[RGB]{R,G,B}{text}$$\textcolor[RGB]{R,G,B}{text}$R是红色分量,G是绿色分量,B是蓝色分量,范围0 - 255。

如以下示例程序:

序号LaTeX公式LaTeX示例效果
1 $\color[RGB]{0,200,0}{y = ax^2 + bx + c}$ KaTeX parse error: Expected '{', got '[' at position 7: \color[̲RGB]{0,200,0}{y…
2 $\color[RGB]{80,50,200}{y} = \color[RGB]{160,30,100}{kx} + \color[RGB]{130,90,120}{b}$ KaTeX parse error: Expected '{', got '[' at position 7: \color[̲RGB]{80,50,200}…
3 ${\color[RGB]{200,120,10}z^2} = {\color[RGB]{110,110,10}x^2} + {\color[RGB]{20,70,30}y^2}$ KaTeX parse error: Expected '{', got '[' at position 8: {\color[̲RGB]{200,120,10…
4 $\textcolor[RGB]{0,200,0}{y = ax^2 + bx + c}$ KaTeX parse error: Expected '{', got '[' at position 11: \textcolor[̲RGB]{0,200,0}{y…

2.rgb

要使用rgb颜色,使用LaTeX公式$\color[rgb]{r,g,b}$$\textcolor[rgb]{r,g,b}$r是红色分量,g是绿色分量,b是蓝色分量,范围0 - 1。

如以下示例程序:

序号LaTeX公式LaTeX示例效果
1 $\color[rgb]{0,0.9,0}{y = ax^2 + bx + c}$ KaTeX parse error: Expected '{', got '[' at position 7: \color[̲rgb]{0,0.9,0}{y…
2 $\color[rgb]{0.2,0.1,0.9}{y} = \color[rgb]{0.7,0.25,0.33}{kx} + \color[rgb]{0.4,0.35,0.5}{b}$ KaTeX parse error: Expected '{', got '[' at position 7: \color[̲rgb]{0.2,0.1,0.…
3 ${\color[rgb]{0.85,0.36,0.05}z^2} = {\color[rgb]{0.29,0.36,0.08}x^2} + {\color[rgb]{0.07,0.24,0.16}y^2}$ KaTeX parse error: Expected '{', got '[' at position 8: {\color[̲rgb]{0.85,0.36,…
4 $\textcolor[rgb]{0,0.9,0}{y = ax^2 + bx + c}$ KaTeX parse error: Expected '{', got '[' at position 11: \textcolor[̲rgb]{0,0.9,0}{y…

自定义颜色 Custom colors

该部分内容CSDN Markdown下不支持,我使用的Typora是支持的。

要自己定义颜色,使用LaTeX公式$\definecolor{name}{RGB}{R,G,B}$$\definecolor{name}{rgb]{r,g,b}$name是自定义颜色名称。

如以下示例程序:

序号LaTeX公式LaTeX示例效果
1 $\definecolor{testcolor}{RGB}{0,200,0} {\color{Blue}{y = 2x} + \color{testcolor}1}$ KaTeX parse error: Undefined control sequence: \definecolor at position 1: \̲d̲e̲f̲i̲n̲e̲c̲o̲l̲o̲r̲{testcolor}{RGB…
2 $\definecolor{testcolor}{rgb}{0,0.8,0} {\color{Blue}{y = 2x} + \color{testcolor}1}$ KaTeX parse error: Undefined control sequence: \definecolor at position 1: \̲d̲e̲f̲i̲n̲e̲c̲o̲l̲o̲r̲{testcolor}{rgb…

参考资料

HTML 颜色名

LaTeX公式编辑器——帮助文档


本文链接:https://blog.csdn.net/u012028275/article/details/115445362

 
文章知识点与官方知识档案匹配,可进一步学习相关知识
CS入门技能树MarkDown入门MarkDown介绍42335 人正在系统学习中

posted on 2024-08-29 14:19  bailinjun  阅读(67)  评论(0编辑  收藏  举报