←模板:Color/doc欢迎来到Undertale社区维基(*`∀´*)ノ亻,如果想要参与条目创建或编辑,请先登录哦因为以下原因,您没有权限编辑本页: 您请求的操作仅限属于该用户组的用户执行:用户 您可以查看和复制此页面的源代码。 == 简介 == 本模板用于为文字设定颜色。 == 参数 == {| class="wikitable doc" |- ! 参数名 ! 说明 |- |匿名函数1 |要设置的颜色 |- |匿名函数2 |文字内容 |} 匿名函数1的格式如下: *颜色关键字: <li class="colorBlock"> {{Hide|标题=现有的颜色关键字|内容=<templatestyles src="Color/doc.css" /> {{columns-list|6|2=<nowiki/> * <span style="background-color: black;"></span> black * <span style="background-color: silver;"></span> silver * <span style="background-color: gray;"></span> gray * <span style="background-color: white;"></span> white * <span style="background-color: maroon;"></span> maroon * <span style="background-color: red;"></span> red * <span style="background-color: purple;"></span> purple * <span style="background-color: fuchsia;"></span> fuchsia * <span style="background-color: green;"></span> green * <span style="background-color: lime;"></span> lime * <span style="background-color: olive;"></span> olive * <span style="background-color: yellow;"></span> yellow * <span style="background-color: navy;"></span> navy * <span style="background-color: blue;"></span> blue * <span style="background-color: teal;"></span> teal * <span style="background-color: aqua;"></span> aqua * <span style="background-color: orange;"></span> orange * <span style="background-color: aliceblue;"></span> aliceblue * <span style="background-color: antiquewhite;"></span> antiquewhite * <span style="background-color: aquamarine;"></span> aquamarine * <span style="background-color: azure;"></span> azure * <span style="background-color: beige;"></span> beige * <span style="background-color: bisque;"></span> bisque * <span style="background-color: blanchedalmond;"></span> blanchedalmond * <span style="background-color: blueviolet;"></span> blueviolet * <span style="background-color: brown;"></span> brown * <span style="background-color: burlywood;"></span> burlywood * <span style="background-color: cadetblue;"></span> cadetblue * <span style="background-color: chartreuse;"></span> chartreuse * <span style="background-color: chocolate;"></span> chocolate * <span style="background-color: coral;"></span> coral * <span style="background-color: cornflowerblue;"></span> cornflowerblue * <span style="background-color: cornsilk;"></span> cornsilk * <span style="background-color: crimson;"></span> crimson * <span style="background-color: darkblue;"></span> darkblue * <span style="background-color: darkcyan;"></span> darkcyan * <span style="background-color: darkgoldenrod;"></span> darkgoldenrod * <span style="background-color: darkgray;"></span> darkgray * <span style="background-color: darkgreen;"></span> darkgreen * <span style="background-color: darkgrey;"></span> darkgrey * <span style="background-color: darkkhaki;"></span> darkkhaki * <span style="background-color: darkmagenta;"></span> darkmagenta * <span style="background-color: darkolivegreen;"></span> darkolivegreen * <span style="background-color: darkorange;"></span> darkorange * <span style="background-color: darkorchid;"></span> darkorchid * <span style="background-color: darkred;"></span> darkred * <span style="background-color: darksalmon;"></span> darksalmon * <span style="background-color: darkseagreen;"></span> darkseagreen * <span style="background-color: darkslateblue;"></span> darkslateblue * <span style="background-color: darkslategray;"></span> darkslategray * <span style="background-color: darkslategrey;"></span> darkslategrey * <span style="background-color: darkturquoise;"></span> darkturquoise * <span style="background-color: darkviolet;"></span> darkviolet * <span style="background-color: deeppink;"></span> deeppink * <span style="background-color: deepskyblue;"></span> deepskyblue * <span style="background-color: dimgray;"></span> dimgray * <span style="background-color: dimgrey;"></span> dimgrey * <span style="background-color: dodgerblue;"></span> dodgerblue * <span style="background-color: firebrick;"></span> firebrick * <span style="background-color: floralwhite;"></span> floralwhite * <span style="background-color: forestgreen;"></span> forestgreen * <span style="background-color: gainsboro;"></span> gainsboro * <span style="background-color: ghostwhite;"></span> ghostwhite * <span style="background-color: gold;"></span> gold * <span style="background-color: goldenrod;"></span> goldenrod * <span style="background-color: greenyellow;"></span> greenyellow * <span style="background-color: grey;"></span> grey * <span style="background-color: honeydew;"></span> honeydew * <span style="background-color: hotpink;"></span> hotpink * <span style="background-color: indianred;"></span> indianred * <span style="background-color: indigo;"></span> indigo * <span style="background-color: ivory;"></span> ivory * <span style="background-color: khaki;"></span> khaki * <span style="background-color: lavender;"></span> lavender * <span style="background-color: lavenderblush;"></span> lavenderblush * <span style="background-color: lawngreen;"></span> lawngreen * <span style="background-color: lemonchiffon;"></span> lemonchiffon * <span style="background-color: lightblue;"></span> lightblue * <span style="background-color: lightcoral;"></span> lightcoral * <span style="background-color: lightcyan;"></span> lightcyan * <span style="background-color: lightgoldenrodyellow;"></span> lightgoldenrodyellow * <span style="background-color: lightgray;"></span> lightgray * <span style="background-color: lightgreen;"></span> lightgreen * <span style="background-color: lightgrey;"></span> lightgrey * <span style="background-color: lightpink;"></span> lightpink * <span style="background-color: lightsalmon;"></span> lightsalmon * <span style="background-color: lightseagreen;"></span> lightseagreen * <span style="background-color: lightskyblue;"></span> lightskyblue * <span style="background-color: lightslategray;"></span> lightslategray * <span style="background-color: lightslategrey;"></span> lightslategrey * <span style="background-color: lightsteelblue;"></span> lightsteelblue * <span style="background-color: lightyellow;"></span> lightyellow * <span style="background-color: limegreen;"></span> limegreen * <span style="background-color: linen;"></span> linen * <span style="background-color: mediumaquamarine;"></span> mediumaquamarine * <span style="background-color: mediumblue;"></span> mediumblue * <span style="background-color: mediumorchid;"></span> mediumorchid * <span style="background-color: mediumpurple;"></span> mediumpurple * <span style="background-color: mediumseagreen;"></span> mediumseagreen * <span style="background-color: mediumslateblue;"></span> mediumslateblue * <span style="background-color: mediumspringgreen;"></span> mediumspringgreen * <span style="background-color: mediumturquoise;"></span> mediumturquoise * <span style="background-color: mediumvioletred;"></span> mediumvioletred * <span style="background-color: midnightblue;"></span> midnightblue * <span style="background-color: mintcream;"></span> mintcream * <span style="background-color: mistyrose;"></span> mistyrose * <span style="background-color: moccasin;"></span> moccasin * <span style="background-color: navajowhite;"></span> navajowhite * <span style="background-color: oldlace;"></span> oldlace * <span style="background-color: olivedrab;"></span> olivedrab * <span style="background-color: orangered;"></span> orangered * <span style="background-color: orchid;"></span> orchid * <span style="background-color: palegoldenrod;"></span> palegoldenrod * <span style="background-color: palegreen;"></span> palegreen * <span style="background-color: paleturquoise;"></span> paleturquoise * <span style="background-color: palevioletred;"></span> palevioletred * <span style="background-color: papayawhip;"></span> papayawhip * <span style="background-color: peachpuff;"></span> peachpuff * <span style="background-color: peru;"></span> peru * <span style="background-color: pink;"></span> pink * <span style="background-color: plum;"></span> plum * <span style="background-color: powderblue;"></span> powderblue * <span style="background-color: rosybrown;"></span> rosybrown * <span style="background-color: royalblue;"></span> royalblue * <span style="background-color: saddlebrown;"></span> saddlebrown * <span style="background-color: salmon;"></span> salmon * <span style="background-color: sandybrown;"></span> sandybrown * <span style="background-color: seagreen;"></span> seagreen * <span style="background-color: seashell;"></span> seashell * <span style="background-color: sienna;"></span> sienna * <span style="background-color: skyblue;"></span> skyblue * <span style="background-color: slateblue;"></span> slateblue * <span style="background-color: slategray;"></span> slategray * <span style="background-color: slategrey;"></span> slategrey * <span style="background-color: snow;"></span> snow * <span style="background-color: springgreen;"></span> springgreen * <span style="background-color: steelblue;"></span> steelblue * <span style="background-color: tan;"></span> tan * <span style="background-color: thistle;"></span> thistle * <span style="background-color: tomato;"></span> tomato * <span style="background-color: turquoise;"></span> turquoise * <span style="background-color: violet;"></span> violet * <span style="background-color: wheat;"></span> wheat * <span style="background-color: whitesmoke;"></span> whitesmoke * <span style="background-color: yellowgreen;"></span> yellowgreen * <span style="background-color: rebeccapurple;"></span> rebeccapurple }}}} </li> *<code>transparent</code>关键字:完全透明色,类比<code>rgba(0,0,0,0)</code>。 *<code>currentColor</code>关键字:继承父类元素颜色。 *RGB颜色:颜色可以使用红-绿-蓝(red-green-blue (RGB))模式的两种方式被定义: **十六进制符号:<code>#RRGGBB</code>/<code>#RRGGBBAA</code>/<code>#RGB</code>/<code>#RGBA</code> ***R(红)G(绿)B(蓝)和 A(alpha,透明度)是十六进制字符(0–9、A–F)。A是可选的。 ***其中所有颜色要么均使用两位16进制整数数值(此时实际数值即为该数值),要么均使用一位16进制整数数值(此时按两位相同数字数值计算实际数值,例如 #CBA 按 #CCBBAA 计算)。 ***十六进制符号:<code>#RRGGBB</code>/<code>#RRGGBBAA</code>/<code>#RGB</code>/<code>#RGBA</code> **函数符号:<code>rgb(R,G,B)</code>/<code>rgba(R,G,B,A)</code> ***RGB可以是数字,也可以是百分比,数字的255相当于百分比的100%。 *HSL颜色:H(色相)S(饱和度)L(亮度)是一种将RGB色彩模型中的点在圆柱坐标系中的表示法。这两种表示法试图做到比基于笛卡尔坐标系的几何结构RGB更加直观。<code>hsl(H,S,L)</code>/<code>hsla(H,S,L,A)</code> **色相使用无单位角度,数值为整数,取除以 360 后的余数计算实际数值,该数值指代分散到一个圆的周长上的颜色(例如 0 指代红色,120 指代绿色,240 指代蓝色) **饱和度使用百分比比例,越高色彩越纯,低则逐渐变灰。 **明度使用百分比比例,越高色彩越偏白,100% 时不论色相和饱和度如何均为纯白,越低色彩越偏黑,0% 时为纯黑。 **alpha值越低代表颜色越透明,0 / 00 / 0%时为全透明,越高代表颜色越不透明,F / FF /100%时为全不透明(rgb(无a)和hsl(无a)模式可以理解为 alpha 值为 100%) == 示例 == {| class="wikitable doc" |- ! 源代码 ! 效果 |- |<nowiki>{{color|red|我是红色的}}</nowiki> |{{color|red|我是红色的}} |- |<nowiki>{{color|#ff0000|我也是红色的}}</nowiki> |{{color|#ff0000|我也是红色的}} |- |<nowiki>{{color|#f00|我还是红色的}}</nowiki> |{{color|#f00|我还是红色的}} |- |<nowiki>{{color|rgba(255,0,0,0.5)|我变透明了}}</nowiki> |{{color|rgba(255,0,0,0.5)|我变透明了}} |- |<nowiki>{{color|hsl(120,100%,50%)|我是什么颜色?}}</nowiki> |{{color|hsl(120,100%,50%)|我是什么颜色?}} |- |<nowiki>{{color|transparent|你现在看不到我啦}}</nowiki> |{{color|transparent|你现在看不到我啦}} |} == 说明 == 此模板仅可用于行内内容,不可跨行使用。 <noinclude>[[分类:模板文档页面]]</noinclude> 本页使用的模板: 模板:Color(查看源代码)模板:Color/doc.css(查看源代码)模板:Columns-list(查看源代码)模板:Hide(查看源代码)模板:Ifnotempty(查看源代码)返回模板:Color/doc。