Home
Random
Recent changes
Special pages
Community portal
Preferences
About Real-Life Villains
Disclaimers
Real-Life Villains
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Template:Color/doc
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Documentation subpage}} __NOTOC__ <!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE --> {{high-use}} {{Warning |'''Prose text intended for readers should never be manually colored.''' ([[MOS:PROSECOLOR]])}} This template can be used to specify the foreground color of a span of text. Acceptable values are [[RGB color model|RGB]] hex codes, e.g. #C9E72A, or any of the [[web colors]]: red, blue, green, moccasin, darkorchid, etc. To set the background color of a span of text, use {{Template link|background color}}. === Usage === * {{Template link expanded|color|name of color or hex code of color|Text}} For example: *{{demo inline|<nowiki>{{color|red|Hello, world!}}</nowiki>}} *{{demo inline|<nowiki>{{color|#00F000|Hello, world!}}</nowiki>}} If the second parameter is omitted, the color value is displayed as text: * {{demo inline|<nowiki>{{color|#00F000}}</nowiki>}} * {{demo inline|<nowiki>{{color|red}}</nowiki>}} === Performance considerations === The template generates an HTML span tag: <nowiki><span style="color:{{{1}}}">{{{2}}}</span></nowiki> It runs at speeds in excess of 700 per second,{{clarify|date=January 2022}} and so is functionally identical to using the HTML markup directly. === Template data === {{TemplateData header}} <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 formatted in the desired color", "type": "string", "suggested": true } } } </templatedata> === Redirects === * {{Template link general |COLOR|nolink=on|code=on}} * {{Template link general |Colored text|nolink=on|code=on}} * {{Template link general |Colour|nolink=on|code=on}} * {{Template link general|COLOUR|nolink=on|code=on}} * {{Template link general |Fgcolor|nolink=on|code=on}} === See also === * {{Template link|resize}} * {{Template link|colored link}} * {{Template link|background color}} * {{Template link|font color}} β allows setting both text and background color * {{Template link|coltit}} β colored table header cell <includeonly>{{Sandbox other| | <!-- CATEGORIES BELOW THIS LINE, PLEASE: --> [[Category:Text color templates| ]] }}</includeonly>
Summary:
Please note that all contributions to Real-Life Villains may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Real-Life Villains:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Clarify
(
edit
)
Template:Demo inline
(
edit
)
Template:Documentation subpage
(
edit
)
Template:High-use
(
edit
)
Template:Mbox
(
edit
)
Template:TemplateData header
(
edit
)
Template:Template link
(
edit
)
Template:Template link expanded
(
edit
)
Template:Template link general
(
edit
)
Template:Warning
(
edit
)