Template:Color: Difference between revisions

Template page
(This template should NOW accept hex and HTML color names)
(Undo revision 444137 by Wakeup720 (talk) The monochrome button can simply look for "span" and "div" tags which will be both more encompassing and simpler to implement)
Tag: Undo
 
(29 intermediate revisions by 9 users not shown)
Line 9: Line 9:


Use these numbers to add any additional game's color scheme.
Use these numbers to add any additional game's color scheme.
-->{{#vardefine:game|{{#if:{{{game|}}}|{{{game|}}}|{{ROOTPAGENAME}}}}}}{{#vardefine:color|
-->{{#vardefine:game-clr|{{{game|{{ROOTPAGENAME}}}}}}}<!--
{{#switch: {{#var:game}}
-->{{#vardefine:color|
  | GGACR | GGML | GGXRD-R2 | GGST = {{#switch: {{{1}}}
{{#switch: {{#var:game-clr}}
   | 1 | P = 1
  | GGX | GGACR | GGML | GGXRD-R2 | GGST = {{#switch: {{{1}}}
   | 2 | K = 2
   | P = 1
   | 3 | S = 3
   | K = 2
   | 4 | H = 4
   | S = 3
   | 5 | D = 5
   | H = 4
   | D = 5
   | #default = {{{1}}}
   | #default = {{{1}}}
  }}
  }}
  | BBCF = {{#switch: {{{1}}}
  | BBCF | BBCT = {{#switch: {{{1}}}
   | A = 4
   | A = 4
   | B = 2
   | B = 2
Line 49: Line 50:
   | #default = {{{1}}}
   | #default = {{{1}}}
  }}
  }}
  | GBVS = {{#switch: {{{1}}}
  | GBVS | GBVSR = {{#switch: {{{1}}}
   | 1 | L = 1
   | 1 | L = 1
   | 2 | M = 3
   | 2 | M = 3
   | 3 | H = 4
   | 3 | H = 4
   | 4 | U = 2
   | 4 | U = 2
  | 6 | G = 5
   | #default = {{{1}}}
   | #default = {{{1}}}
  }}
  }}
  | HNK = {{#switch: {{{1}}}
  | HNK = {{#switch: {{{1}}}
   | 1 | A = 5
   | 1 | A = 5
   | 2 | B = 4
   | 2 | B = 1
   | 3 | C = 1
   | 3 | C = 4
   | 4 | D = 3
   | 4 | D = 3
   | 5 | E = 2
   | 5 | E = 2
   | #default = {{{1}}}
   | #default = {{{1}}}
  }}
  }}
  | P4Arena | P4AU | P4U2.5 = {{#switch: {{{1}}}
  | P4Arena | P4AU | P4U2R = {{#switch: {{{1}}}
   | 1 | A = 1
  | A = 1
   | 2 | B = 2
  | B = 2
   | 3 | C = 3
  | C = 3
   | 4 | D = 4
  | D = 4
  | #default = {{{1}}}
}}
| SBX = {{#switch: {{{1}}}
   | 1 | A = 5
   | 2 | B = 3
  | 3 | C = 2
   | 4 | E = 4
  | #default = {{{1}}}
}}
| SMS = {{#switch: {{{1}}}
  | 1 | LP = 3
  | 2 | HP = 2
  | 3 | LK = 5
   | 4 | HK = 4
  | #default = {{{1}}}
}}
| GGP2 = {{#switch: {{{1}}}
  | B = 2
  | A = 3
  | AB = 4
   | #default = {{{1}}}
   | #default = {{{1}}}
  }}
  }}
  | #default = {{{1}}}
  | #default = {{{1}}}
}}}}<includeonly><span id="clr-text" class="colorful-text" style="--data-color:{{#var:color}}">{{{2}}}</span></includeonly><noinclude>{{clear}}{{doc}}</noinclude>
}}}}<includeonly><!--
  Page Output
--><span {{#switch: {{#var:color}}
|1|2|3|4|5|6=class{{=}}"colorful-text-{{#var:color}}"
|#default=style{{=}}"color: {{#var:color}}"
}} >{{{2}}}</span><!--
--></includeonly><!--
  Styles
--><!--<templatestyles src="Template:Color/styles.css" />--><noinclude>{{clear}}{{doc}}</noinclude>

Latest revision as of 20:37, 29 January 2024

{{color|X|Y|game=Z}} or {{clr|X|Y|game=Z}}

This template is used to apply color/style classes to text.
Currently, it supports 8 pre-defined colors and 6 styles that are colorblind and "Dark mode" friendly, though the template can also be used for arbitrary HTML colors.

Colors applied with this template can be disabled or re-enabled through the use of "Monochrome mode" and "Colorful mode", so it is recommended to use this over applying text colors with style attribute, e.g. Red text.

The first parameter (X) is the color identifier code. The second parameter (Y) is the text to be styled. Optionally, game name abbreviations (Z) can be used to force the colors of a specific game's buttons. If this is not provided, it will assume the game from the RootPageName of the current page, or if not found, default to Guilty Gear's button colors.

Equals sign

To use equals sign ("=") in the text field, there are a couple of workarounds:

  • Use the magic word {{=}}

{{color|new|2 + 2 {{=}} 4}} produces 2 + 2 = 4

  • Use the HTML entity &#61;

{{color|new|2 + 2 &#61; 4}} produces 2 + 2 = 4

  • Add 2= before your text

{{color|new|2=2 + 2 = 4}} produces 2 + 2 = 4

  • Wrap the "=" in <nowiki> tags

{{color|new|2 + 2 <nowiki>=</nowiki> 4}} produces 2 + 2 = 4

Supported Game Titles and Examples

The styles for this template are contained within Template:Color/styles.css.

Universal Colors

{{color|1|5P}}
5P
{{color|2|2K}}
2K
{{color|3|c.S}}
c.S
{{color|4|j.H}}
j.H
{{color|5|j.D}}
j.D
{{color|6|Very Easy}}
Very Easy

Balance Badge Template

These have since been replaced by Template:BalanceBadge

HTML colors

{{color|ForestGreen|Forest Green text}}
Forest Green text
{{clr|#f00|Red text}}
Red text

GGACR, GGML, GGXRD-R2, GGST Pages

{{color|1|5P}} or {{color|P|5P}}
5P
{{color|2|2K}} or {{color|K|2K}}
2K
{{color|3|c.S}} or {{color|S|c.S}}
c.S
{{color|4|j.H}} or {{color|H|j.H}}
j.H
{{color|5|j.D}} or {{color|D|j.D}}
j.D

BBCF, BBCT Pages

{{color|A|5A}}
5A
{{color|B|2B}}
2B
{{color|C|6C}}
6C
{{color|D|j.D}}
j.D

BBTag Pages

{{color|1|5A}} or {{color|A|5A}}
5A
{{color|2|2B}} or {{color|B|2B}}
2B
{{color|3|5C}} or {{color|C|5C}}
5C
{{color|4|5D}} or {{color|D|5D}}
5D
{{color|5|5P}} or {{color|P|5P}}
5P

DBFZ Pages

{{color|L|5L}}
5L
{{color|M|2M}}
2M
{{color|H|j.H}}
j.H
{{color|S|236S}}
236S

DNFD Pages

{{color|1|5A}} or {{color|A|5A}}
5A
{{color|2|5B}} or {{color|B|5B}}
5B
{{color|3|5S}} or {{color|S|5S}}
5S
{{color|4|236M}} or {{color|M|236M}}
236MS
{{color|5|AS}} or {{color|AS|AS}}
AS

GBVS, GBVSR Pages

{{color|1|c.L}} or {{color|L|c.L}}
c.L
{{color|2|2M}} or {{color|M|2M}}
2M
{{color|3|f.H}} or {{color|H|f.H}}
f.H
{{color|4|j.U}} or {{color|U|j.U}}
j.U
{{color|6|G}} or {{color|G|G}}
4G

HNK Pages

{{color|1|c.A}} or {{color|A|c.A}}
c.A
{{color|2|f.B}} or {{color|B|f.B}}
f.B
{{color|3|j.C}} or {{color|C|2C}}
2C
{{color|4|c.D}} or {{color|D|j.D}}
j.D
{{color|5|6E}} or {{color|E|6E}}
6E

P4Arena, P4AU, P4U2.5 Pages

{{color|1|5A}} or {{color|A|5A}}
5A
{{color|2|2B}} or {{color|B|2B}}
2B
{{color|3|5C}} or {{color|C|5C}}
5C
{{color|4|j.D}} or {{color|D|j.D}}
j.D

SBX Pages

{{color|1|6A}} or {{color|A|6A}}
6A
{{color|2|5B}} or {{color|B|5B}}
5B
{{color|3|2C}} or {{color|C|2C}}
2C
{{color|4|236E}} or {{color|E|236E}}
236E

SMS Pages

{{color|1|LP}} or {{color|LP|6LP}}
6LP
{{color|2|5HP}} or {{color|HP|5HP}}
5HP
{{color|3|2LK}} or {{color|LK|2LK}}
2LK
{{color|4|236HK}} or {{color|HK|236HK}}
236HK