Template:Colors: Difference between revisions

From XMS Wiki
Jump to navigationJump to search
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 12: Line 12:
*links have a color according to user settings; they become invisible if this color is equal to the background color.
*links have a color according to user settings; they become invisible if this color is equal to the background color.


==See also ==
* {{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==
==Examples==


<nowiki>{{colors|#ffffff|#000000|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|#ffffff|#000000|From [[Wikipedia]], the free [[encyclopedia]].}}  
<nowiki>{{colors|#ffffff|#000000|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}}</nowiki> gives: {{colors|#ffffff|#000000|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}}  


<nowiki>{{colors|#aa0000|#009999|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|#aa0000|#009999|From [[Wikipedia]], the free [[encyclopedia]].}}  
<nowiki>{{colors|#aa0000|#009999|From [http://en.wikipedia.org/wiki/Main_Page], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia wikipedia].}}</nowiki> gives: {{colors|#aa0000|#009999|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}}  


<nowiki>{{colors|white|black|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|white|black|From [[Wikipedia]], the free [[encyclopedia]].}}  
<nowiki>{{colors|white|black|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}}</nowiki> gives: {{colors|white|black|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}}  


<nowiki>{{colors|yellow|grey|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|yellow|grey|From [[Wikipedia]], the free [[encyclopedia]].}}  
<nowiki>{{colors|yellow|grey|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}}</nowiki> gives: {{colors|yellow|grey|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}}  


<nowiki>{{colors|blue|silver|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|blue|silver|From [[Wikipedia]], the free [[encyclopedia]].}}  
<nowiki>{{colors|blue|silver|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}}</nowiki> gives: {{colors|blue|silver|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}}  


<nowiki>{{colors|grey|yellow|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|grey|yellow|From [[Wikipedia]], the free [[encyclopedia]].}}  
<nowiki>{{colors|grey|yellow|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}}</nowiki> gives: {{colors|grey|yellow|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}}  


<nowiki>{{colors|black|aqua|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|black|aqua|From [[Wikipedia]], the free [[encyclopedia]].}}
<nowiki>{{colors|black|aqua|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}}</nowiki> gives: {{colors|black|aqua|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}}


== Standard color names ==
== Standard color names ==
Line 91: Line 84:
*{{tiw|Fontcolor}}
*{{tiw|Fontcolor}}
*[http://lynda.com/hex.asp# non-dithering safe colors]
*[http://lynda.com/hex.asp# non-dithering safe colors]
[[Category:Typing-aid templates|{{PAGENAME}} ]]
Category:Typing-aid templates|{{PAGENAME}} ]]
Category:text color templates
Category:text color templates
[[Category:Formatting templates|{{PAGENAME}} ]]<!--- Keep for compatibility with en.wp ---->
Category:Formatting templates|{{PAGENAME}} ]]<!--- Keep for compatibility with en.wp ---->
</noinclude>
 
<noinclude>
[[Category:Color]]
</noinclude>
</noinclude>

Latest revision as of 15:04, 2 June 2014

{{{3}}}

Colors ]]
Similar templates at English sister projects [edit]
Wikimedia-logo.png mta Meta-wiki Colors
wpd Wikipedia Colors
cms Commons Colors
Wikibooks-logo.png wbk Wikibooks Colors
wsp Wikispecies Colors
wvy Wikiversity Colors

Usage

Guts: <span style="background: {{{2}}}; color: {{{1}}}">{{{3}}}</span>

Sets foreground and background colors of a given text. They can be specified by name or in the format #dddddd (RGB hex triplet).

Unless in the case of personal use on a user page, use this template with great caution:

  • a poor contrast may make the text difficult or impossible to read
  • 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.


Examples

{{colors|#ffffff|#000000|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}} gives: From wikipedia, the free encyclopedia.


{{colors|#aa0000|#009999|From [http://en.wikipedia.org/wiki/Main_Page], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia wikipedia].}} gives: From wikipedia, the free encyclopedia.


{{colors|white|black|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}} gives: From wikipedia, the free encyclopedia.


{{colors|yellow|grey|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}} gives: From wikipedia, the free encyclopedia.


{{colors|blue|silver|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}} gives: From wikipedia, the free encyclopedia.


{{colors|grey|yellow|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}} gives: From wikipedia, the free encyclopedia.


{{colors|black|aqua|From [http://en.wikipedia.org/wiki/Main_Page wikipedia], the free [http://en.wikipedia.org/wiki/Encyclopedia encyclopedia].}} gives: From wikipedia, the free encyclopedia.


Standard color names

The HTML 4.01 specification defines sixteen named colors, as follows:

Color Hexadecimal Color Hexadecimal
black #000000 silver #c0c0c0
gray #808080 white #ffffff
maroon #800000 red #ff0000
purple #800080 fuchsia #ff00ff
green #008000 lime #00ff00
olive #808000 yellow #ffff00
navy #000080 blue #0000ff
teal #008080 aqua #00ffff

See also:

Category:Typing-aid templates|Colors ]] Category:text color templates Category:Formatting templates|Colors ]]