Difference between revisions of "Template:Font colour"

From Team Fortress Wiki
Jump to: navigation, search
m (Added a note so I know to deal with it later)
(+ cat)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<!--
+
<font color="{{#switch:{{{1}}}
 
 
ISSUE: The switch statement doesn't parse "strange" as the parameter, but rather as the actual input for some reason. Fix that, somehow.
 
 
 
--><font color="{{#switch:{{ucfirst:{{{1}}}}}
 
 
| normal = #B2B2B2
 
| normal = #B2B2B2
 
| unique = #FFD700
 
| unique = #FFD700
Line 24: Line 20:
  
 
; 1
 
; 1
: Accepts colours and hex values, as well as item quality names. Defaults to black.
+
: Accepts colours and hex values, as well as item quality names (must be in all lowercase). Defaults to black.
  
 
; 2  
 
; 2  
Line 31: Line 27:
 
== Example ==
 
== Example ==
 
<code><nowiki>{{Font colour|green|Hello Wiki!}}</nowiki></code> produces:
 
<code><nowiki>{{Font colour|green|Hello Wiki!}}</nowiki></code> produces:
{{User:GrampaSwood/Template:Font colour|green|Hello Wiki!}}
+
{{Font colour|green|Hello Wiki!}}
  
 
<code><nowiki>{{Font colour|strange|Strange items}}</nowiki></code> produces:
 
<code><nowiki>{{Font colour|strange|Strange items}}</nowiki></code> produces:
{{User:GrampaSwood/Template:Font colour|strange|Strange items}}
+
{{Font colour|strange|Strange items}}
 +
 
 +
<code><nowiki>{{Font colour|E52A6F|Goodbye Wiki!}}</nowiki></code> produces:
 +
{{Font colour|E52A6F|Goodbye Wiki!}}
 +
 
 +
[[Category:Formatting templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 23:28, 31 March 2024

{{{2}}}

Documentation for Font colour

Template for changing font colours. By default supports all item qualities in TF2. Otherwise accepts hex and text (e.g. "red").

Usage

{{Font colour|1|2}}

1
Accepts colours and hex values, as well as item quality names (must be in all lowercase). Defaults to black.
2
Text to display in the aforementioned colour.

Example

{{Font colour|green|Hello Wiki!}} produces: Hello Wiki!

{{Font colour|strange|Strange items}} produces: Strange items

{{Font colour|E52A6F|Goodbye Wiki!}} produces: Goodbye Wiki!