Template:Color: Difference between revisions

From HorizonXI Wiki
(Created page with "<font color="{{#switch:{{lc:{{{1}}}}} |beige = #cc9900 |light blue = #33ccff |fire = red |earth = #cc9900 |water = blue |wind = green |ice = #33CCFF |lightning = purple |light = gray |dark = black |nm = red |positive = green |negative = red |neutral = #cc9900 |#default = {{lc:{{{1}}}}} }}">{{#switch:{{lc:{{{style|}}}}} |normal = {{{2}}} |bold = '''{{{2}}}''' |italic = ''{{{2}}}'' |bold-italic = '''''{{{2}}}''''' |'''{{{2}}}''' }}</font><noinclude> Category:Templates|{...")
Tag: visualeditor-wikitext
 
(replaced explicit element colors through their css classes)
 
Line 1: Line 1:
<font color="{{#switch:{{lc:{{{1}}}}}
<span {{#switch:{{lc:{{{1}}}}}
|beige = #cc9900
| earth = class="earth-color"
|light blue = #33ccff
| water = class="water-color"
|fire = red
| wind = class="wind-color"
|earth = #cc9900
| fire = class="fire-color"
|water = blue
| ice = class="ice-color"
|wind = green
| lightning = class="lightning-color"
|ice = #33CCFF
| light = class="light-color"
|lightning = purple
| dark = class="dark-color"
|light = gray
| beige = style="color: #cc9900"
|dark = black
| light blue = style="color: #33ccff"
|nm = red
| nm = style="color: red"
|positive = green
| positive = style="color: green"
|negative = red
| negative = style="color: red"
|neutral = #cc9900
| neutral = style="color: #cc9900"
|#default = {{lc:{{{1}}}}}
| #default = style="color: {{lc:{{{1}}}}}"
}}">{{#switch:{{lc:{{{style|}}}}}
}}>{{#switch:{{lc:{{{style|}}}}}
|normal = {{{2}}}
| normal = {{{2}}}
|bold = '''{{{2}}}'''
| bold = '''{{{2}}}'''
|italic = ''{{{2}}}''
| italic = ''{{{2}}}''
|bold-italic = '''''{{{2}}}'''''
| bold-italic = '''''{{{2}}}'''''
|'''{{{2}}}'''
| '''{{{2}}}'''
}}</font><noinclude>
}}</span><noinclude>
[[Category:Templates|{{PAGENAME}}]]
[[Category:Templates|{{PAGENAME}}]]
==Usage==
==Usage==
Line 32: Line 32:
</pre>
</pre>
Any color may be used, but there are several predefined colors included for convenience:
Any color may be used, but there are several predefined colors included for convenience:
{| width="20%"
{| class="table-xs"
!align="left"| Color
! align="left" | Color
!align="left"| Result
! align="left" | Result
|-
|-
| Beige || {{Color|beige|XXX}}
| Beige || {{Color|beige|XXX}}
Line 50: Line 50:


In addition, all the elemental colors that are used for each crystal are in the template, (i.e. {{[[Template:Fire|{{Fire}}]]}}). However, this template is not actually to be used on any crystal or element references, but only for if you want to mimic the color in other places.
In addition, all the elemental colors that are used for each crystal are in the template, (i.e. {{[[Template:Fire|{{Fire}}]]}}). However, this template is not actually to be used on any crystal or element references, but only for if you want to mimic the color in other places.
{| width="20%"
{| class="table-xs"
!align="left"| Color
! align="left" | Color
!align="left"| Result
! align="left" | Result
|-
|-
| Fire || {{Color|fire|XXX}}
| Earth || {{Color|earth|XXX}}
|-
|-
| Water || {{Color|water|XXX}}
| Water || {{Color|water|XXX}}
|-
|-
| Lightning || {{Color|lightning|XXX}}
| Wind || {{Color|wind|XXX}}
|-
|-
| Earth || {{Color|earth|XXX}}
| Fire || {{Color|fire|XXX}}
|-
|-
| wind || {{Color|wind|XXX}}
| Ice || {{Color|ice|XXX}}
|-
|-
| ice || {{Color|ice|XXX}}
| Lightning || {{Color|lightning|XXX}}
|-
|-
| light || {{Color|light|XXX}}
| Light || {{Color|light|XXX}}
|-
|-
| dark || {{Color|dark|XXX}}
| Dark || {{Color|dark|XXX}}
|}
|}



Latest revision as of 22:19, 16 November 2023

{{{2}}}

Usage

{{Color|color|text}}

Style can be set to either normal, bold, italic, or bold-italic by declaring the style variable (the default is bold).

{{Color|style=normal|color|text}}

Any color may be used, but there are several predefined colors included for convenience:

Color Result
Beige XXX
Light Blue XXX
NM XXX
Positive XXX
Negative XXX
Neutral XXX

In addition, all the elemental colors that are used for each crystal are in the template, (i.e. {{Fire}}). However, this template is not actually to be used on any crystal or element references, but only for if you want to mimic the color in other places.

Color Result
Earth XXX
Water XXX
Wind XXX
Fire XXX
Ice XXX
Lightning XXX
Light XXX
Dark XXX

Be very mindful of using this template, users with custom themes may not be able to read text with hard-coded colors if an appropriate background color is not also defined.

See Also