Template:Game color: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Explained workaround.)
(Remade the template using e.g. {{hl2|col}} instead. No longer accepts expanded templates such as {{game color|{{hl2}}}} since that was a bad idea. Since this template is no longer widely spread, this radical change should be fine.)
Tag: Replaced
Line 1: Line 1:
{{Deprecated template|notes=This template is extremely expensive due to a huge #switch statement which uses both countless game names ("Half-Life 2") as well as templates {{tl2|hl2}} as guards which means that many, many per-game icon templates are expanded ''only'' to return a color value.<br>Use {{tl2|software}} instead: {{tlc|hl2|col}} &rarr; {{hl2|col}}.}}
<includeonly>{{linkless exists|Template:{{{1|}}}|{{ {{{1|}}}|col}}|#abcdef}}</includeonly><noinclude><!--
<includeonly><onlyinclude>{{#switch: {{{1}}}
 
| {{src09}}
-->{{Deprecated template|notes=Use {{tl2|software}} instead: {{tlc|hl2|col}} &rarr; {{hl2|col}}.}}
| src09
| src09sp
| Source 2009 = <nowiki>#558fa5</nowiki>
| {{srcmp}}
| srcmp
| src09mp
| sourcemp
| Source MP = <nowiki>#a38fa5</nowiki>
| {{src13}}
| src13
| Source 2013 = <nowiki>#9bf442</nowiki>
| {{src13mp}}
| src13mp
| Source 2013 MP = <nowiki>#d3f442</nowiki>
| {{hl}}
| hl
| hl1
| Half-Life = <nowiki>#de5009</nowiki>
| {{hlbs}}
| hlbs
| Half-Life: Blue Shift = <nowiki>#59a8ff</nowiki>
| {{hlop4}}
| hlop4
| Half-Life: Opposing Force = <nowiki>#00cc00</nowiki>
| {{hls}}
| HLS
| hls
| Half-Life: Source = <nowiki>#dc143c</nowiki>
| {{hldms}}
| HLDMS
| hldms
| Half-Life Deathmatch: Source = <nowiki>#b58341</nowiki>
| {{hl2}}
| {{Src04}}
| hl2
| src04
| Source 2004
| Half-Life 2 = <nowiki>#ffcc14</nowiki>
| {{hl2xbox}}
| hl2xbox
| Half-Life 2 (Xbox) = <nowiki>#d4ff00</nowiki>
| {{hl2dm}}
| hl2dm
| Half-Life 2: Deathmatch = <nowiki>#ffdd61</nowiki>
| {{hl2ep1}}
| {{src06}}
| hl2ep1
| ep1
| src06
| Source 2006
| Half-Life 2: Episode One = <nowiki>#ff8f00</nowiki>
| {{hl2ep2}}
| {{src07}}
| hl2ep2
| ep2
| src07
| Source 2007
| Half-Life 2: Episode Two = <nowiki>#F26025</nowiki>
| {{hl2episodes}}
| hl2episodes
| Half-Life 2 episodes = <nowiki>#f57214</nowiki>
| {{hl2lc}}
| hl2lc
| Half-Life 2: Lost Coast = <nowiki>#B7B879</nowiki>
| {{hla}}
| hlalyx
| hla
| HL:A
| Half-Life Alyx
| Half-Life: Alyx = <nowiki>#c25e36</nowiki>
| {{tf2}}
| tf2
| Team Fortress 2 = <nowiki>#CF7336</nowiki>
| {{tsp}}
| tsp
| stanley
| The Stanley Parable = <nowiki>#ED710D</nowiki>
| {{dod}}
| dod
| Day of Defeat = <nowiki>#466b44</nowiki>
| {{dods}}
| dods
| day of defeat source
| Day of Defeat: Source = <nowiki>#4B7941</nowiki>
| {{l4d}}
| l4d
| {{l4ds}}
| l4ds
| Left 4 Dead series
| {{l4dbranch}}
| l4dbranch
| Left 4 Dead engine branch
| Left 4 Dead = <nowiki>#317C29</nowiki>
| {{l4d2}}
| l4d2
| Left 4 Dead 2 = <nowiki>#BFA828</nowiki>
| {{as}}
| {{asbranch}}
| as
| asbranch
| Alien Swarm = <nowiki>#3E6D7F</nowiki>
| {{asrd}}
| asrd
| Alien Swarm: Reactive Drop = <nowiki>#108FBE</nowiki>
| {{portal}}
| {{portalseries}}
| portal
| Portal 2010 ARG Update
| Portal = <nowiki>#6bbcfa</nowiki>
| {{portal2}}
| {{portal2branch}}
| portal2branch
| portal2
| Portal 2 = <nowiki>#23B1E5</nowiki>
| {{p2ce}}
| p2ce
| P2CE
| Portal 2: Community Edition = <nowiki>#FF7B02</nowiki>
| {{sin}}
| sin
| SiN Episodes = <nowiki>#64a596</nowiki><!-- rgb(100,165,150) -->
| {{bms}}
| bms
| Black Mesa (Source)
| Black Mesa = <nowiki>#e47125</nowiki>
| {{Gmod}}
| gmod
| Garry's Mod = <nowiki>#1295f0</nowiki>
| {{insurgency}}
| insurgency
| Insurgency = <nowiki>#c7d1e0</nowiki>
| {{infra}}
| infra
| INFRA = <nowiki>#99ccff</nowiki>
| {{con}}
| con
| Contagion = <nowiki>#417ee0</nowiki>
| {{cs}}
| cs
| Counter-Strike = <nowiki>#eeeeee</nowiki>
| {{cscz}}
| cscz
| {{czds}}
| czds
| Condition Zero Deleted Scenes
| Counter-Strike: Condition Zero = <nowiki>#ffffa0</nowiki>
| {{css}}
| css
| Counter-Strike: Source = <nowiki>#90c0ff</nowiki>
| {{csgo}}
| {{csgobranch}}
| csgo
| csgobranch
| Counter-Strike: Global Offensive = <nowiki>#E9B963</nowiki>
| {{mapbase}}
| mapbase
| Mapbase = <nowiki>#a163c9</nowiki>
| {{dmc}}
| dmc
| Deathmatch Classic = <nowiki>#998E6B</nowiki>
| {{ez}}
| ez
| ez1
| Entropy : Zero = <nowiki>#00fff7</nowiki>
| {{ez2}}
| ez2
| Entropy : Zero 2 = <nowiki>#ff5729</nowiki>
| {{synergy}}
| synergy
| Synergy = <nowiki>#09e359</nowiki>
| {{sfm}}
| sfm
| Source Filmmaker = <nowiki>#C8B17D</nowiki>
| {{dota2}}
| dota2
| Dota 2 = <nowiki>#AB3928</nowiki>
| {{jbep3}}
| jbep3
| Jabroni Brawl: Episode 3 = <nowiki>#fb4c39</nowiki>
| {{momentum}}
| momentum
| Momentum Mod = <nowiki>#1795d2</nowiki>
| {{tsha}}
| tsha
| TeamSpen's Hammer Addons = <nowiki>#1ff2f2</nowiki>
| {{cs2}}
| cs2
| Counter-Strike 2 = <nowiki>#e0881e</nowiki>
| {{titanfall}}
| titanfall
| Titanfall = <nowiki>#ADD8E6</nowiki>
| {{titanfall2}}
| titanfall2
| Titanfall 2 = <nowiki>#a6e5fe</nowiki>
| {{tfbranch}}
| tfbranch
| Titanfall engine branch = <nowiki>#ADD8E6</nowiki>
| #default = <nowiki>#add8e6</nowiki>
}}</onlyinclude></includeonly><noinclude>
{{doc}}
{{doc}}
<!-- Add categories to the /doc subpage, not here -->
<!-- Add categories to the /doc subpage, not here -->
</noinclude>
</noinclude>

Revision as of 18:06, 23 July 2024

Red x.png
This template (and its redirect) is Wikipedia icon Deprecated. Its use is not recommended and its functionality may be compromised.
You can help our editors by replacing or deleting this template on the Pages that use this template. Once no more pages use this template, it should be Marked for deletion.

Additional notes:
Use {{software}} instead: {{hl2|col}} → #E6AC39.
English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Curly brackets white.pngTemplate Documentation [view] [edit]
Icon-translate.png Available doc translations
View
Page history

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}} col}} Example text
{{Game color|hl2}} #E6AC39 Example text
{{Game color|hl2|default=#00ff88}} #E6AC39 Example text
{{Game color|qwerty|default=#00ff88}}
  1. abcdef
Example text
{{Game color|qwerty}}
  1. abcdef
Example text
{{Game color|todo}}
Todo: col
<b style="color:
Todo: col
">Example text
{{Game color|removed}} (removed since col) <b style="color:(removed since col)">Example text

See also