For faster navigation, this Iframe is preloading the Wikiwand page for 模板:Color.

模板:Color

文档图示 模板文档[查看] [编辑] [历史] [清除缓存]

本模板用于取代HTML span的前景颜色。接受RGB的16进制编码,例如:#C9E72A,或是任何的网页颜色的英文名称,如red, blue, green, moccasin, darkorchid。有关于HTML span的背景颜色,请参考((background color))

使用说明

  • ((color|英文顏色名稱或是RGB 16進制編碼|文字))

范例:

  • ((color|red|Hello, world!)) → Hello, world!
  • ((color|#00F000|Hello, world!)) → Hello, world!

如果第二个参数被省略,将会显示下方文字:

  • ((color|#00F000)) → (({2))}
  • ((color|red)) → (({2))}

处理效能

本模板会产生下列的HTML span语法:

<span style="color:(({1))}">(({2))}</span>

处理速度大约每秒700次,与直接使用HTML语法几乎没有差异。

模板资料

以下是该模板的模板数据,适用于可视化编辑器等工具。

Color模板数据

The color template can be used to add a span of text with any given text color

模板参数[编辑模板数据]

参数描述类型状态
Color1

CSS name of color or hex code of color, e.g. 'red' or '#00F000'.

字符串必需
Text2

The string of text to be formatted in the desired color

字符串推荐

重定向

参见

{{bottomLinkPreText}} {{bottomLinkText}}
模板:Color
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?