Module:Utilities/doc: Difference between revisions
Jump to navigation
Jump to search
initial |
m get_slot_color trying an example with debug_mode |
||
Line 12: | Line 12: | ||
===Examples=== | ===Examples=== | ||
To retrieve the color alone | |||
<code><nowiki>{{#invoke:Utilities|get_slot_color|Tech}}</nowiki></code> | |||
{{#invoke:Utilities|get_slot_color|Tech|debug_mode=true}} | |||
To style text: | To style text: | ||
<code><nowiki> | <code><nowiki><span style="color: {{#invoke:Utilities|get_slot_color|Tech}};">Tech colored text</span></nowiki></code> | ||
<span style="color: {{#invoke:Utilities|get_slot_color|Tech}};">Tech colored text</span> | |||
To style divs: | To style divs: | ||
<code><nowiki><div style="background-color: {{#invoke:Utilities|get_slot_color|Tech}}; padding: 10px; border-radius: 5px;"> | <code><nowiki><div style="background-color: {{#invoke:Utilities|get_slot_color|Tech}}; padding: 10px; border-radius: 5px;"> | ||
Tech colored div | |||
</div></nowiki></code> | </div></nowiki></code> | ||
<div style="background-color: {{#invoke:Utilities|get_slot_color|Tech}}; padding: 10px; border-radius: 5px;"> | <div style="background-color: {{#invoke:Utilities|get_slot_color|Tech}}; padding: 10px; border-radius: 5px;"> | ||
Tech colored div | |||
</div> | </div> |
Revision as of 21:25, 1 November 2024
Overview
Utility functions that serve any miscellaneous purpose
Functions
get_slot_color
Retrieve's the hex color of a certain slot/category, formerly known in english as Weapon, Vitality, and Spirit, though their unlocalized names are Weapon, Armor, and Tech.
Parameters
- slot - slot key, options are Weapon, Armor, and Tech
- color_format - color format, defaults to hex. Valid options are hex, rgb
Examples
To retrieve the color alone
{{#invoke:Utilities|get_slot_color|Tech}}
#c288f0
To style text:
<span style="color: {{#invoke:Utilities|get_slot_color|Tech}};">Tech colored text</span>
Tech colored text
To style divs:
<div style="background-color: {{#invoke:Utilities|get_slot_color|Tech}}; padding: 10px; border-radius: 5px;">
Tech colored div
</div>
Tech colored div