Template:Game color/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Added a Unique Color to HL2DM)
(Used lower case versions in games list. Named alternative to this template. Every page using this template causes an entry in 'What links here' for all game icon templates in this template's #switch statement. Edited examples and See Also.)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
<!-- Please place categories where indicated at the bottom of this page.) -->
<!-- Please place categories where indicated at the bottom of this page.) -->
__NOTOC__
==Usage==
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.
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.
{{tip|Every game icon template (such as {{tl2|hl2}}, see [[:Category: Game icons]]) can also return its game color using {{tlc|hl2|col}} &rarr; {{hl2|col}}. That approach is much cleaner because {{tl2|game color}} uses a huge switch statement that also uses templates as keys (such as "{{tlc|hl2}}"); This means that every page using {{tl2|game color}} creates an entry in the "What links here" list for all game icon templates listed below.}}


==Usage==
===Examples===
{| class=standard-table
{| class=wikitable
! Wikitext
|       {{tlc|Game color|csgo}}
! Result
| &rarr; || {{Game color|csgo}}
|-
| <pre>{{Game color|csgo}}</pre>
|     {{Game color|csgo}}
|-
|-
| <pre><span style="color:{{Game color|csgo}};font-weight:bold;">(Example text)</span></pre>
| <code><nowiki><span style="color:{{Game color|csgo}}">Example text</span></nowiki></code>
|     <span style="color:{{Game color|csgo}};font-weight:bold;">(Example text)</span>
| &rarr; ||    <span style="color:{{Game color|csgo}}">Example text</span>
|-
|-
|
|
  <pre><nowiki>{| class="wikitable"
<code style=padding:0>{&#124; class="wikitable"<br>
| style="background:{{Game color|as}};"| (Example text)
&#124; style="background:&#123;{Game color|as}};"&#124; Example text<br>
|}</nowiki></pre>
&#124;}</code>
| &rarr;
|
|
   {| class="wikitable"
   {| class="wikitable"
   | style="background:{{Game color|as}};"| (Example text)
   | style="background:{{Game color|as}};"| Example text
   |}  
   |}  
|}
|}
Line 56: Line 57:
| Entropy : Zero 2 || ez2 || style="background:{{Game color|ez2}};" | || {{Game color|ez2}}
| Entropy : Zero 2 || ez2 || style="background:{{Game color|ez2}};" | || {{Game color|ez2}}
|-
|-
| Garry's Mod || GMOD || style="background:{{Game color|GMOD}};" | || {{Game color|GMOD}}
| 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 || hl || style="background:{{Game color|hl}};" | || {{Game color|hl}}
|-
|-
| Half-Life: Source || hls || style="background:{{Game color|hls}};" | || {{Game color|hls}}
| Half-Life: Source || hls || style="background:{{Game color|hls}};" | || {{Game color|hls}}
Line 70: Line 71:
| Half-Life 2: Episode Two || ep2 || style="background:{{Game color|ep2}};" | || {{Game color|ep2}}
| 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}}
| Half-Life: Alyx || hla || style="background:{{Game color|hla}};" | || {{Game color|hla}}
|-
|-
| INFRA || INFRA || style="background:{{Game color|INFRA}};" | || {{Game color|INFRA}}
| INFRA || INFRA || style="background:{{Game color|INFRA}};" | || {{Game color|INFRA}}
Line 86: Line 87:
| Portal 2 || portal2 || style="background:{{Game color|portal2}};" | || {{Game color|portal2}}
| Portal 2 || portal2 || style="background:{{Game color|portal2}};" | || {{Game color|portal2}}
|-
|-
| Portal 2: Community Edition || P2CE || style="background:{{Game color|P2CE}};" | || {{Game color|P2CE}}
| 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}}
| Jabroni Brawl: Episode 3 || jbep3 || style="background:{{Game color|jbep3}};" | || {{Game color|jbep3}}
Line 115: Line 116:


== See Also ==
== See Also ==
* {{[[Template:Game name|Game name]]}}
* {{tl2|new icon}}
* {{[[Template:Also|Also]]}}
* {{tl2|game name}}
* {{[[Template:Only|Only]]}}
* {{tl2|in}}
* {{[[Template:Not|Not]]}}
* {{tl2|also}}
* {{[[Template:Removed|Removed]]}}
* {{tl2|only}}
* {{[[Template:Since|Since]]}}
* {{tl2|not}}
* {{tl2|removed}}
* {{tl2|since}}


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

Revision as of 16:45, 19 April 2022

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

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.

Tip.pngTip:Every game icon template (such as {{hl2}}, see Category: Game icons) can also return its game color using {{hl2|col}} → #E6AC39. That approach is much cleaner because {{game color}} uses a huge switch statement that also uses templates as keys (such as "{{hl2}}"); This means that every page using {{game color}} creates an entry in the "What links here" list for all game icon templates listed below.

Examples

{{Game color|csgo}} #E9B963
<span style="color:{{Game color|csgo}}">Example text</span> Example text

{| class="wikitable"
| style="background:{{Game color|as}};"| Example text
|}

Example text

Game list

Game Abbreviation Result Color Code
Alien Swarm as #108FBE
Alien Swarm: Reactive Drop asrd #EE6F3C
Black Mesa (Source) bms #E57126
Black Mesa bms #E57126
Contagion con #BF2F20
Counter-Strike cs #DEDEDE
Counter-Strike: Condition Zero cscz #FFFA71
Condition Zero Deleted Scenes czds #0F6CB1
Counter-Strike: Source css #90C0FF
Counter-Strike: Global Offensive csgo #E9B963
Entropy : Zero ez1 #00FFF7
Entropy : Zero 2 ez2 #FF5729
Garry's Mod gmod #1295F0
Half-Life hl #ff5500
Half-Life: Source hls #DC143C
Half-Life 2 hl2 #E6AC39
Half-Life 2: Deathmatch hl2dm #ffdd61
Half-Life 2: Episode One ep1 #FF8F00
Half-Life 2: Episode Two ep2 #F26025
Half-Life: Alyx hla #C25E36
INFRA INFRA #99CCFF
Insurgency insurgency #C7D1E0
Left 4 Dead l4d #439e3c
Left 4 Dead 2 l4d2 #BFA828
Mapbase mapbase #A163C9
Portal portal #6BBCFA
Portal 2 portal2 #23B1E5
Portal 2: Community Edition p2ce #FF7B02
Jabroni Brawl: Episode 3 jbep3 #FB4C39
Portal 2010 ARG Update portal #6BBCFA
Sin Episodes sin #ff3349
Source 2006 src06 #FF8F00
Source 2007 src07 #F26025
Source 2009 src09 #558FA5
Source 2013 src13 #8CC850
Source 2013 MP src13mp #A7B956
Source Filmmaker sfm #C8B17D
Synergy synergy #8edb5b
Team Fortress 2 tf2 #CF7336
Default none of the above #add8e6

See Also