Template:Game color/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (added Jabroni Brawl: Episode 3 to documentation)
(Updated doc.)
 
(16 intermediate revisions by 6 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==
'''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.}}


==Usage==
===Parameters===
{| class=standard-table
* {{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>.
! Wikitext
* {{param|default|#add8e6}} &ndash; The fallback return value if {{param|1}} is invalid.
! Result
|-
| <pre>{{Game color|csgo}}</pre>
|      {{Game color|csgo}}
|-
| <pre><span style="color:{{Game color|csgo}};font-weight:bold;">(Example text)</span></pre>
|      <span style="color:{{Game color|csgo}};font-weight:bold;">(Example text)</span>
|-
|
  <pre><nowiki>{| class="wikitable"
| style="background:{{Game color|as}};"| (Example text)
|}</nowiki></pre>
|
  {| class="wikitable"
  | style="background:{{Game color|as}};"| (Example text)
  |}
|}


===Game list===
===Examples===
{| class="wikitable sortable"
{| style="background:transparent"
|-
| {{tlc|Game color}}
! Game
| || {{Game color}}
! Abbreviation
| || <b style="color:{{Game color}}">Example text</b>
! class=unsortable | Result
! Color Code
|-
| Alien Swarm || as || style="background:{{Game color|as}};" | || {{Game color|as}}
|-
| Alien Swarm: Reactive Drop || asrd || style="background:{{Game color|asrd}};" | || {{Game color|asrd}}
|-
| Black Mesa (Source) || bms || style="background:{{Game color|bms}};" | || {{Game color|bms}}
|-
| Black Mesa || bms || style="background:{{Game color|bms}};" | || {{Game color|bms}}
|-
| Contagion || con || style="background:{{Game color|con}};" | || {{Game color|con}}
|-
| Counter-Strike || cs || style="background:{{Game color|cs}};" | || {{Game color|cs}}
|-
| Counter-Strike: Condition Zero || cscz || style="background:{{Game color|cscz}};" | || {{Game color|cscz}}
|-
| Condition Zero Deleted Scenes || czds || style="background:{{Game color|czds}};" | || {{Game color|czds}}
|-
| Counter-Strike: Source || css || style="background:{{Game color|css}};" | || {{Game color|css}}
|-
| Counter-Strike: Global Offensive || csgo || style="background:{{Game color|csgo}};" | || {{Game color|csgo}}
|-
| Entropy : Zero || ez1 || style="background:{{Game color|ez1}};" | || {{Game color|ez1}}
|-
| Entropy : Zero 2 || ez2 || style="background:{{Game color|ez2}};" | || {{Game color|ez2}}
|-
| Garry's Mod || GMOD || style="background:{{Game color|GMOD}};" | || {{Game color|GMOD}}
|-
| Half-Life || hl1 || style="background:{{Game color|hl1}};" | || {{Game color|hl1}}
|-
| Half-Life: Source || hls || style="background:{{Game color|hls}};" | || {{Game color|hls}}
|-
| Half-Life 2 || hl2 || style="background:{{Game color|hl2}};" | || {{Game color|hl2}}
|-
| Half-Life 2: Episode One || ep1 || style="background:{{Game color|ep1}};" | || {{Game color|ep1}}
|-
| Half-Life 2: Episode Two || ep2 || style="background:{{Game color|ep2}};" | || {{Game color|ep2}}
|-
| Half-Life: Alyx || HL:A || style="background:{{Game color|HL:A}};" | || {{Game color|HL:A}}
|-
| INFRA || INFRA || style="background:{{Game color|INFRA}};" | || {{Game color|INFRA}}
|-
| Insurgency || insurgency || style="background:{{Game color|insurgency}};" | || {{Game color|insurgency}}
|-
| Left 4 Dead || l4d || style="background:{{Game color|l4d}};" | || {{Game color|l4d}}
|-
| Left 4 Dead 2 || l4d2 || style="background:{{Game color|l4d2}};" | || {{Game color|l4d2}}
|-
| Mapbase || mapbase || style="background:{{Game color|mapbase}};" | || {{Game color|mapbase}}
|-
| Portal || portal || style="background:{{Game color|portal}};" | || {{Game color|portal}}
|-
| Portal 2 || portal2 || style="background:{{Game color|portal2}};" | || {{Game color|portal2}}
|-
| Portal 2: Community Edition || P2CE || style="background:{{Game color|P2CE}};" | || {{Game color|P2CE}}
|-
| Jabroni Brawl: Episode 3 || jbep3 || style="background:{{Game color|jbep3}};" | || {{Game color|jbep3}}
|-
| Portal 2010 ARG Update || portal || style="background:{{Game color|portal}};" | || {{Game color|portal}}
|-
| Sin Episodes || sin || style="background:{{Game color|sin}};" | || {{Game color|sin}}
|-
| Source 2006 || src06 || style="background:{{Game color|src06}};" | || {{Game color|src06}}
|-
| Source 2007 || src07 || style="background:{{Game color|src07}};" | || {{Game color|src07}}
|-
| Source 2009 || src09 || style="background:{{Game color|src09}};" | || {{Game color|src09}}
|-
|-
| Source 2013 || src13 || style="background:{{Game color|src13}};" | || {{Game color|src13}}
| {{tlc|Game color|hl2}}
| → || {{Game color|hl2}}
| || <b style="color:{{Game color|hl2}}">Example text</b>
|-
|-
| Source 2013 MP || src13mp || style="background:{{Game color|src13mp}};" | || {{Game color|src13mp}}
| {{tlc|Game color|hl2|default{{=}}#00ff88}}
| || {{Game color|hl2|default=#00ff88}}
| || <b style="color:{{Game color|hl2|default=#00ff88}}">Example text</b>
|-
|-
| Source Filmmaker || sfm || style="background:{{Game color|sfm}};" | || {{Game color|sfm}}
| {{tlc|Game color|qwerty|default{{=}}#00ff88}}
| || {{Game color|qwerty|default=#00ff88}}
| || <b style="color:{{Game color|qwerty|default=#00ff88}}">Example text</b>
|-
|-
| Synergy || synergy || style="background:{{Game color|synergy}};" | || {{Game color|synergy}}
| {{tlc|Game color|qwerty}}
| → || {{Game color|qwerty}}
| || <b style="color:{{Game color|qwerty}}">Example text</b>
|-
|-
| Team Fortress 2 || tf2 || style="background:{{Game color|tf2}};" | || {{Game color|tf2}}
| {{tlc|Game color|todo}}
|- class=sortbottom
| || {{Game color|todo}}
| ''Default'' || ''none of the above'' || style="background:{{Game color|}};" | || {{Game color|}}
| || <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 ==
== See also ==
* {{[[Template:Game name|Game name]]}}
* {{tl2|software}}
* {{[[Template:Also|Also]]}}
* {{tl2|in}}
* {{[[Template:Only|Only]]}}
* {{tl2|also}}
* {{[[Template:Not|Not]]}}
* {{tl2|only}}
* {{[[Template:Removed|Removed]]}}
* {{tl2|not}}
* {{[[Template:Since|Since]]}}
* {{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