Editing
Template:Color/doc
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
Retrieve's the color of a given key in any color format (default hex). ===Parameters=== {{Transclude|Module:Color/doc#Parameters}} ===Examples=== To retrieve the color alone <code><nowiki>{{Color|Tech}}</nowiki></code> {{Color|Tech|debug_mode=true}} To retrieve other color formats <code><nowiki>{{Color|Tech|rgb}}</nowiki></code> {{Color|Tech|rgb|debug_mode=true}} To style text: <code><nowiki><span style="color: {{Color|Weapon}};">Weapon colored text</span></nowiki></code> <span style="color: {{Color|Weapon}};">Weapon colored text</span> To style divs: <code><nowiki><div style="background-color: {{Color|Tech}};"> Tech colored div</div></nowiki></code> <div style="background-color: {{Color|Tech}};"> Tech colored div </div> To get the color without otherwise necessary prefix/postfix wrapping: <code><nowiki>{{Color|Tech|rgb|no_wrap=true}}</nowiki></code> {{Color|Tech|rgb|no_wrap=true|debug_mode=true}} This can manually be wrapped like <code><nowiki>rgba({{Color|Tech|no_wrap=true}}, 0.5)</nowiki></code> to customize the alpha channel (opacity/transparency) of the color to your liking. Note that with transparency, the color will vary on light or dark mode, so consider adding a white/black background behind to enforce consistency. To alter the alpha value using rgb dynamically: <code><nowiki><div style="background-color: rgba({{Color|Armor|rgb|no_wrap=true}}, 1.0);"> Armor colored div with 1.0 alpha</div></nowiki></code> <div style="background-color: rgba({{Color|Armor|rgb|no_wrap=true}}, 1.0);"> Armor colored div with 1.0 alpha </div> <code><nowiki><div style="background-color: rgba({{Color|Armor|rgb|no_wrap=true}}, 0.5);"> Armor colored div with 0.5 alpha</div></nowiki></code> <div style="background-color: rgba({{Color|Armor|rgb|no_wrap=true}}, 0.5);"> Armor colored div with 0.5 alpha </div> ===Previews=== {{Transclude|Module:Color/doc#Previews}} <noinclude>[[Category:Template documentation]]</noinclude>
Summary:
Please note that all contributions to Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Deadlock:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Templates used on this page:
Data:Dictionary
(
edit
)
Data:LangCodes.json
(
edit
)
Data:Lang en.json
(
edit
)
Template:Color
(
edit
)
Template:Transclude
(
edit
)
Module:Color
(
edit
)
Module:Color/doc
(
edit
)
Module:Dictionary
(
edit
)
Module:Lang
(
edit
)
Module:Utilities
(
edit
)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Template
Discussion
English
Views
Read
Edit source
View history
More
Search
Navigation
Main page
Discord community
Recent changes
Random page
Tools
What links here
Related changes
Special pages
Page information
Languages