Template:Color/doc: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(30 intermediate revisions by 18 users not shown)
Line 1: Line 1:
{{Documentation subpage}}
The quick '''[[Template:Color]]''' can be used to add a span of text with any given text color, such as an [[w:RGB color model|RGB]] hex code, #C9E72A, or any of the [[w:web colors|web colors]]: red, blue, green, moccasin, or darkorchid, etc.
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->


== Usage ==
=== Usage ===


<code>{{tlx|color|red|Hello, world!}}</code> results in {{color|red|Hello, world!}}
:: {{Tlx|color|name of color or hex code of color|Text}}


<code>{{tlx|color|#00F000|Hello, world!}}</code> results in {{color|#00F000|Hello, world!}}
For example:
 
{{Tlx|color|red|Hello, world!}} gives:&nbsp; {{color|red|Hello, world!}}<br />
{{Tlx|color|#00F000|Hello, world!}} gives:&nbsp; {{color|#00F000|Hello, world!}}
 
Wikitext generated:
<pre>
<span style="color:{{{1|}}}">{{{2|}}}</span>
</pre>
 
See: [[w:Web colors|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:&nbsp; <code>&lt;span style="color:{{{1}}}">{{{2}}}&lt;/span></code>. It runs at speeds in excess of 700 per second, and so it is functionally identical to the longer span-tag markup.


See [[Web colors]] for a list of colors.


<includeonly>
<includeonly>
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[Category:Formatting templates]]
[[Category:Text color templates|{{PAGENAME}}]]
 
[[af:Sjabloon:Kleur]]
[[es:Plantilla:Color]]
[[ja:Template:Color]]
[[pt:Predefinição:Color]]
[[ro:Format:Color]]
[[sl:Predloga:Barva]]
[[zh-yue:Template:Color]]
</includeonly>
</includeonly>

Latest revision as of 07:53, 8 June 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.

Usage

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

For example:

{{color|red|Hello, world!}} gives:  Hello, world!
{{color|#00F000|Hello, world!}} gives:  Hello, 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.