Template:SlotColor/doc

From Deadlock Wiki
Revision as of 22:49, 1 November 2024 by Sur (talk | contribs) (examples moved from Module:Utilities/doc)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Retrieve's the color of a certain slot/category in any color format (default hex), formerly known in english as Weapon, Vitality, and Spirit, though their unlocalized names are Weapon, Armor, and Tech. Utilizes Module:Utilities's get_slot_color function.

Parameters

  • slot - slot key, options are Weapon, Armor, and Tech
  • color_format - color format - Defaults to hex. Valid options are hex, rgb, hsl, cmyk
  • no_wrap - (OPTIONAL) - Defaults to false. Set to true to remove prefixes and postfixes of '#' from hex, or 'rgb()', 'hsl()', and 'cmyk()' from the other formats. May be useful for altering the values dynamically

Examples

To retrieve the color alone {{SlotColor|Tech}}

This template has been marked for deletion.
Reason: moved to Template:Color

To retrieve other color formats {{SlotColor|Tech|rgb}}

This template has been marked for deletion.
Reason: moved to Template:Color


To style text: <span style="color: {{SlotColor|Weapon}};">Weapon colored text</span>

<span style="color:

This template has been marked for deletion.
Reason: moved to Template:Color

;">Weapon colored text


To style divs: <div style="background-color: {{SlotColor|Tech}};"> Tech colored div</div>

<div style="background-color:

This template has been marked for deletion.
Reason: moved to Template:Color

;">

Tech colored div


To get the color without otherwise necessary prefix/postfix wrapping:

{{SlotColor|Tech|rgb|no_wrap=true}}

This template has been marked for deletion.
Reason: moved to Template:Color


To alter the alpha value using rgb dynamically: <div style="background-color: rgb({{SlotColor|Armor|rgb|no_wrap=true}}, 1.0);"> Armor colored div with 1.0 alpha</div>

<div style="background-color: rgb(

This template has been marked for deletion.
Reason: moved to Template:Color

, 1.0);">

Armor colored div with 1.0 alpha


<div style="background-color: rgb({{SlotColor|Armor|rgb|no_wrap=true}}, 0.2);"> Armor colored div with 0.2 alpha</div>

<div style="background-color: rgb(

This template has been marked for deletion.
Reason: moved to Template:Color

, 0.2);">

Armor colored div with 0.2 alpha