Template:Game color/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Added unique color for Alien Swarm: Reactive Drop)
(Updated doc.)
 
(24 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{Documentation subpage}}
{{Doc/subpage}}
<!-- Please place categories where indicated at the bottom of this page.) -->
<!-- Please place categories where indicated at the bottom of this page.) -->
Template for accessing unique, pre-defined colors for games and engine branches documented on the Valve Developer Community, based on feature addition templates. This template forwards a color variable directly and is intended to be used inside of wiki formatting.
__NOTOC__
 
==Usage==
==Usage==
'''Game color''' is a template for accessing unique, predefined colors for games and engine branches documented on the Valve Developer Community, based on feature addition templates. This template returns a hexadecimal color value directly and is intended to be used inside of wiki formatting.
{{tip|Every game icon template (such as {{tl2|hl2}}, see [[:Category: Game icons]]) can return its game color using {{tlc|hl2|col}} &rarr; {{hl2|col}}. This approach is what this template uses. Use that directly wherever possible.}}


<code><nowiki><span style="color:{{Game color | </nowiki>''<game name>''<nowiki>}};font-weight:bold;">(I am a specific game or engine branch)</span></nowiki></code>.
===Parameters===
For example: <code><nowiki><span style="color:{{Game color | Counter-Strike: Global Offensive}};font-weight:bold;">(Example text)</span></nowiki></code> → <span style="color:{{Game color | Counter-Strike: Global Offensive}};font-weight:bold;">(Example text)</span>
* {{param|1}} &ndash; The full name or abbreviation of a game. If <code>Template:''name''</code> exists, {{tlc|game color|''name''}} returns {{tlc|''name''|col}}, otherwise <tt>{{param|default|#add8e6}}</tt>. Other legal values are: <tt>todo, in, only, also, since, removed, not</tt>.
 
* {{param|default|#add8e6}} &ndash; The fallback return value if {{param|1}} is invalid.
This template also works with game icons.
For example: <code><nowiki><span style="color:{{Game color | {{csgo}}}};font-weight:bold;">(Example text)</span></nowiki></code> → <span style="color:{{Game color | {{csgo}}}};font-weight:bold;">(Example text)</span>


=== Game list ===
===Examples===
{| class="wikitable"
{| style="background:transparent"
|-
| {{tlc|Game color}}
! Game !! Result
| || {{Game color}}
|-
| || <b style="color:{{Game color}}">Example text</b>
| Alien Swarm || style="background:{{Game color|Alien Swarm}};" |
|-
| Alien Swarm: Reactive Drop || style="background:{{Game color|Alien Swarm: Reactive Drop}};" |
|-
| Black Mesa (Source) || style="background:{{Game color|Black Mesa (Source)}};" |
|-
| Black Mesa || style="background:{{Game color|Black Mesa}};" |
|-
| Contagion || style="background:{{Game color|Contagion}};" |
|-
| Counter-Strike: Global Offensive || style="background:{{Game color|Counter-Strike: Global Offensive}};" |
|-
| Entropy : Zero || style="background:{{Game color|Entropy : Zero}};" |
|-
| Entropy : Zero 2 || style="background:{{Game color|Entropy : Zero 2}};" |
|-
| Garry's Mod || style="background:{{Game color|Garry's Mod}};" |
|-
| Half-Life || style="background:{{Game color|Half-Life}};" |
|-
| Half-Life: Source || style="background:{{Game color|Half-Life: Source}};" |
|-
| Half-Life 2 || style="background:{{Game color|Half-Life 2}};" |
|-
| Half-Life 2: Episode One || style="background:{{Game color|Half-Life 2: Episode One}};" |
|-
| Half-Life 2: Episode Two || style="background:{{Game color|Half-Life 2: Episode Two}};" |
|-
| Half-Life 2 episodes || style="background:{{Game color|Half-Life 2 episodes}};" |
|-
| INFRA || style="background:{{Game color|INFRA}};" |
|-
| Insurgency || style="background:{{Game color|Insurgency}};" |
|-
| Left 4 Dead || style="background:{{Game color|Left 4 Dead}};" |
|-
| Left 4 Dead 2 || style="background:{{Game color|Left 4 Dead 2}};" |
|-
| Left 4 Dead series || style="background:{{Game color|Left 4 Dead series}};" |
|-
| Mapbase || style="background:{{Game color|Mapbase}};" |
|-
| Portal || style="background:{{Game color|Portal}};" |
|-
| Portal 2 || style="background:{{Game color|Portal 2}};" |
|-
| Portal 2010 ARG Update || style="background:{{Game color|Portal 2010 ARG Update}};" |
|-
| Sin Episodes || style="background:{{Game color|Sin Episodes}};" |
|-
| Source 2006 || style="background:{{Game color|Source 2006}};" |
|-
| Source 2007 || style="background:{{Game color|Source 2007}};" |
|-
| Source 2009 || style="background:{{Game color|Source 2009}};" |
|-
|-
| Source 2013 || style="background:{{Game color|Source 2013}};" |
| {{tlc|Game color|hl2}}
| → || {{Game color|hl2}}
| → || <b style="color:{{Game color|hl2}}">Example text</b>
|-
|-
| Source 2013 MP || style="background:{{Game color|Source 2013 MP}};" |
| {{tlc|Game color|hl2|default{{=}}#00ff88}}
| → || {{Game color|hl2|default=#00ff88}}
| → || <b style="color:{{Game color|hl2|default=#00ff88}}">Example text</b>
|-
|-
| Synergy || style="background:{{Game color|Synergy}};" |
| {{tlc|Game color|qwerty|default{{=}}#00ff88}}
| → || {{Game color|qwerty|default=#00ff88}}
| → || <b style="color:{{Game color|qwerty|default=#00ff88}}">Example text</b>
|-
|-
| Team Fortress 2 || style="background:{{Game color|Team Fortress 2}};" |
| {{tlc|Game color|qwerty}}
| → || {{Game color|qwerty}}
| → || <b style="color:{{Game color|qwerty}}">Example text</b>
|-
|-
| Default for no game specified || style="background:{{Game color|}};" |
| {{tlc|Game color|todo}}
| → || {{Game color|todo}}
| → || <b style="color:{{Game color|todo}}">Example text</b>
|-
|-
|  {{tlc|Game color|removed}}
| → || {{Game color|removed}}
| → || <b style="color:{{Game color|removed}}">Example text</b>
|}
|}
== See also ==
* {{tl2|software}}
* {{tl2|in}}
* {{tl2|also}}
* {{tl2|only}}
* {{tl2|not}}
* {{tl2|removed}}
* {{tl2|since}}


<includeonly>{{sandbox other||
<includeonly>{{sandbox other||

Latest revision as of 10:10, 24 July 2024

Edit-copy.png
This is a documentation subpage for Template:Game color.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

Usage

Game color is a template for accessing unique, predefined colors for games and engine branches documented on the Valve Developer Community, based on feature addition templates. This template returns a hexadecimal color value directly and is intended to be used inside of wiki formatting.

Tip.pngTip:Every game icon template (such as {{hl2}}, see Category: Game icons) can return its game color using {{hl2|col}} → #E6AC39. This approach is what this template uses. Use that directly wherever possible.

Parameters

  • {{{1}}} – The full name or abbreviation of a game. If Template:name exists, {{game color|name}} returns {{name|col}}, otherwise {{{default|#add8e6}}}. Other legal values are: todo, in, only, also, since, removed, not.
  • {{{default|#add8e6}}} – The fallback return value if {{{1}}} is invalid.

Examples

{{Game color}} #add8e6 Example text
{{Game color|hl2}} #E6AC39 Example text
{{Game color|hl2|default=#00ff88}} #E6AC39 Example text
{{Game color|qwerty|default=#00ff88}} #00ff88 Example text
{{Game color|qwerty}} #add8e6 Example text
{{Game color|todo}} #8BC53F Example text
{{Game color|removed}} #B24732 Example text

See also