Template talk:Metacritic score color

From Valve Developer Community
Jump to: navigation, search
Icon-message-48px.png
This is the discussion page of Template:Metacritic score color. To add a comment, use the Edit button near the headline of the appropriate section. To create a new section, you can use the Add topic button at the top of this page.
Comments on talk pages should be signed with "~~~~", which will be converted into your signature and a timestamp.

An easier way to do this Template

Infotable}} template, I implemented the Metacritic Score block into it. It's already fully implemented. All colors are taken from the official site and even a text color change has been implemented, because white text on a yellow background is not very noticeable.

Here's my take on the template. If parameter {{{2}}} is not specified, the template will return the background color, if this parameter is specified as color, then the template will return the text color. Feel free to change it if you need to.

  1.  
  2.  
  3.  
  4.  
  5.  
{{Doc}} <includeonly><onlyinclude>{{#switch:{{{2|}}} | #default = {{#ifeq:{{#expr:{{{1|0}}} >= 75}}|1|&#35;66CC33|{{#ifeq:{{#expr:{{{1|0}}} >= 50}}|1|&#35;FFCC33|&#35;FF0000}}}} | color = {{#ifeq:{{#expr:{{{1|0}}} >= 50}}|1|{{#ifeq:{{#expr:{{{1|0}}} < 75}}|1|black|white}}|white}} }}</onlyinclude></includeonly>

--Max34 (talk) 20:48, 2 May 2023

Cool man, thanks. Gotta love working on something for 30 minutes only to find that an easier, better, and faster way already exists. COOL. --Equalizer5118 (talk) 13:55, 2 May 2023