Template:SiteColor: Difference between revisions

From Inkipedia, the Splatoon wiki
(Created page with "<includeonly>rgb{{#if:{{{2|}}}|a}}({{#switch: "{{{1|}}}" |"Splatoon" = 170, 220, 0 |"Splatoon 2" = 240, 60, 120 |#default = 196, 196, 196 }}{{#if:{{{2|}}}|, {{{2}}}}})</...")
 
(making into module invocation (stand back, I'm trying science))
Tag: Replaced
 
(33 intermediate revisions by 12 users not shown)
Line 1: Line 1:
<includeonly>rgb{{#if:{{{2|}}}|a}}({{#switch: "{{{1|}}}"
<includeonly>{{#invoke:SiteColor|main}}</includeonly><noinclude>
|"Splatoon"  = 170, 220, 0
Template invocation of [[Module:SiteColor]].
|"Splatoon 2" = 240, 60, 120
|#default    = 196, 196, 196
}}{{#if:{{{2|}}}|, {{{2}}}}})</includeonly><noinclude>
Produces a CSS color value using Inkipedia site colors.


=== Usage ===
{{:Module:SiteColor/doc}}
<nowiki>{{</nowiki>SiteColor|''theme''[|''alpha'']}}
==== Parameters ====
''theme'' - The theme ID for the color to use. Must be one of the following:
*{{Ink|custom|16|rgb(170, 220, 0)}} "Splatoon"
*{{Ink|custom|16|rgb(240, 60, 120)}} "Splatoon 2"
*{{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.
</noinclude>
</noinclude>

Latest revision as of 21:17, 5 September 2023

Template invocation of Module:SiteColor.


Produces an RGB triplet color value using Inkipedia site colors.

Parameters

{{SiteColor|<theme>}}

theme Unnamed. The theme ID for the color to use. Must be one of the following:
  •   Generic
  •   Octo Expansion
  •   Salmon Run
  •   Side Order
  •   NIWA
  •   Splatoon
  •   Splatoon 2
  •   Splatoon 3
  •   Any other value, including unspecified

Example

Markup

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

For use in templates with an optional color parameter:

style=" background:rgb({{#if:{{{color|}}}|{{{color}}}|{{SiteColor|Generic}}}}); " 

Output

Sample text


Class Example

You may also use Site Color's defined classes directly.

These are defined in MediaWiki:SiteColor.css. If this needs updating, please ask one of the interface administrators.


{| class="wikitable sitecolor-niwa"
! Column 1
! Column 2
|+
| Example || Value
|-
|}
Column 1 Column 2
Example Value
<div class="site-color-background-generic site-color-text-generic">Sample Generic Text</div>
<div class="site-color-background-shadow-niwa site-color-text-niwa">Sample NIWA Text</div>
<div class="site-color-background-shadow-s site-color-text-s">Sample S Text</div>
Sample Generic Text
Sample NIWA Text
Sample S Text