Difference between revisions of "Template:Color template doc/doc"

From blackwiki
Jump to navigation Jump to search
imported>Useddenim
m ({{1Color template documentation}})
imported>Vanisaac
m (→‎See also: clean up per WP:CAT#T and WP:AWBREQ add template:Sandbox other)
 
(7 intermediate revisions by 6 users not shown)
Line 3: Line 3:
  
  
This template lists as a [[Help:Table/Introduction to tables|wikitable]] row a template name and up to three arguments, a color sample and its hex value.
+
This template lists as a [[Help:Table/Introduction to tables|wikitable]] row a template name and up to five arguments, a color sample and its hex value.
  
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
|
 
|
<code><nowiki>{{</nowiki>Template:system color}}</code>
+
<code><nowiki>{{</nowiki>system color}}</code>
 
| Sample:
 
| Sample:
 
| style="width:2em; border-top:solid 1px gray; " | [[File:White grey checkerboard.svg|30px]]
 
| style="width:2em; border-top:solid 1px gray; " | [[File:White grey checkerboard.svg|30px]]
Line 14: Line 14:
 
|-
 
|-
 
|
 
|
<code><nowiki>{{</nowiki>Template:system color{{!}}argument_1}}</code>
+
<code><nowiki>{{</nowiki>system color{{!}}argument_1}}</code>
 
| Sample:
 
| Sample:
 
| style="width:2em; border-top:solid 1px gray; " | [[File:White grey checkerboard.svg|30px]]
 
| style="width:2em; border-top:solid 1px gray; " | [[File:White grey checkerboard.svg|30px]]
Line 20: Line 20:
 
|-
 
|-
 
|
 
|
<code><nowiki>{{</nowiki>Template:system color{{!}}argument_1}}</code> ''or'' <code>…{{!}}argument_2}}</code>
+
<code><nowiki>{{</nowiki>system color{{!}}argument_1}}</code> ''or'' <code>…{{!}}argument_2}}</code>
 
| Sample:
 
| Sample:
 
| style="width:2em; border-top:solid 1px gray; " | [[File:White grey checkerboard.svg|30px]]
 
| style="width:2em; border-top:solid 1px gray; " | [[File:White grey checkerboard.svg|30px]]
Line 26: Line 26:
 
|-
 
|-
 
|
 
|
<code><nowiki>{{</nowiki>Template:system color{{!}}argument_1}}</code> ''or'' <code>…{{!}}argument_2}}</code> ''or'' <code>…{{!}}argument_3}}</code>
+
<code><nowiki>{{</nowiki>system color{{!}}argument_1}}</code> ''or'' <code>…{{!}}argument_2}}</code> ''or'' <code>…{{!}}argument_3}}</code>
 +
| Sample:
 +
| style="width:2em; border-top:solid 1px gray; " | [[File:White grey checkerboard.svg|30px]]
 +
| <code>hexval</code>
 +
 
 +
|-
 +
|
 +
<code><nowiki>{{</nowiki>system color{{!}}argument_1}}</code> ''or'' <code>…{{!}}argument_2}}</code> ''or'' <code>…{{!}}argument_3}}</code> ''or'' <code>…{{!}}argument_4}}</code>
 +
| Sample:
 +
| style="width:2em; border-top:solid 1px gray; " | [[File:White grey checkerboard.svg|30px]]
 +
| <code>hexval</code>
 +
 
 +
|-
 +
|
 +
<code><nowiki>{{</nowiki>system color{{!}}argument_1}}</code> ''or'' <code>…{{!}}argument_2}}</code> ''or'' <code>…{{!}}argument_3}}</code> ''or'' <code>…{{!}}argument_4}}</code> ''or'' <code>…{{!}}argument_5}}</code>
 
| Sample:
 
| Sample:
 
| style="width:2em; border-top:solid 1px gray; " | [[File:White grey checkerboard.svg|30px]]
 
| style="width:2em; border-top:solid 1px gray; " | [[File:White grey checkerboard.svg|30px]]
Line 35: Line 49:
 
The template itself is contained between table start and end markup:
 
