- Welcome to the Kancolle Wiki!
- If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord
Difference between revisions of "Template:Color"
>CDRW (Created page with "<span style="color:{{{1|}}}">{{{2|}}}</span><noinclude>{{Documentation}}<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS --></noinclude>") |
|||
Line 1: | Line 1: | ||
− | <span style="color:{{{1|}}}">{{{2|}}}</span><noinclude>{{Documentation}}<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS --></noinclude> | + | <span style="color:{{{1|}}}">{{{2|{{{1|}}}}}}</span><noinclude>{{Documentation}}<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS --></noinclude> |
Latest revision as of 13:10, 6 June 2019
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.
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
Template:TemplateDataHeader <templatedata> {
"description": "The color template can be used to add a span of text with any given text color", "params": { "1": { "label": "Color", "description": "CSS name of color or hex code of color, e.g. 'red' or '#00F000'.", "type": "string", "required": true }, "2": { "label": "Text", "description": "The string of text to be be formatted in the desired color", "type": "string", "required": true } }
} </templatedata>
See also
- {{Background color}}
- {{Resize}}
- {{LinkColor}}