Template:format

From Homestar Runner Wiki

(Difference between revisions)
Jump to: navigation, search
(Standard color names: er... removing/fixing categories)
(tbd)
 
(includes 8 intermediate revisions)
Line 1: Line 1:
-
<span style="background: {{{2}}}; color: {{{1}}}">{{{3}}}</span><noinclude>
+
<noinclude>{{tbd}}</noinclude><span style="<!--
-
{{interwikitmp-grp|V=3}}
+
-->{{#if:{{{2|}}}|background: {{{2}}};|}} <!--
-
==Usage==
+
-->{{#if:{{{1|}}}|color: {{{1}}};|}} <!--
-
Guts:  
+
-->{{#if:{{{size|}}}|font-size: {{{size}}};|}} <!--
-
'''<nowiki><span style="background: {{{2}}}; color: {{{1}}}">{{{3}}}</span></nowiki>'''
+
-->{{#if:{{{shadow|}}}}|text-shadow: {{{shadow}}};|}}<!--
 +
-->{{#if:{{{padding|}}}}|padding: {{{padding}}};|}}<!--
 +
-->{{#if:{{{float|}}}}|float: {{{float}}};|}}<!--
 +
-->{{#if:{{{top|}}}}|position: relative;|}}<!-- /* position used in top/bottom/left/right relative parameters */
 +
-->{{#if:{{{top|}}}}|top: {{{top}}};|}}<!--
 +
-->">{{{t|{{{3}}}}}}</span><noinclude>
 +
----
 +
=== Usage ===
 +
Gives text a foreground and background color. Both are CSS values.
-
Sets foreground and background [[web colors|colors]] of a given text. They can be specified by name or in the format #dddddd (RGB hex triplet).
+
* Original Use:
 +
<code><nowiki>{{colors|foreground|background|text}}</nowiki></code>
-
Unless in the case of personal use on a user page, use this template with great caution:
+
* Alternate use:
-
*a poor contrast may make the text difficult or impossible to read
+
<code><nowiki>{{format|foreground|background|t=text|size=font size|shadow=shadow settings|padding=padding|float=float value|top=relative top position}}</nowiki></code>
-
*the contrast can be experienced as even poorer in the case of [[color blindness]]
+
-
*links have a color according to user settings; they become invisible if this color is equal to the background color.
+
-
==See also ==
+
* Note: All parameters except the text are optional
-
 
+
[[Category:Simple Formatting Templates|{{PAGENAME}}]]
-
* {{tl|Colors}} – background/text color (text in free span)
+
-
* {{tl|TextColors}} – background/text color (text in block table)
+
-
* {{tl|NestTextColors}} – background/text color (text in block div)
+
-
* {{tl|bkg}} – background color (text in free span)
+
-
* {{tl|bg}} – background color (text in free span)
+
-
 
+
-
==Examples==
+
-
 
+
-
<nowiki>{{colors|#ffffff|#000000|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|#ffffff|#000000|From [[Wikipedia]], the free [[encyclopedia]].}}
+
-
 
+
-
<nowiki>{{colors|#aa0000|#009999|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|#aa0000|#009999|From [[Wikipedia]], the free [[encyclopedia]].}}
+
-
 
+
-
<nowiki>{{colors|white|black|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|white|black|From [[Wikipedia]], the free [[encyclopedia]].}}
+
-
 
+
-
<nowiki>{{colors|yellow|grey|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|yellow|grey|From [[Wikipedia]], the free [[encyclopedia]].}}
+
-
 
+
-
<nowiki>{{colors|blue|silver|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|blue|silver|From [[Wikipedia]], the free [[encyclopedia]].}}
+
-
 
+
-
<nowiki>{{colors|grey|yellow|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|grey|yellow|From [[Wikipedia]], the free [[encyclopedia]].}}
+
-
 
+
-
<nowiki>{{colors|black|aqua|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|black|aqua|From [[Wikipedia]], the free [[encyclopedia]].}}
+
-
 
+
-
== Standard color names ==
+
-
 
+
-
The [[HTML]] 4.01 specification defines sixteen named colors, as follows:
+
-
 
+
-
{| border="0"
+
-
!Color
+
-
!Hexadecimal
+
-
!Color
+
-
!Hexadecimal
+
-
|-
+
-
|black
+
-
|style="background:#000000; color:#ffffff; font-family:monospace;"|#000000
+
-
|silver
+
-
|style="background:#c0c0c0; color:#000000; font-family:monospace;"|#c0c0c0
+
-
|-
+
-
|gray
+
-
|style="background:#808080; color:#ffffff; font-family:monospace;"|#808080
+
-
|white
+
-
|style="background:#ffffff; color:#000000; font-family:monospace;"|#ffffff
+
-
|-
+
-
|maroon
+
-
|style="background:#800000; color:#ffffff; font-family:monospace;"|#800000
+
-
|red
+
-
|style="background:#ff0000; color:#000000; font-family:monospace;"|#ff0000
+
-
|-
+
-
|purple
+
-
|style="background:#800080; color:#ffffff; font-family:monospace;"|#800080
+
-
|fuchsia
+
-
|style="background:#ff00ff; color:#000000; font-family:monospace;"|#ff00ff
+
-
|-
+
-
|green
+
-
|style="background:#008000; color:#ffffff; font-family:monospace;"|#008000
+
-
|lime
+
-
|style="background:#00ff00; color:#000000; font-family:monospace;"|#00ff00
+
-
|-
+
-
|olive
+
-
|style="background:#808000; color:#ffffff; font-family:monospace;"|#808000
+
-
|yellow
+
-
|style="background:#ffff00; color:#000000; font-family:monospace;"|#ffff00
+
-
|-
+
-
|navy
+
-
|style="background:#000080; color:#ffffff; font-family:monospace;"|#000080
+
-
|blue
+
-
|style="background:#0000ff; color:#000000; font-family:monospace;"|#0000ff
+
-
|-
+
-
|teal
+
-
|style="background:#008080; color:#ffffff; font-family:monospace;"|#008080
+
-
|aqua
+
-
|style="background:#00ffff; color:#000000; font-family:monospace;"|#00ffff
+
-
|}
+
-
 
+
-
See also:
+
-
*[[web colors]]
+
-
*{{tiw|Fontcolor}}
+
-
*[http://lynda.com/hex.asp# non-dithering safe colors]
+
-
[[Category:Formatting Templates|{{PAGENAME}} ]]<!--- Keep for compatibility with en.wp ---->
+
</noinclude>
</noinclude>

Current revision as of 03:59, 3 February 2023

{{{3}}}


[edit] Usage

Gives text a foreground and background color. Both are CSS values.

  • Original Use:

{{colors|foreground|background|text}}

  • Alternate use:

{{format|foreground|background|t=text|size=font size|shadow=shadow settings|padding=padding|float=float value|top=relative top position}}

  • Note: All parameters except the text are optional
Personal tools