Difference between revisions of "Template:Difficulty color"

From QBWiki
Jump to navigation Jump to search
(Created page with "<includeonly>{{#vardefine:val|{{{1|3}}}}}{{Hex interpolate|800|fff|fraction=0.{{#sub:{{#var:val}}|0|1}}{{#ifexpr:{{#len:{{#var:val}}}}=2 |{{#ifeq:{{#sub:{{#var:val}}|1|1}}|-|3...")
 
Line 1: Line 1:
<includeonly>{{#vardefine:val|{{{1|3}}}}}{{Hex interpolate|800|fff|fraction=0.{{#sub:{{#var:val}}|0|1}}{{#ifexpr:{{#len:{{#var:val}}}}=2
+
<includeonly>{{#vardefine:val|{{{1|3}}}}}{{#vardefine:decimal|0.{{#expr:{{#sub:{{#var:val}}|0|1}}-1}}{{#ifexpr:{{#len:{{#var:val}}}}=2
|{{#ifeq:{{#sub:{{#var:val}}|1|1}}|-|3|7}}
+
|{{#ifeq:{{#sub:{{#var:val}}|1|1}}|-|2|8}}
|5}}}}</includeonly><noinclude>
+
|5}}}}style="background: #{{Hex interpolate|aa0000|ddffdd|fraction={{#var:decimal}}}}; color: {{#ifexpr:{{#var:decimal}}>0.5|white|black}}"</includeonly><noinclude>The idea here is to have a consistent color for difficulties on the [[QBReader]] numerical scale. Just randomly chose to [[Template:Hex interpolate|interpolate]] between #fff and #800 (a sort of dark red).
Using the [[QBReader]] numerical scale for convenience.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 9: Line 8:
 
! plus
 
! plus
 
|-
 
|-
|bgcolor={{Difficulty color|1-}}|1-
+
|{{Difficulty color|1-}}|1-
|bgcolor={{Difficulty color|1}}|1
+
|{{Difficulty color|1}}|1
|bgcolor={{Difficulty color|1+}}|1+
+
|{{Difficulty color|1+}}|1+
 
|-
 
|-
|bgcolor={{Difficulty color|2-}}|2-
+
|{{Difficulty color|2-}}|2-
|bgcolor={{Difficulty color|2}}|2
+
|{{Difficulty color|2}}|2
|bgcolor={{Difficulty color|2+}}|2+
+
|{{Difficulty color|2+}}|2+
 
|-
 
|-
|bgcolor={{Difficulty color|3-}}|3-
+
|{{Difficulty color|3-}}|3-
|bgcolor={{Difficulty color|3}}|3
+
|{{Difficulty color|3}}|3
|bgcolor={{Difficulty color|3+}}|3+
+
|{{Difficulty color|3+}}|3+
 
|-
 
|-
|bgcolor={{Difficulty color|4-}}|4-
+
|{{Difficulty color|4-}}|4-
|bgcolor={{Difficulty color|4}}|4
+
|{{Difficulty color|4}}|4
|bgcolor={{Difficulty color|4+}}|4+
+
|{{Difficulty color|4+}}|4+
 
|-
 
|-
|bgcolor={{Difficulty color|5-}}|5-
+
|{{Difficulty color|5-}}|5-
|bgcolor={{Difficulty color|5}}|5
+
|{{Difficulty color|5}}|5
|bgcolor={{Difficulty color|5+}}|5+
+
|{{Difficulty color|5+}}|5+
 
|-
 
|-
|bgcolor={{Difficulty color|6-}}|6-
+
|{{Difficulty color|6-}}|6-
|bgcolor={{Difficulty color|6}}|6
+
|{{Difficulty color|6}}|6
|bgcolor={{Difficulty color|6+}}|6+
+
|{{Difficulty color|6+}}|6+
 
|-
 
|-
|bgcolor={{Difficulty color|7-}}|7-
+
|{{Difficulty color|7-}}|7-
|bgcolor={{Difficulty color|7}}|7
+
|{{Difficulty color|7}}|7
|bgcolor={{Difficulty color|7+}}|7+
+
|{{Difficulty color|7+}}|7+
 
|-
 
|-
|bgcolor={{Difficulty color|8-}}|8-
+
|{{Difficulty color|8-}}|8-
|bgcolor={{Difficulty color|8}}|8
+
|{{Difficulty color|8}}|8
|bgcolor={{Difficulty color|8+}}|8+
+
|{{Difficulty color|8+}}|8+
 
|-
 
|-
|bgcolor={{Difficulty color|9-}}|9-
+
|{{Difficulty color|9-}}|9-
|bgcolor={{Difficulty color|9}}|9
+
|{{Difficulty color|9}}|9
|bgcolor={{Difficulty color|9+}}|9+
+
|{{Difficulty color|9+}}|9+
 
|}
 
|}
 
</noinclude>
 
</noinclude>

Revision as of 17:43, 25 February 2024

The idea here is to have a consistent color for difficulties on the QBReader numerical scale. Just randomly chose to interpolate between #fff and #800 (a sort of dark red).

minus plus
1- 1 1+
2- 2 2+
3- 3 3+
4- 4 4+
5- 5 5+
6- 6 6+
7- 7 7+
8- 8 8+
9- 9 9+