Template:Color/doc: Difference between revisions

From XMS Wiki
Jump to navigationJump to search
(Created page with "{{Documentation subpage}} <includeonly>{{high-use| 33,000+ }}</includeonly> <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> The quick '''[[Template:Colo...")
 
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 3: Line 3:
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
<!-- 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]]}}.
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: Template:Bg|bg.


=== Usage ===
=== Usage ===
Line 19: Line 19:
</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: 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>
Line 35: Line 31:


</includeonly>
</includeonly>
<noinclude>
[[Category:Color]]
</noinclude>

Latest revision as of 15:04, 2 June 2014

This is a documentation subpage for Template:Color (see that page for the template itself).
It contains usage information, categories and other content that is not part of the original template page.


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: Template:Bg|bg.

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.