Template:Color/doc: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
(26 changes: ce; noted misspelled colors will show black text; typo "RBG")
m (Migrating 11 interwiki links, now provided by Wikidata on d:Q5412415)
Line 34: Line 34:
[[Category:Text color templates|{{PAGENAME}}]]
[[Category:Text color templates|{{PAGENAME}}]]


[[af:Sjabloon:Kleur]]
[[es:Plantilla:Color]]
[[fr:Modèle:Coloré]]
[[ja:Template:Color]]
[[no:mal:farve]]
[[pt:Predefinição:Color]]
[[ro:Format:Color]]
[[ru:Шаблон:Color]]
[[sl:Predloga:Barva]]
[[uk:Шаблон:Кольоровий текст]]
[[zh-yue:Template:Color]]
</includeonly>
</includeonly>

Revision as of 14:18, 27 March 2013


The quick Template:Color can be used to add a span of text with any given text color, such as an RGB hex code, #C9E72A, or any of the web colors: red, blue, green, moccasin, or darkorchid, etc. The foreground text color is set, but to reset the background color, see: {{bg}}.

Usage

{{color|name of color or hex code of color|Text}}

For example:

{{color|red|Hello, world!}} Template:NsgivesHello, world!
{{color|#00F000|Hello, world!}}Template:NsgivesHello, world!

Wikitext generated:

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

See: Web colors, for a list of colors. A misspelled color name will not be reported, but will cause the text to remain as black text.

Performance considerations

The template merely uses a span tag:  <span style="color:{{{1}}}">{{{2}}}</span>. It runs at speeds in excess of 700 per second, and so it is functionally identical to the longer span-tag markup.

See also