Difference between revisions of "Template:ItemColor"

From Project: Gorgon Wiki
Jump to: navigation, search
m (close nested switches)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>color:#{{#switch: {{{2|}}}
+
<includeonly>{{#switch: {{{2|}}}
 
  | Light | light | L | l = {{#switch: {{{1|}}}
 
  | Light | light | L | l = {{#switch: {{{1|}}}
 
   | Legendary | legendary
 
   | Legendary | legendary
 
   | Yellow | yellow
 
   | Yellow | yellow
 
   | L | l
 
   | L | l
   | 5 = BBBB00
+
   | 5 = color:#BBBB00
 
   | Epic | epic
 
   | Epic | epic
 
   | P | p
 
   | P | p
   | purple
+
   | Purple | purple
   | 4 = BB00BB
+
   | 4 = color:#BB00BB
 
   | Exceptional | exceptional
 
   | Exceptional | exceptional
 
   | Red | red
 
   | Red | red
 
   | X | x
 
   | X | x
   | 3 = BB0000
+
   | 3 = color:#BB0000
 
   | Rare | rare
 
   | Rare | rare
 
   | Blue | blue
 
   | Blue | blue
 
   | R | r
 
   | R | r
   | 2 = 00BBBB
+
   | 2 = color:#00BBBB
 
   | Uncommon | uncommon   
 
   | Uncommon | uncommon   
 
   | Green | green
 
   | Green | green
 
   | U | u
 
   | U | u
   | 1 = 009900
+
   | 1 = color:#009900
 
   | Common | common   
 
   | Common | common   
 
   | White | white
 
   | White | white
 
   | C | c
 
   | C | c
   | 0 = 666666
+
   | 0 = color:#666666
   | #default = 808080}}
+
   | #default = color:#808080}}
 
  | Dark | dark | D | d = {{#switch: {{{1|}}}
 
  | Dark | dark | D | d = {{#switch: {{{1|}}}
 
   | Legendary | legendary
 
   | Legendary | legendary
 
   | Yellow | yellow
 
   | Yellow | yellow
 
   | L | l
 
   | L | l
   | 5 = FAEF24
+
   | 5 = color:#FAEF24
 
   | Epic | epic
 
   | Epic | epic
 
   | P | p
 
   | P | p
   | purple
+
   | Purple | purple
   | 4 =  FF00FF
+
   | 4 =  color:#FF00FF
 
   | Exceptional | exceptional
 
   | Exceptional | exceptional
 
   | Red | red
 
   | Red | red
 
   | X | x
 
   | X | x
   | 3 = F40302
+
   | 3 = color:#F40302
 
   | Rare | rare
 
   | Rare | rare
 
   | Blue | blue
 
   | Blue | blue
 
   | R | r
 
   | R | r
   | 2 =  00E7E7
+
   | 2 =  color:#00E7E7
 
   | Uncommon | uncommon   
 
   | Uncommon | uncommon   
 
   | Green | green
 
   | Green | green
 
   | U | u
 
   | U | u
   | 1 = 04C304
+
   | 1 = color:#04C304
 
   | Common | common   
 
   | Common | common   
 
   | White | white
 
   | White | white
 
   | C | c
 
   | C | c
   | 0 = FFFFFF
+
   | 0 = color:#FFFFFF
   | #default = 808080}}
+
   | #default = color:#808080}}
 
  | #default = {{#switch: {{{1|}}}
 
  | #default = {{#switch: {{{1|}}}
 
   | Legendary | legendary
 
   | Legendary | legendary
 
   | Yellow | yellow
 
   | Yellow | yellow
 
   | L | l
 
   | L | l
   | 5 = FFFF22
+
   | 5 = text-shadow: 0 0 2px black, 0 0 2px black, 0 0 2px black, 0 0 2px black; color:#FFFF22
 
   | Epic | epic
 
   | Epic | epic
 
   | P | p
 
   | P | p
   | purple
+
   | Purple | purple
   | 4 = BB00BB
+
   | 4 = color:#BB00BB
 
   | Exceptional | exceptional
 
   | Exceptional | exceptional
 
   | Red | red
 
   | Red | red
 
   | X | x
 
   | X | x
   | 3 = DD0000
+
   | 3 = color:#DD0000
 
   | Rare | rare
 
   | Rare | rare
 
   | Blue | blue
 
   | Blue | blue
 
   | R | r
 
   | R | r
   | 2 = 99FFFF
+
   | 2 = text-shadow: 0 0 2px black, 0 0 2px black, 0 0 2px black, 0 0 2px black; color:#99FFFF
 
   | Uncommon | uncommon   
 
   | Uncommon | uncommon   
 
   | Green | green
 
   | Green | green
 
   | U | u
 
   | U | u
   | 1 = 77FF77
+
   | 1 = text-shadow: 0 0 2px black, 0 0 2px black, 0 0 2px black, 0 0 2px black; color:#77FF77
 
   | Common | common   
 
   | Common | common   
 
   | White | white
 
   | White | white
 
   | C | c
 
   | C | c
   | 0 = 222222
+
   | 0 = text-shadow: 0 0 2px black, 0 0 2px black, 0 0 2px black, 0 0 2px black; color:#FFFFFF
   | #default = 808080}}
+
   | #default = color:#808080}}
 
}};</includeonly><noinclude>{{documentation}}</noinclude>
 
}};</includeonly><noinclude>{{documentation}}</noinclude>

Latest revision as of 18:53, 25 October 2021

Template documentation (for the above template, sometimes hidden or invisible) [view] [edit] [history] [refresh]


Description

Returns the inline-css-style to make the color the correct one for an item of the given rarity. Used in Template:ITEM infobox and Template:ItemRarity; it is unlikely you will want to use this template directly, though in some cases it may be useful where you wish to create a similar effect to Template:ItemRarity, but with additional inline styles or without the linking behavior in that template.

Syntax

  • Single parameter for use on standard "parchment color" background:
    {{ItemColor|rarity}}
  • Two parameters for use in wikitables, ITEM infoboxes, or other light/dark backgrounds:
    {{ItemColor|rarity|backgroundShade}}

Parameters

  • First parameter (required): The rarity whose color you wish to express. This can be any of:
    • The full word description of the rarity: Common, Uncommon, Rare, Exceptional, Epic, Legendary (capitalized or not)
    • The number of mods on an item of that rarity: 0, 1, 2, 3, 4, 5
    • A one letter abbreviation for that rarity: c, u, r, x, p, l (capitalized or not)
    • Any other values default to the color grey.
  • Second parameter (optional): Used to select a palette with better contrast against the background color. Possible parameters "Light" (or "L") or "Dark" (or "D"), captialized or not. Leave this parameter out for a palette designed for the default "parchment color" wiki background.

Examples

Example 1: Directly on the page

Example Code 1

<span style="{{ItemColor|Legendary}}">This is a legendary item.</span>

Example Output 1

This is a legendary item.

Example 2: Wikitable

Example Code 2

{| class="wikitable"
!Header
|-
| <span style="{{ItemColor|4|Light}}">And this one has four mods.</span>
|}

Example Output 2

Header
And this one has four mods.

Example 3: Dark background

Example Code 3

<span style="background-color:#000000;font-family:Courier;{{ItemColor|L|Dark}}font-size:24px;">Can also be combined with other inline css styles.</span>

Example Output 3

Can also be combined with other inline css styles.
The above text is transcluded from Template:ItemColor/doc; you can change it or view its history.
If you're done making changes, please refresh the text.
Please add categories and interwikis to Template:ItemColor/doc. (View all subpages of this page.)