The template itself is contained between table start and end markup:
 
  <code><nowiki>{| class="wikitable"</nowiki><br><nowiki>
 
  <code><nowiki>{| class="wikitable"</nowiki><br><nowiki>
{{Color template doc|</nowiki>''argument_1''<nowiki>|</nowiki>''argument_2''<nowiki>|</nowiki>''argument_3''<nowiki>}}</nowiki><br><nowiki>
+
{{Color template doc|</nowiki>''argument_1''<nowiki>|</nowiki>''argument_2''<nowiki>|…|</nowiki>''argument_5''<nowiki>}}</nowiki><br><nowiki>
 
|}</nowiki></code>
 
|}</nowiki></code>
<tt>''argument_1''</tt> can be omitted if the color template has only one value, or it is desired to show the default color; <tt>''argument_2''</tt> and <tt>''argument_3''</tt> are optional. All three are valid inputs for the color template.
+
<code>''argument_1''</code> can be omitted if the color template has only one value, or it is desired to show the default color; <code>''argument_2''</code> through <code>''argument_5''</code> are optional. All five are valid inputs for the color template.
  
 
=== Examples ===
 
=== Examples ===
When used on the page [[Template:Amtrak color/doc]], the code <code><nowiki>{{Color template doc|}}</nowiki></code> produces
+
When used on the page [[Template:TTC color/doc]], the code <code><nowiki>{{Color template doc|}}</nowiki></code> produces
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
| {{tlc|Amtrak color}}
+
| {{tlc|TTC color}}
 
| Sample:
 
| Sample:
| style="background:#{{Amtrak color|}}; border-top:solid 1px gray; " | {{pad|2em}}
+
| style="background:#{{TTC color|}}; border-top:solid 1px gray; " | {{pad|2em}}
| <code>{{lc:{{Amtrak color|}}}}</code>
+
| <code>{{lc:{{TTC color|}}}}</code>
 
|}
 
|}
 
while the code <code><nowiki>{{Color template doc|#default}}</nowiki></code> produces
 
while the code <code><nowiki>{{Color template doc|#default}}</nowiki></code> produces
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
| {{tlc|Amtrak color|#default}}
+
| {{tlc|TTC color|#default}}
 
| Sample:
 
| Sample:
| style="background:#{{Amtrak color|#default}}; border-top:solid 1px gray; " | {{pad|2em}}
+
| style="background:#{{TTC color|#default}}; border-top:solid 1px gray; " | {{pad|2em}}
| <code>{{lc:{{Amtrak color|#default}}}}</code>
+
| <code>{{lc:{{TTC color|#default}}}}</code>
 
|}
 
|}
  
Line 74: Line 88:
 
* {{tl|1Color template documentation}}
 
* {{tl|1Color template documentation}}
  
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
+
<includeonly>{{Sandbox other||
 
<!-- Categories go here, and interwikis go in Wikidata -->
 
<!-- Categories go here, and interwikis go in Wikidata -->
 
[[Category:Rail transport color templates]]
 
[[Category:Rail transport color templates]]
 
}}</includeonly>
 
}}</includeonly>

Latest revision as of 15:39, 24 April 2020


This template lists as a wikitable row a template name and up to five arguments, a color sample and its hex value.

{{system color}}

Sample: White grey checkerboard.svg hexval

{{system color|argument_1}}

Sample: White grey checkerboard.svg hexval

{{system color|argument_1}} or …|argument_2}}

Sample: White grey checkerboard.svg hexval

{{system color|argument_1}} or …|argument_2}} or …|argument_3}}

Sample: White grey checkerboard.svg hexval

{{system color|argument_1}} or …|argument_2}} or …|argument_3}} or …|argument_4}}

Sample: White grey checkerboard.svg hexval

{{system color|argument_1}} or …|argument_2}} or …|argument_3}} or …|argument_4}} or …|argument_5}}

Sample: White grey checkerboard.svg hexval

Usage

The template itself is contained between table start and end markup:

{| class="wikitable"
{{Color template doc|argument_1|argument_2|…|argument_5}}
|}

argument_1 can be omitted if the color template has only one value, or it is desired to show the default color; argument_2 through argument_5 are optional. All five are valid inputs for the color template.

Examples

When used on the page Template:TTC color/doc, the code {{Color template doc|}} produces

{{TTC color}} Sample: style="background:#Template:TTC color; border-top:solid 1px gray; " |   template:ttc color

while the code {{Color template doc|#default}} produces

{{TTC color|#default}} Sample: style="background:#Template:TTC color; border-top:solid 1px gray; " |   template:ttc color

Additional information can be added to the table. On the page Template:NYCS color/doc the code

{{Color template doc|blue}}
| [[IND Eighth Avenue Line|Eighth Avenue]]
| A / C / E / Eighth

produces

{{NYCS color|blue}} Sample:   0039a6 Eighth Avenue A / C / E / Eighth

See also