Template:ColorScheme: Difference between revisions

From Inkipedia, the Splatoon wiki
(ditch css variables, this feature is sysop-only)
(Changed text colours for better readability per WebAIM contrast standards, added SO)
 
(6 intermediate revisions by one other user not shown)
Line 1: Line 1:
<includeonly>{{#switch: "{{lc:{{{2|}}}}}"
<includeonly>{{#switch: "{{lc: {{{color|{{{2|}}}}}}}}"
|#default = rgb({{SiteColor|{{{1|}}}}})
|#default = rgb({{SiteColor|{{{scheme|{{{1|}}}}}}}})
|"textcolor" = {{#switch: "{{{1|}}}"
|"textcolor" = {{#switch: "{{{scheme|{{{1|}}}}}}"
     |"Generic"        = white
     |"Generic"        = black
     |"NIWA"          = white
     |"NIWA"          = black
     |"Splatoon"      = black
     |"Splatoon"      = black
     |"Splatoon 2"    = white
     |"Splatoon 2"    = black
    |"Octo Expansion" = white
     |"Splatoon 3"    = black
     |"Splatoon 3"    = black
     |"Octo Expansion" = white
     |"Side Order"     = black
     |#default        = black
     |#default        = inherit
}}
}}
|"backgroundcolor" = rgb({{#switch: "{{{1|}}}"
|"contentbackground" = rgba({{SiteColor|{{{scheme|{{{1|}}}}}}}}, 0.2)
    |"Generic"        = 0, 153, 255, 0.2
    |"NIWA"          = 255, 128, 0, 0.2
    |"Splatoon"      = 170, 220, 0, 0.2
    |"Splatoon 2"    = 240, 60, 120, 0.2
    |"Splatoon 3"    = 235, 238, 61, 0.2
    |"Octo Expansion" = 174, 21, 102, 0.2
    |#default        = 192, 192, 192, 0.2
    }})
}}</includeonly><noinclude>__NOTOC__
}}</includeonly><noinclude>__NOTOC__
== The "Generic" color scheme ==
== Arguments ==
* Base color: {{User:Makendo/Sandbox/ColorScheme|Generic}}
This template takes 2 arguments:
* Text color (`textColor`): {{User:Makendo/Sandbox/ColorScheme|Generic|TextColor}}
 
* Background color (`backgroundColor`): {{User:Makendo/Sandbox/ColorScheme|Generic|BackgroundColor}}
* <code>scheme</code>: The color scheme to pick a color from.
* <code>color</code>: The color to apply. Optional; when specified, this should be one of the following:
** <code>themeColor</code>: The main color of the color scheme.
** <code>textColor</code>: The color to use for text set against a background of the main color.
** <code>contentBackground</code>: The background color for the content of a [[Template:Navbox|navbox]], etc.
 
When <code>color</code> is blank or is otherwise none of the values specified, the main color of the scheme given is returned.
 
== Example ==
<pre><nowiki>
<span style="background-color: {{ColorScheme|Splatoon 2}}; color: {{ColorScheme|Splatoon 2|textColor}}; border-radius: 5px; display: inline-block; padding: 0px 5px 0px 5px;">It works!</span>
</nowiki></pre>
 
<span style="background-color:{{ColorScheme|Splatoon 2}}; color:{{ColorScheme|Splatoon 2|textColor}}; border-radius:5px; display:inline-block; padding: 0px 5px 0px 5px;">It works!</span>
</noinclude>
</noinclude>

Latest revision as of 20:40, 9 July 2024

Arguments

This template takes 2 arguments:

  • scheme: The color scheme to pick a color from.
  • color: The color to apply. Optional; when specified, this should be one of the following:
    • themeColor: The main color of the color scheme.
    • textColor: The color to use for text set against a background of the main color.
    • contentBackground: The background color for the content of a navbox, etc.

When color is blank or is otherwise none of the values specified, the main color of the scheme given is returned.

Example

<span style="background-color: {{ColorScheme|Splatoon 2}}; color: {{ColorScheme|Splatoon 2|textColor}}; border-radius: 5px; display: inline-block; padding: 0px 5px 0px 5px;">It works!</span>

It works!