Difference between revisions of "Template:Color/doc"
imported>DixonDBot m (Migrating 11 interwiki links, now provided by Wikidata on d:Q5412415) |
imported>CaroleHenson (added template data) |
||
| 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. | ||
| + | |||
| + | ==Template data== | ||
| + | <templatedata> | ||
| + | { | ||
| + | "description": "The color template can be used to add a span of text with any given text color", | ||
| + | "params": { | ||
| + | "color": { | ||
| + | "label": "Color name or code", | ||
| + | "description": "Name of color or hex code of color", | ||
| + | "type": "string", | ||
| + | "required": true | ||
| + | }, | ||
| + | "text": { | ||
| + | "label": "Alpha-numeric text", | ||
| + | "description": "The string of text to be be formatted in the desired color", | ||
| + | "type": "string", | ||
| + | "required": true | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | </templatedata> | ||
=== Performance considerations === | === Performance considerations === | ||
Revision as of 22:05, 29 June 2013
| 40px | This is a documentation subpage for Template:Color. 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: {{bg}}.
Usage
{{color|name of color or hex code of color|Text}}
For example:
{{color|red|Hello, world!}} Template:Nsgives: Hello, world!
{{color|#00F000|Hello, world!}}Template:Nsgives: 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.
Template data
The color template can be used to add a span of text with any given text color
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Color name or code | color | Name of color or hex code of color | String | required |
| Alpha-numeric text | text | The string of text to be be formatted in the desired color | String | required |
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
- {{Background color}}
- {{Resize}}
- {{LinkColor}}