Difference between revisions of "Template:SiteColor"

From WikiMe @ iroiro.io
Jump to: navigation, search
ink>GuyPerfect
m (Removing TOC)
ink>GuyPerfect
m (It makes more sense as just the color triplet)
Line 1: Line 1:
<includeonly>rgb{{#if:{{{2|}}}|a}}({{#switch: "{{{1|}}}"
+
<includeonly>{{#switch: "{{{1|}}}"
 
|"Splatoon"  = 170, 220, 0
 
|"Splatoon"  = 170, 220, 0
 
|"Splatoon 2" = 240, 60, 120
 
|"Splatoon 2" = 240, 60, 120
 
|#default    = 196, 196, 196
 
|#default    = 196, 196, 196
}}{{#if:{{{2|}}}|, {{{2}}}}})</includeonly><noinclude>
+
}}</includeonly><noinclude>
 
__NOTOC__
 
__NOTOC__
Produces a CSS color value using Inkipedia site colors.
+
Produces an RGB triplet color value using Inkipedia site colors.
  
 
=== Usage ===
 
=== Usage ===
  <nowiki>{{</nowiki>SiteColor|''theme''[|''alpha'']}}
+
  <nowiki>{{</nowiki>SiteColor|''theme''}}
 
==== Parameters ====
 
==== Parameters ====
 
''theme'' - The theme ID for the color to use. Must be one of the following:
 
''theme'' - The theme ID for the color to use. Must be one of the following:
Line 14: Line 14:
 
*{{Ink|custom|16|rgb(240, 60, 120)}} "Splatoon 2"
 
*{{Ink|custom|16|rgb(240, 60, 120)}} "Splatoon 2"
 
*{{Ink|custom|16|rgb(196, 196, 196)}} ''Any other value''
 
*{{Ink|custom|16|rgb(196, 196, 196)}} ''Any other value''
''alpha'' - If present, a number in the range [0.0, 1.0] representing the opacity of the color. If absent, a fully-opaque color is produced.
 
  
 
=== Example ===
 
=== Example ===
 
==== Markup ====
 
==== Markup ====
  <nowiki><span style="color: {{SiteColor|Splatoon 2|0.5}};">Sample text</span></nowiki>
+
  <nowiki><span style="color: rgb({{SiteColor|Splatoon 2|0.5}});">Sample text</span></nowiki>
  
 
==== Output ====
 
==== Output ====
<span style="color: {{User:GuyPerfect/SiteColor|Splatoon 2|0.5}};">Sample text</span>
+
<span style="color: rgb({{User:GuyPerfect/SiteColor|Splatoon 2}});">Sample text</span>
 
</noinclude>
 
</noinclude>

Revision as of 02:20, 17 January 2017


Produces an RGB triplet color value using Inkipedia site colors.

Usage

{{SiteColor|theme}}

Parameters

theme - The theme ID for the color to use. Must be one of the following:

  •   "Splatoon"
  •   "Splatoon 2"
  •   Any other value

Example

Markup

<span style="color: rgb({{SiteColor|Splatoon 2|0.5}});">Sample text</span>

Output

Sample text