Difference between revisions of "Template:ItemColor/doc"
From Project: Gorgon Wiki
(→Examples) |
(→Examples) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
</noinclude> | </noinclude> | ||
− | ==Description | + | == 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. | + | 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 == | == Syntax == | ||
− | <pre>{{ItemColor|rarity}}</pre> | + | *Single parameter for use on standard "parchment color" background: <pre>{{ItemColor|rarity}}</pre> |
+ | *Two parameters for use in wikitables, [[:Template:ITEM_infobox|ITEM infoboxes]], or other light/dark backgrounds: <pre>{{ItemColor|rarity|backgroundShade}}</pre> | ||
===Parameters=== | ===Parameters=== | ||
− | *First | + | *First parameter (required): The rarity whose color you wish to express. This can be any of: |
− | ** The full word description of the rarity: Uncommon, Rare, Exceptional, Epic, Legendary (capitalized or not) | + | ** 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: 1, 2, 3, 4, 5 | + | ** The number of mods on an item of that rarity: 0, 1, 2, 3, 4, 5 |
− | ** A one letter abbreviation for that rarity: u, r, x, p, l (capitalized or not) | + | ** A one letter abbreviation for that rarity: c, u, r, x, p, l (capitalized or not) |
− | ** Any other values default to the color | + | ** 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 == | == Examples == | ||
+ | === Example 1: Directly on the page === | ||
+ | ====Example Code 1==== | ||
+ | <pre><span style="{{ItemColor|Legendary}}">This is a legendary item.</span></pre> | ||
+ | ====Example Output 1==== | ||
+ | <span style="{{ItemColor|Legendary}}">This is a legendary item.</span> | ||
+ | ===Example 2: Wikitable=== | ||
+ | ====Example Code 2==== | ||
+ | <pre>{| class="wikitable" | ||
+ | !Header | ||
+ | |- | ||
+ | | <span style="{{ItemColor|4|Light}}">And this one has four mods.</span> | ||
+ | |}</pre> | ||
+ | ====Example Output 2==== | ||
{| class="wikitable" | {| class="wikitable" | ||
− | ! | + | !Header |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | + | | <span style="{{ItemColor|4|Light}}">And this one has four mods.</span> | |
− | |||
|} | |} | ||
+ | ===Example 3: Dark background=== | ||
+ | ====Example Code 3==== | ||
+ | <pre><span style="background-color:#000000;font-family:Courier;{{ItemColor|L|Dark}}font-size:24px;">Can also be combined with other inline css styles.</span></pre> | ||
+ | ====Example Output 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> |
Latest revision as of 08:45, 5 December 2020
Contents
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.