Template:Color/doc: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
m (Migrating 11 interwiki links, now provided by Wikidata on d:Q5412415)
No edit summary
 
(3 intermediate revisions by the same user 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.
<includeonly>{{high-use| 33,000+ }}</includeonly>
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 
The quick '''[[Template:Color]]''' can be used to add a span of text with any given text color, such as an [[RGB color model|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: {{[[Template:Bg|bg]]}}.


=== Usage ===
=== Usage ===
Line 11: Line 7:
For example:
For example:


{{Tlx|color|red|Hello, world!}} {{ns|8}}gives:&nbsp; {{color|red|Hello, world!}}<br />
{{Tlx|color|red|Hello, world!}} gives:&nbsp; {{color|red|Hello, world!}}<br />
{{Tlx|color|#00F000|Hello, world!}}{{ns}}gives:&nbsp; {{color|#00F000|Hello, world!}}
{{Tlx|color|#00F000|Hello, world!}} gives:&nbsp; {{color|#00F000|Hello, world!}}


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


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.
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 ===
=== 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.
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 also ===
* {{tl|Background color}}
* {{tl|Resize}}
* {{tl|LinkColor}}


<includeonly>
<includeonly>
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[Category:Formatting templates]]
[[Category:Text color templates|{{PAGENAME}}]]
 
</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.