Actions

Template

Difference between revisions of "ColourPercentBG"

From NEC Retro

 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#vardefine:value|{{Percent
+
<includeonly>{{#vardefine:colourvalue|{{Percent
 
|min={{{min|}}}
 
|min={{{min|}}}
 
|max={{{max|}}}
 
|max={{{max|}}}
 
|value={{{value|}}}
 
|value={{{value|}}}
 
}}}}{{
 
}}}}{{
#ifexpr:{{#var:value}} > 0.9|{{WikiColour|BG|redmagenta}}|{{
+
#ifexpr:{{#var:colourvalue}} > 0.88888888|{{
#ifexpr:{{#var:value}} > 0.8|{{WikiColour|BG|magenta}}|{{
+
  #vardefine:startcolour|{{WikiColour|BG|magenta}}}}{{
#ifexpr:{{#var:value}} > 0.7|{{WikiColour|BG|purple}}|{{
+
  #vardefine:endcolour|{{WikiColour|BG|redmagenta}}}}{{
#ifexpr:{{#var:value}} > 0.6|{{WikiColour|BG|blue}}|{{
+
  #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.88888888)*9}}}}|{{
#ifexpr:{{#var:value}} > 0.5|{{WikiColour|BG|cyan}}|{{
 
#ifexpr:{{#var:value}} > 0.4|{{WikiColour|BG|green}}|{{
 
#ifexpr:{{#var:value}} > 0.3|{{WikiColour|BG|yellowgreen}}|{{
 
#ifexpr:{{#var:value}} > 0.2|{{WikiColour|BG|yellow}}|{{
 
#ifexpr:{{#var:value}} > 0.1|{{WikiColour|BG|orange}}|{{
 
#ifexpr:{{#var:value}} > 0.0|{{WikiColour|BG|red}}}}}}}}}}}}}}}}}}}}}}</includeonly><noinclude>
 
  
 +
#ifexpr:{{#var:colourvalue}} > 0.77777777|{{
 +
  #vardefine:startcolour|{{WikiColour|BG|purple}}}}{{
 +
  #vardefine:endcolour|{{WikiColour|BG|magenta}}}}{{
 +
  #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.77777777)*9}}}}|{{
 +
 +
#ifexpr:{{#var:colourvalue}} > 0.66666666|{{
 +
  #vardefine:startcolour|{{WikiColour|BG|blue}}}}{{
 +
  #vardefine:endcolour|{{WikiColour|BG|purple}}}}{{
 +
  #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.66666666)*9}}}}|{{
 +
 +
#ifexpr:{{#var:colourvalue}} > 0.55555555|{{
 +
  #vardefine:startcolour|{{WikiColour|BG|cyan}}}}{{
 +
  #vardefine:endcolour|{{WikiColour|BG|blue}}}}{{
 +
  #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.55555555)*9}}}}|{{
 +
 +
#ifexpr:{{#var:colourvalue}} > 0.44444444|{{
 +
  #vardefine:startcolour|{{WikiColour|BG|green}}}}{{
 +
  #vardefine:endcolour|{{WikiColour|BG|cyan}}}}{{
 +
  #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.44444444)*9}}}}|{{
 +
 +
#ifexpr:{{#var:colourvalue}} > 0.33333333|{{
 +
  #vardefine:startcolour|{{WikiColour|BG|yellowgreen}}}}{{
 +
  #vardefine:endcolour|{{WikiColour|BG|green}}}}{{
 +
  #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.33333333)*9}}}}|{{
 +
 +
#ifexpr:{{#var:colourvalue}} > 0.22222222|{{
 +
  #vardefine:startcolour|{{WikiColour|BG|yellow}}}}{{
 +
  #vardefine:endcolour|{{WikiColour|BG|yellowgreen}}}}{{
 +
  #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.22222222)*9}}}}|{{
 +
 +
#ifexpr:{{#var:colourvalue}} > 0.11111111|{{
 +
  #vardefine:startcolour|{{WikiColour|BG|orange}}}}{{
 +
  #vardefine:endcolour|{{WikiColour|BG|yellow}}}}{{
 +
  #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.11111111)*9}}}}|{{
 +
 +
#ifexpr:{{#var:colourvalue}} >= 0.0|{{
 +
  #vardefine:startcolour|{{WikiColour|BG|red}}}}{{
 +
  #vardefine:endcolour|{{WikiColour|BG|orange}}}}{{
 +
  #vardefine:newvalue|{{#expr:{{#var:colourvalue}}*9}}}}|}}
 +
}}}}}}}}}}}}}}}}{{
 +
#vardefine:rmin|{{Hex2Dec|{{#sub:{{#var:startcolour}}|0|2}}}}}}{{
 +
#vardefine:rmax|{{Hex2Dec|{{#sub:{{#var:endcolour}}|0|2}}}}}}{{
 +
#vardefine:gmin|{{Hex2Dec|{{#sub:{{#var:startcolour}}|2|2}}}}}}{{
 +
#vardefine:gmax|{{Hex2Dec|{{#sub:{{#var:endcolour}}|2|2}}}}}}{{
 +
#vardefine:bmin|{{Hex2Dec|{{#sub:{{#var:startcolour}}|4|2}}}}}}{{
 +
#vardefine:bmax|{{Hex2Dec|{{#sub:{{#var:endcolour}}|4|2}}}}}}{{
 +
 +
#vardefine:rvalue|{{#expr:{{#var:rmin}} + (({{#var:rmax}}-{{#var:rmin}}) * {{#var:newvalue}})}}}}{{
 +
#vardefine:gvalue|{{#expr:{{#var:gmin}} + (({{#var:gmax}}-{{#var:gmin}}) * {{#var:newvalue}})}}}}{{
 +
#vardefine:bvalue|{{#expr:{{#var:bmin}} + (({{#var:bmax}}-{{#var:bmin}}) * {{#var:newvalue}})}}}}rgb({{#expr:{{#var:rvalue}}}}, {{#expr:{{#var:gvalue}}}}, {{#expr:{{#var:bvalue}}}})</includeonly><noinclude>
 
{|
 
{|
|style="background-color:{{ColourPercentBG|min=0|max=100|value=5}}"|5
+
|style="background-color:{{ColourPercentBG|min=0|max=100|value=0}}"|0
|style="background-color:{{ColourPercentBG|min=0|max=100|value=15}}"|15
+
|style="background-color:{{ColourPercentBG|min=0|max=100|value=15}}"|10
|style="background-color:{{ColourPercentBG|min=0|max=100|value=25}}"|25
+
|style="background-color:{{ColourPercentBG|min=0|max=100|value=25}}"|20
|style="background-color:{{ColourPercentBG|min=0|max=100|value=35}}"|35
+
|style="background-color:{{ColourPercentBG|min=0|max=100|value=35}}"|30
|style="background-color:{{ColourPercentBG|min=0|max=100|value=45}}"|45
+
|style="background-color:{{ColourPercentBG|min=0|max=100|value=45}}"|40
|style="background-color:{{ColourPercentBG|min=0|max=100|value=55}}"|55
+
|style="background-color:{{ColourPercentBG|min=0|max=100|value=55}}"|50
|style="background-color:{{ColourPercentBG|min=0|max=100|value=65}}"|65
+
|style="background-color:{{ColourPercentBG|min=0|max=100|value=65}}"|60
|style="background-color:{{ColourPercentBG|min=0|max=100|value=75}}"|75
+
|style="background-color:{{ColourPercentBG|min=0|max=100|value=75}}"|70
|style="background-color:{{ColourPercentBG|min=0|max=100|value=85}}"|85
+
|style="background-color:{{ColourPercentBG|min=0|max=100|value=85}}"|80
|style="background-color:{{ColourPercentBG|min=0|max=100|value=95}}"|95
+
|style="background-color:{{ColourPercentBG|min=0|max=100|value=95}}"|90
 +
|style="background-color:{{ColourPercentBG|min=0|max=100|value=100}}"|100
 
|}
 
|}
  
 
{|
 
{|
|style="background-color:{{ColourPercentBG|min=0|max=10|value=1}}"|128KB
+
|style="background-color:{{ColourPercentBG|min=1|max=10|value=1}}"|128KB
|style="background-color:{{ColourPercentBG|min=0|max=10|value=2}}"|256KB
+
|style="background-color:{{ColourPercentBG|min=1|max=10|value=2}}"|256KB
|style="background-color:{{ColourPercentBG|min=0|max=10|value=3}}"|384KB
+
|style="background-color:{{ColourPercentBG|min=1|max=10|value=3}}"|384KB
|style="background-color:{{ColourPercentBG|min=0|max=10|value=4}}"|640KB
+
|style="background-color:{{ColourPercentBG|min=1|max=10|value=4}}"|640KB
|style="background-color:{{ColourPercentBG|min=0|max=10|value=5}}"|1.6MB
+
|style="background-color:{{ColourPercentBG|min=1|max=10|value=5}}"|1.6MB
|style="background-color:{{ColourPercentBG|min=0|max=10|value=6}}"|1.8MB
+
|style="background-color:{{ColourPercentBG|min=1|max=10|value=6}}"|1.8MB
|style="background-color:{{ColourPercentBG|min=0|max=10|value=7}}"|2.0MB
+
|style="background-color:{{ColourPercentBG|min=1|max=10|value=7}}"|2.0MB
|style="background-color:{{ColourPercentBG|min=0|max=10|value=8}}"|3.6MB
+
|style="background-color:{{ColourPercentBG|min=1|max=10|value=8}}"|3.6MB
|style="background-color:{{ColourPercentBG|min=0|max=10|value=9}}"|5.6MB
+
|style="background-color:{{ColourPercentBG|min=1|max=10|value=9}}"|5.6MB
|style="background-color:{{ColourPercentBG|min=0|max=10|value=10}}"|7.6MB
+
|style="background-color:{{ColourPercentBG|min=1|max=10|value=10}}"|7.6MB
 
|}
 
|}
  
 
{|
 
{|
|style="background-color:{{ColourPercentBG|min=0|max=10|value=1}}"|8086
+
|style="background-color:{{ColourPercentBG|min=1|max=11|value=1}}"|8086
|style="background-color:{{ColourPercentBG|min=0|max=11|value=2}}"|8086-2
+
|style="background-color:{{ColourPercentBG|min=1|max=11|value=2}}"|8086-2
|style="background-color:{{ColourPercentBG|min=0|max=11|value=3}}"|V30
+
|style="background-color:{{ColourPercentBG|min=1|max=11|value=3}}"|V30
|style="background-color:{{ColourPercentBG|min=0|max=11|value=4}}"|286
+
|style="background-color:{{ColourPercentBG|min=1|max=11|value=4}}"|286
|style="background-color:{{ColourPercentBG|min=0|max=11|value=5}}"|386SX
+
|style="background-color:{{ColourPercentBG|min=1|max=11|value=5}}"|386SX
|style="background-color:{{ColourPercentBG|min=0|max=11|value=6}}"|386DX
+
|style="background-color:{{ColourPercentBG|min=1|max=11|value=6}}"|386DX
|style="background-color:{{ColourPercentBG|min=0|max=11|value=7}}"|V30HL
+
|style="background-color:{{ColourPercentBG|min=1|max=11|value=7}}"|V30HL
|style="background-color:{{ColourPercentBG|min=0|max=11|value=8}}"|i486SX
+
|style="background-color:{{ColourPercentBG|min=1|max=11|value=8}}"|i486SX
|style="background-color:{{ColourPercentBG|min=0|max=11|value=9}}"|i486SX2
+
|style="background-color:{{ColourPercentBG|min=1|max=11|value=9}}"|i486SX2
|style="background-color:{{ColourPercentBG|min=0|max=11|value=10}}"|i486DX2
+
|style="background-color:{{ColourPercentBG|min=1|max=11|value=10}}"|i486DX2
|style="background-color:{{ColourPercentBG|min=0|max=11|value=11}}"|Pentium
+
|style="background-color:{{ColourPercentBG|min=1|max=11|value=11}}"|Pentium
 
|}
 
|}
  
*{{#vardefine:redmagentadec|{{Hex2Dec|{{#sub:{{WikiColour|BG|redmagenta}}|0|6}}}}}} {{#var:redmagentadec}}
+
{|
*{{#vardefine:reddec|{{Hex2Dec|{{#sub:{{WikiColour|BG|red}}|0|6}}}}}} {{#var:reddec}}
+
|style="background-color:{{ColourPercentBG|min=1|max=30|value=1}}"|1
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=2}}"|2
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=3}}"|3
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=4}}"|4
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=5}}"|5
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=6}}"|6
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=7}}"|7
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=8}}"|8
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=9}}"|9
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=10}}"|10
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=11}}"|11
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=12}}"|12
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=13}}"|13
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=14}}"|14
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=15}}"|15
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=16}}"|16
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=17}}"|17
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=18}}"|18
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=19}}"|19
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=20}}"|20
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=21}}"|21
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=22}}"|22
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=23}}"|23
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=24}}"|24
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=25}}"|25
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=26}}"|26
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=27}}"|27
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=28}}"|28
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=29}}"|29
 +
|style="background-color:{{ColourPercentBG|min=1|max=30|value=30}}"|30
 +
|}
  
*{{ColourPercentBG|min={{#var:redmagentadec}}|max={{#var:reddec}}|value=11}}
+
Pleasing multi-coloured background colours for tables. "Key" colours defined in [[Template:WikiColour]].
 +
<pre>{{ColourPercentBG|min=1|max=30|value=21}}</pre>
 +
{{ColourPercentBG|min=1|max=30|value=21}}
  
  
TODO
 
 
[[Category:Templates]]</noinclude>
 
[[Category:Templates]]</noinclude>

Latest revision as of 14:14, 24 February 2022

0 10 20 30 40 50 60 70 80 90 100
128KB 256KB 384KB 640KB 1.6MB 1.8MB 2.0MB 3.6MB 5.6MB 7.6MB
8086 8086-2 V30 286 386SX 386DX V30HL i486SX i486SX2 i486DX2 Pentium
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

Pleasing multi-coloured background colours for tables. "Key" colours defined in Template:WikiColour.

{{ColourPercentBG|min=1|max=30|value=21}}

rgb(193.20689835172, 200.48275760069, 255)