【Markdown笔记】设置字体颜色

【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>TestAliceBlue#F0F8FF
<font color=AntiqueWhite><font color=AntiqueWhite>Test</font>TestAntiqueWhite#FAEBD7
<font color=Aqua><font color=Aqua>Test</font>TestAqua#00FFFF
<font color=Aquamarine><font color=Aquamarine>Test</font>TestAquamarine#7FFFD4
<font color=Azure><font color=Azure>Test</font>TestAzure#F0FFFF
<font color=Beige><font color=Beige>Test</font>TestBeige#F5F5DC
<font color=Bisque><font color=Bisque>Test</font>TestBisque#FFE4C4
<font color=Black><font color=Black>Test</font>TestBlack#000000
<font color=BlanchedAlmond><font color=BlanchedAlmond>Test</font>TestBlanchedAlmond#FFEBCD
<font color=Blue><font color=Blue>Test</font>TestBlue#0000FF
<font color=BlueViolet><font color=BlueViolet>Test</font>TestBlueViolet#8A2BE2
<font color=Brown><font color=Brown>Test</font>TestBrown#A52A2A
<font color=BurlyWood><font color=BurlyWood>Test</font>TestBurlyWood#DEB887
<font color=CadetBlue><font color=CadetBlue>Test</font>TestCadetBlue#5F9EA0
<font color=Chartreuse><font color=Chartreuse>Test</font>TestChartreuse#7FFF00
<font color=Chocolate><font color=Chocolate>Test</font>TestChocolate#D2691E
<font color=Coral><font color=Coral>Test</font>TestCoral#FF7F50
<font color=CornflowerBlue><font color=CornflowerBlue>Test</font>TestCornflowerBlue#6495ED
<font color=Cornsilk><font color=Cornsilk>Test</font>TestCornsilk#FFF8DC
<font color=Crimson><font color=Crimson>Test</font>TestCrimson#DC143C
<font color=Cyan><font color=Cyan>Test</font>TestCyan#00FFFF
<font color=DarkBlue><font color=DarkBlue>Test</font>TestDarkBlue#00008B
<font color=DarkCyan><font color=DarkCyan>Test</font>TestDarkCyan#008B8B
<font color=DarkGoldenRod><font color=DarkGoldenRod>Test</font>TestDarkGoldenRod#B8860B
<font color=DarkGray><font color=DarkGray>Test</font>TestDarkGray#A9A9A9
<font color=DarkGreen><font color=DarkGreen>Test</font>TestDarkGreen#006400
<font color=DarkKhaki><font color=DarkKhaki>Test</font>TestDarkKhaki#BDB76B
<font color=DarkMagenta><font color=DarkMagenta>Test</font>TestDarkMagenta#8B008B
<font color=DarkOliveGreen><font color=DarkOliveGreen>Test</font>TestDarkOliveGreen#556B2F
<font color=Darkorange><font color=Darkorange>Test</font>TestDarkorange#FF8C00
<font color=DarkOrchid><font color=DarkOrchid>Test</font>TestDarkOrchid#9932CC
<font color=DarkRed><font color=DarkRed>Test</font>TestDarkRed#8B0000
<font color=DarkSalmon><font color=DarkSalmon>Test</font>TestDarkSalmon#E9967A
<font color=DarkSeaGreen><font color=DarkSeaGreen>Test</font>TestDarkSeaGreen#8FBC8F
<font color=DarkSlateBlue><font color=DarkSlateBlue>Test</font>TestDarkSlateBlue#483D8B
<font color=DarkSlateGray><font color=DarkSlateGray>Test</font>TestDarkSlateGray#2F4F4F
<font color=DarkTurquoise><font color=DarkTurquoise>Test</font>TestDarkTurquoise#00CED1
<font color=DarkViolet><font color=DarkViolet>Test</font>TestDarkViolet#9400D3
<font color=DeepPink><font color=DeepPink>Test</font>TestDeepPink#FF1493
<font color=DeepSkyBlue><font color=DeepSkyBlue>Test</font>TestDeepSkyBlue#00BFFF
<font color=DimGray><font color=DimGray>Test</font>TestDimGray#696969
<font color=DodgerBlue><font color=DodgerBlue>Test</font>TestDodgerBlue#1E90FF
<font color=Feldspar><font color=Feldspar>Test</font>TestFeldspar#D19275
<font color=FireBrick><font color=FireBrick>Test</font>TestFireBrick#B22222
<font color=FloralWhite><font color=FloralWhite>Test</font>TestFloralWhite#FFFAF0
<font color=ForestGreen><font color=ForestGreen>Test</font>TestForestGreen#228B22
<font color=Fuchsia><font color=Fuchsia>Test</font>TestFuchsia#FF00FF
<font color=Gainsboro><font color=Gainsboro>Test</font>TestGainsboro#DCDCDC
<font color=GhostWhite><font color=GhostWhite>Test</font>TestGhostWhite#F8F8FF
<font color=Gold><font color=Gold>Test</font>TestGold#FFD700
<font color=GoldenRod><font color=GoldenRod>Test</font>TestGoldenRod#DAA520
<font color=Gray><font color=Gray>Test</font>TestGray#808080
<font color=Green><font color=Green>Test</font>TestGreen#008000
<font color=GreenYellow><font color=GreenYellow>Test</font>TestGreenYellow#ADFF2F
<font color=HoneyDew><font color=HoneyDew>Test</font>TestHoneyDew#F0FFF0
<font color=HotPink><font color=HotPink>Test</font>TestHotPink#FF69B4
<font color=IndianRed><font color=IndianRed>Test</font>TestIndianRed#CD5C5C
<font color=Indigo><font color=Indigo>Test</font>TestIndigo#4B0082
<font color=Ivory><font color=Ivory>Test</font>TestIvory#FFFFF0
<font color=Khaki><font color=Khaki>Test</font>TestKhaki#F0E68C
<font color=Lavender><font color=Lavender>Test</font>TestLavender#E6E6FA
<font color=LavenderBlush><font color=LavenderBlush>Test</font>TestLavenderBlush#FFF0F5
<font color=LawnGreen><font color=LawnGreen>Test</font>TestLawnGreen#7CFC00
<font color=LemonChiffon><font color=LemonChiffon>Test</font>TestLemonChiffon#FFFACD
<font color=LightBlue><font color=LightBlue>Test</font>TestLightBlue#ADD8E6
<font color=LightCoral><font color=LightCoral>Test</font>TestLightCoral#F08080
<font color=LightCyan><font color=LightCyan>Test</font>TestLightCyan#E0FFFF
<font color=LightGoldenRodYellow><font color=LightGoldenRodYellow>Test</font>TestLightGoldenRodYellow#FAFAD2
<font color=LightGrey><font color=LightGrey>Test</font>TestLightGrey#D3D3D3
<font color=LightGrey><font color=LightGrey>Test</font>TestLightGreen#90EE90
<font color=LightPink><font color=LightPink>Test</font>TestLightPink#FFB6C1
<font color=LightSalmon><font color=LightSalmon>Test</font>TestLightSalmon#FFA07A
<font color=LightSeaGreen><font color=LightSeaGreen>Test</font>TestLightSeaGreen#20B2AA
<font color=LightSkyBlue><font color=LightSkyBlue>Test</font>TestLightSkyBlue#87CEFA
<font color=LightSlateBlue><font color=LightSlateBlue>Test</font>TestLightSlateBlue#8470FF
<font color=LightSlateGray><font color=LightSlateGray>Test</font>TestLightSlateGray#778899
<font color=LightSteelBlue><font color=LightSteelBlue>Test</font>TestLightSteelBlue#B0C4DE
<font color=LightYellow><font color=LightYellow>Test</font>TestLightYellow#FFFFE0
<font color=Lime><font color=Lime>Test</font>TestLime#00FF00
<font color=LimeGreen><font color=LimeGreen>Test</font>TestLimeGreen#32CD32
<font color=Linen><font color=Linen>Test</font>TestLinen#FAF0E6
<font color=Magenta><font color=Magenta>Test</font>TestMagenta#FF00FF
<font color=Maroon><font color=Maroon>Test</font>TestMaroon#800000
<font color=MediumAquaMarine><font color=MediumAquaMarine>Test</font>TestMediumAquaMarine#66CDAA
<font color=MediumBlue><font color=MediumBlue>Test</font>TestMediumBlue#0000CD
<font color=MediumOrchid><font color=MediumOrchid>Test</font>TestMediumOrchid#BA55D3
<font color=MediumPurple><font color=MediumPurple>Test</font>TestMediumPurple#9370D8
<font color=MediumSeaGreen><font color=MediumSeaGreen>Test</font>TestMediumSeaGreen#3CB371
<font color=MediumSlateBlue><font color=MediumSlateBlue>Test</font>TestMediumSlateBlue#7B68EE
<font color=MediumSpringGreen><font color=MediumSpringGreen>Test</font>TestMediumSpringGreen#00FA9A
<font color=MediumTurquoise><font color=MediumTurquoise>Test</font>TestMediumTurquoise#48D1CC
<font color=MediumVioletRed><font color=MediumVioletRed>Test</font>TestMediumVioletRed#C71585
<font color=MidnightBlue><font color=MidnightBlue>Test</font>TestMidnightBlue#191970
<font color=MintCream><font color=MintCream>Test</font>TestMintCream#F5FFFA
<font color=MistyRose><font color=MistyRose>Test</font>TestMistyRose#FFE4E1
<font color=Moccasin><font color=Moccasin>Test</font>TestMoccasin#FFE4B5
<font color=NavajoWhite><font color=NavajoWhite>Test</font>TestNavajoWhite#FFDEAD
<font color=Navy><font color=Navy>Test</font>TestNavy#000080
<font color=OldLace><font color=OldLace>Test</font>TestOldLace#FDF5E6
<font color=Olive><font color=Olive>Test</font>TestOlive#808000
<font color=OliveDrab><font color=OliveDrab>Test</font>TestOliveDrab#6B8E23
<font color=Orange><font color=Orange>Test</font>TestOrange#FFA500
<font color=OrangeRed><font color=OrangeRed>Test</font>TestOrangeRed#FF4500
<font color=Orchid><font color=Orchid>Test</font>TestOrchid#DA70D6
<font color=PaleGoldenRod><font color=PaleGoldenRod>Test</font>TestPaleGoldenRod#EEE8AA
<font color=PaleGreen><font color=PaleGreen>Test</font>TestPaleGreen#98FB98
<font color=PaleTurquoise><font color=PaleTurquoise>Test</font>TestPaleTurquoise#AFEEEE
<font color=PaleVioletRed><font color=PaleVioletRed>Test</font>TestPaleVioletRed#D87093
<font color=PapayaWhip><font color=PapayaWhip>Test</font>TestPapayaWhip#FFEFD5
<font color=PeachPuff><font color=PeachPuff>Test</font>TestPeachPuff#FFDAB9
<font color=Peru><font color=Peru>Test</font>TestPeru#CD853F
<font color=Pink><font color=Pink>Test</font>TestPink#FFC0CB
<font color=Plum><font color=Plum>Test</font>TestPlum#DDA0DD
<font color=PowderBlue><font color=PowderBlue>Test</font>TestPowderBlue#B0E0E6
<font color=Purple><font color=Purple>Test</font>TestPurple#800080
<font color=Red><font color=Red>Test</font>TestRed#FF0000
<font color=RosyBrown><font color=RosyBrown>Test</font>TestRosyBrown#BC8F8F
<font color=RoyalBlue><font color=RoyalBlue>Test</font>TestRoyalBlue#4169E1
<font color=SaddleBrown><font color=SaddleBrown>Test</font>TestSaddleBrown#8B4513
<font color=Salmon><font color=Salmon>Test</font>TestSalmon#FA8072
<font color=SandyBrown><font color=SandyBrown>Test</font>TestSandyBrown#F4A460
<font color=SeaGreen><font color=SeaGreen>Test</font>TestSeaGreen#2E8B57
<font color=SeaShell><font color=SeaShell>Test</font>TestSeaShell#FFF5EE
<font color=Sienna><font color=Sienna>Test</font>TestSienna#A0522D
<font color=Silver><font color=Silver>Test</font>TestSilver#C0C0C0
<font color=SkyBlue><font color=SkyBlue>Test</font>TestSkyBlue#87CEEB
<font color=SlateBlue><font color=SlateBlue>Test</font>TestSlateBlue#6A5ACD
<font color=SlateGray><font color=SlateGray>Test</font>TestSlateGray#708090
<font color=Snow><font color=Snow>Test</font>TestSnow#FFFAFA
<font color=SpringGreen><font color=SpringGreen>Test</font>TestSpringGreen#00FF7F
<font color=SteelBlue><font color=SteelBlue>Test</font>TestSteelBlue#4682B4
<font color=Tan><font color=Tan>Test</font>TestTan#D2B48C
<font color=Teal><font color=Teal>Test</font>TestTeal#008080
<font color=Thistle><font color=Thistle>Test</font>TestThistle#D8BFD8
<font color=Tomato><font color=Tomato>Test</font>TestTomato#FF6347
<font color=Turquoise><font color=Turquoise>Test</font>TestTurquoise#40E0D0
<font color=Violet><font color=Violet>Test</font>TestViolet#EE82EE
<font color=VioletRed><font color=VioletRed>Test</font>TestVioletRed#D02090
<font color=Wheat><font color=Wheat>Test</font>TestWheat#F5DEB3
<font color=White><font color=White>Test</font>TestWhite#FFFFFF
<font color=WhiteSmoke><font color=WhiteSmoke>Test</font>TestWhiteSmoke#F5F5F5
<font color=Yellow><font color=Yellow>Test</font>TestYellow#FFFF00
<font color=YellowGreen><font color=YellowGreen>Test</font>TestYellowGreen#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}Test TestApricot杏黄色
2$\color{Aquamarine}$$\color{Aquamarine}Test$ T e s t \color{Aquamarine}Test TestAquamarine碧绿色
3$\color{Bittersweet}$$\color{Bittersweet}Test$ T e s t \color{Bittersweet}Test TestBittersweet深桔红色
4$\color{Black}$$\color{Black}Test$ T e s t \color{Black}Test TestBlack黑色
5$\color{Blue}$$\color{Blue}Test$ T e s t \color{Blue}Test TestBlue蓝色
6$\color{BlueGreen}$$\color{BlueGreen}Test$ T e s t \color{BlueGreen}Test TestBlueGreen蓝绿色
7$\color{BlueViolet}$$\color{BlueViolet}Test$ T e s t \color{BlueViolet}Test TestBlueViolet蓝紫色
8$\color{BrickRed}$$\color{BrickRed}Test$ T e s t \color{BrickRed}Test TestBrickRed砖红色
9$\color{Brown}$$\color{Brown}Test$ T e s t \color{Brown}Test TestBrown棕色
10$\color{BurntOrange}$$\color{BurntOrange}Test$ T e s t \color{BurntOrange}Test TestBurntOrange深橙黄色
11$\color{CadetBlue}$$\color{CadetBlue}Test$ T e s t \color{CadetBlue}Test TestCadetBlue军蓝色
12$\color{CarnationPink}$$\color{CarnationPink}Test$ T e s t \color{CarnationPink}Test TestCarnationPink康乃馨粉
13$\color{Cerulean}$$\color{Cerulean}Test$ T e s t \color{Cerulean}Test TestCerulean天蓝色
14$\color{CornflowerBlue}$$\color{CornflowerBlue}Test$ T e s t \color{CornflowerBlue}Test TestCornflowerBlue矢菊花蓝
15$\color{Cyan}$$\color{Cyan}Test$ T e s t \color{Cyan}Test TestCyan青色
16$\color{Dandelion}$$\color{Dandelion}Test$ T e s t \color{Dandelion}Test TestDandelion蒲公英
17$\color{DarkOrchid}$$\color{DarkOrchid}Test$ T e s t \color{DarkOrchid}Test TestDarkOrchid深兰花紫
18$\color{Emerald}$$\color{Emerald}Test$ T e s t \color{Emerald}Test TestEmerald祖母绿
19$\color{ForestGreen}$$\color{ForestGreen}Test$ T e s t \color{ForestGreen}Test TestForestGreen森林绿
20$\color{Fuchsia}$$\color{Fuchsia}Test$ T e s t \color{Fuchsia}Test TestFuchsia紫红色
21$\color{Goldenrod}$$\color{Goldenrod}Test$ T e s t \color{Goldenrod}Test TestGoldenrod金麒麟色
22$\color{Gray}$$\color{Gray}Test$ T e s t \color{Gray}Test TestGray灰色
23$\color{Green}$$\color{Green}Test$ T e s t \color{Green}Test TestGreen绿色
24$\color{GreenYellow}$$\color{GreenYellow}Test$ T e s t \color{GreenYellow}Test TestGreenYellow黄绿色
25$\color{JungleGreen}$$\color{JungleGreen}Test$ T e s t \color{JungleGreen}Test TestJungleGreen深草绿
26$\color{Lavender}$$\color{Lavender}Test$ T e s t \color{Lavender}Test TestLavender淡紫色
27$\color{LimeGreen}$$\color{LimeGreen}Test$ T e s t \color{LimeGreen}Test TestLimeGreen橙绿色
28$\color{Magenta}$$\color{Magenta}Test$ T e s t \color{Magenta}Test TestMagenta品红色
29$\color{Mahogany}$$\color{Mahogany}Test$ T e s t \color{Mahogany}Test TestMahogany红褐色
30$\color{Maroon}$$\color{Maroon}Test$ T e s t \color{Maroon}Test TestMaroon褐红色
31$\color{Melon}$$\color{Melon}Test$ T e s t \color{Melon}Test TestMelon
32$\color{MidnightBlue}$$\color{MidnightBlue}Test$ T e s t \color{MidnightBlue}Test TestMidnightBlue午夜蓝
33$\color{Mulberry}$$\color{Mulberry}Test$ T e s t \color{Mulberry}Test TestMulberry深紫红色
34$\color{NavyBlue}$$\color{NavyBlue}Test$ T e s t \color{NavyBlue}Test TestNavyBlue藏青色
35$\color{OliveGreen}$$\color{OliveGreen}Test$ T e s t \color{OliveGreen}Test TestOliveGreen橄榄绿
36$\color{Orange}$$\color{Orange}Test$ T e s t \color{Orange}Test TestOrange橙色
37$\color{OrangeRed}$$\color{OrangeRed}Test$ T e s t \color{OrangeRed}Test TestOrangeRed橙红色
38$\color{Orchid}$$\color{Orchid}Test$ T e s t \color{Orchid}Test TestOrchid淡紫色
39$\color{Peach}$$\color{Peach}Test$ T e s t \color{Peach}Test TestPeach桃红色
40$\color{Periwinkle}$$\color{Periwinkle}Test$ T e s t \color{Periwinkle}Test TestPeriwinkle蔓长春花
41$\color{PineGreen}$$\color{PineGreen}Test$ T e s t \color{PineGreen}Test TestPineGreen松绿色
42$\color{Plum}$$\color{Plum}Test$ T e s t \color{Plum}Test TestPlum紫红色
43$\color{ProcessBlue}$$\color{ProcessBlue}Test$ T e s t \color{ProcessBlue}Test TestProcessBlue工艺蓝
44$\color{Purple}$$\color{Purple}Test$ T e s t \color{Purple}Test TestPurple紫色
45$\color{RawSienna}$$\color{RawSienna}Test$ T e s t \color{RawSienna}Test TestRawSienna黄赭色
46$\color{Red}$$\color{Red}Test$ T e s t \color{Red}Test TestRed红色
47$\color{RedOrange}$$\color{RedOrange}Test$ T e s t \color{RedOrange}Test TestRedOrange橘红色
48$\color{RedViolet}$$\color{RedViolet}Test$ T e s t \color{RedViolet}Test TestRedViolet紫红色
49$\color{Rhodamine}$$\color{Rhodamine}Test$ T e s t \color{Rhodamine}Test TestRhodamine罗丹明
50$\color{RoyalBlue}$$\color{RoyalBlue}Test$ T e s t \color{RoyalBlue}Test TestRoyalBlue宝蓝色
51$\color{RoyalPurple}$$\color{RoyalPurple}Test$ T e s t \color{RoyalPurple}Test TestRoyalPurple蓝紫色
52$\color{RubineRed}$$\color{RubineRed}Test$ T e s t \color{RubineRed}Test TestRubineRed宝石红
53$\color{Salmon}$$\color{Salmon}Test$ T e s t \color{Salmon}Test TestSalmon鲜肉色
54$\color{SeaGreen}$$\color{SeaGreen}Test$ T e s t \color{SeaGreen}Test TestSeaGreen海绿色
55$\color{Sepia}$$\color{Sepia}Test$ T e s t \color{Sepia}Test TestSepia棕黑色
56$\color{SkyBlue}$$\color{SkyBlue}Test$ T e s t \color{SkyBlue}Test TestSkyBlue天蓝色
57$\color{SpringGreen}$$\color{SpringGreen}Test$ T e s t \color{SpringGreen}Test TestSpringGreen春绿色
58$\color{Tan}$$\color{Tan}Test$ T e s t \color{Tan}Test TestTan棕褐色
59$\color{TealBlue}$$\color{TealBlue}Test$ T e s t \color{TealBlue}Test TestTealBlue水鸭蓝
60$\color{Thistle}$$\color{Thistle}Test$ T e s t \color{Thistle}Test TestThistle蓟色
61$\color{Turquoise}$$\color{Turquoise}Test$ T e s t \color{Turquoise}Test TestTurquoise蓝绿色
62$\color{Violet}$$\color{Violet}Test$ T e s t \color{Violet}Test TestViolet紫罗兰色
63$\color{VioletRed}$$\color{VioletRed}Test$ T e s t \color{VioletRed}Test TestVioletRed紫红色
64$\color{White}$$\color{White}Test$ T e s t \color{White}Test TestWhite白色
65$\color{WildStrawberry}$$\color{WildStrawberry}Test$ T e s t \color{WildStrawberry}Test TestWildStrawberry野草莓
66$\color{Yellow}$$\color{Yellow}Test$ T e s t \color{Yellow}Test TestYellow黄色
67$\color{YellowGreen}$$\color{YellowGreen}Test$ T e s t \color{YellowGreen}Test TestYellowGreen黄绿色
68$\color{YellowOrange}$$\color{YellowOrange}Test$ T e s t \color{YellowOrange}Test TestYellowOrange黄橙色

使用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

  • 101
    点赞
  • 283
    收藏
    觉得还不错? 一键收藏
  • 10
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值