Difference between revisions of "Template:Color/doc"

From blackwiki
Jump to navigation Jump to search
imported>CaroleHenson
(added template data)
imported>Quiddity
m (fix heading levels per WP:DOC and section order)
Line 5: Line 5:
 
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 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 ==
  
 
:: {{Tlx|color|name of color or hex code of color|Text}}
 
:: {{Tlx|color|name of color or hex code of color|Text}}
Line 20: Line 20:
  
 
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 ==
 +
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.
  
 
==Template data==
 
==Template data==
Line 42: Line 45:
 
</templatedata>
 
</templatedata>
  
=== Performance considerations ===
+
== See also ==
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|Background color}}

Revision as of 06:23, 1 July 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.

Template data

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

Template parameters

ParameterDescriptionTypeStatus
Color name or codecolor

Name of color or hex code of color

Stringrequired
Alpha-numeric texttext

The string of text to be be formatted in the desired color

Stringrequired

See also