Template:Colors/doc

From wiki.jriver.com
< Template:Colors
Revision as of 06:08, 11 April 2014 by Glynor (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

{{

 #ifeq: Template | Template 
 | {{
   #ifeq: {{ #if:  | {{{reusedemo}}} | Wiki.jriver.com }} | Wikia Templates
   | {{
     #ifeq: Colors | {{ #ifeq: {{ #titleparts: Colors/doc | 1 | -1 }} | doc | Colors | Colors/doc }}
     | 
     | :Error: {{{name}}} parameter is unused or incorrect! Please replace {{SPW{{ #if: is not on | |is not on }}{{ #ifeq: Colors | ¬ | | |name=Colors }}}} with {{SPW{{ #if: is not on | |is not on }}|name=Colors}}.
}}:{{ #switch: is not on | is on = This template or a similar one is on the Starter Pages Wikia, whence it is incorporated in every new Wikia site and can be copied to older ones. | is newer = This template is newer than a similar one on the Starter Pages Wikia. This template may therefore have bug fixes or improvements when compared to the older version.{{ #ifeq: {{ #titleparts: Colors/doc | 1 | 1 }} | SPW | | {{ #ifeq: {{ #titleparts: Colors/doc | 1 | -1 }} | doc | | }} }} | is not on = This template is not on the Starter Pages Wikia. It can be copied to other Wikia sites, but it is not included on any by default.{{ #ifeq: {{ #titleparts: Colors/doc | 1 | 1 }} | SPW | | {{ #ifeq: {{ #titleparts: Colors/doc | 1 | -1 }} | doc | | }} }} | #default = Editors have not checked whether this template is or is not on the Starter Pages Wikia.{{ #ifeq: {{ #titleparts: Colors/doc | 1 | 1 }} | SPW | | {{ #ifeq: {{ #titleparts: Colors/doc | 1 | -1 }} | doc | | }} }} }}

|

   {{ #ifeq: {{ #titleparts: Colors/doc | 1 | -1 }} | doc |  | }}
 }}

}}

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

{{#ifeq:|code|}}{{{{#if:|{{{prefix}}}:}}Colors{{#if:text color||<text color>}}{{#if:background color||<background color>}}{{#if:text||<text>}}{{#if:||<{{{5}}}>}}{{#if:||<{{{6}}}>}}{{#if:||<{{{7}}}>}}{{#if:||<{{{8}}}>}}{{#if:||<{{{9}}}>}}{{#if:||<{{{10}}}>}}{{#if:||<{{{11}}}>}}{{#if:||<{{{12}}}>}}{{#if:||<{{{13}}}>}}{{#if:||<{{{14}}}>}}{{#if:||<{{{15}}}>}}{{#if:||<{{{16}}}>}}{{#if:||<{{{17}}}>}}{{#if:||<{{{18}}}>}}{{#if:||<{{{19}}}>}}{{#if:||<{{{20}}}>}}{{#if:||<{{{21}}}>}}}}{{#ifeq:|code|}}

Code

Guts:

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

The HTML 4.01 specification (for details see Wikipedia:HTML) 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
Notes

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 colour blindnes
  • links have a color according to user settings; they become invisible if this color is equal to the background color.
Sample output

{{colors|#ffffff|#000000|From [[wikipedia:|Wikipedia]], the free [[wikipedia:encyclopedia|]].}} gives: From Wikipedia, the free encyclopedia.

{{colors|#aa0000|#009999|From [[wikipedia:|Wikipedia]], the free [[wikipedia:encyclopedia|]].}} gives: From Wikipedia, the free encyclopedia.

{{colors|white|black|From [[wikipedia:|Wikipedia]], the free [[wikipedia:encyclopedia|]].}} gives: From Wikipedia, the free encyclopedia.

{{colors|yellow|grey|From [[wikipedia:|Wikipedia]], the free [[wikipedia:encyclopedia|]].}} gives: From Wikipedia, the free encyclopedia.

{{colors|blue|silver|From [[wikipedia:|Wikipedia]], the free [[wikipedia:encyclopedia|]].}} gives: From Wikipedia, the free encyclopedia.

{{colors|grey|yellow|From [[wikipedia:|Wikipedia]], the free [[wikipedia:encyclopedia|]].}} gives: From Wikipedia, the free encyclopedia.

{{colors|black|aqua|From [[wikipedia:|Wikipedia]], the free [[wikipedia:encyclopedia|]].}} gives: From Wikipedia, the free encyclopedia.

See also
  • {{#ifeq:|code|}}{{{{#if:|{{{prefix}}}:}}Fontcolor{{#if:||<{{{2}}}>}}{{#if:||<{{{3}}}>}}{{#if:||<{{{4}}}>}}{{#if:||<{{{5}}}>}}{{#if:||<{{{6}}}>}}{{#if:||<{{{7}}}>}}{{#if:||<{{{8}}}>}}{{#if:||<{{{9}}}>}}{{#if:||<{{{10}}}>}}{{#if:||<{{{11}}}>}}{{#if:||<{{{12}}}>}}{{#if:||<{{{13}}}>}}{{#if:||<{{{14}}}>}}{{#if:||<{{{15}}}>}}{{#if:||<{{{16}}}>}}{{#if:||<{{{17}}}>}}{{#if:||<{{{18}}}>}}{{#if:||<{{{19}}}>}}{{#if:||<{{{20}}}>}}{{#if:||<{{{21}}}>}}}}{{#ifeq:|code|}} – background/text color or change text color only if only 2 parameters (text in free span)
  • Wikipedia:web colors
  • non-dithering safe colors