Actions

Template

Difference between revisions of "ColourPercentBG"

From NEC Retro

 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
 
|value={{{value|}}}
 
|value={{{value|}}}
 
}}}}{{
 
}}}}{{
#ifexpr:{{#var:colourvalue}} > 0.9|{{
+
#ifexpr:{{#var:colourvalue}} > 0.88888888|{{
  #vardefine:startcolour|{{WikiColour|BG|redmagenta}}}}{{
 
  #vardefine:endcolour|{{WikiColour|BG|red}}}}{{
 
  #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.9)*10}}}}|{{
 
 
 
#ifexpr:{{#var:colourvalue}} > 0.8|{{
 
 
   #vardefine:startcolour|{{WikiColour|BG|magenta}}}}{{
 
   #vardefine:startcolour|{{WikiColour|BG|magenta}}}}{{
 
   #vardefine:endcolour|{{WikiColour|BG|redmagenta}}}}{{
 
   #vardefine:endcolour|{{WikiColour|BG|redmagenta}}}}{{
   #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.8)*10}}}}|{{
+
   #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.88888888)*9}}}}|{{
  
#ifexpr:{{#var:colourvalue}} > 0.7|{{
+
#ifexpr:{{#var:colourvalue}} > 0.77777777|{{
 
   #vardefine:startcolour|{{WikiColour|BG|purple}}}}{{
 
   #vardefine:startcolour|{{WikiColour|BG|purple}}}}{{
 
   #vardefine:endcolour|{{WikiColour|BG|magenta}}}}{{
 
   #vardefine:endcolour|{{WikiColour|BG|magenta}}}}{{
   #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.7)*10}}}}|{{
+
   #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.77777777)*9}}}}|{{
  
#ifexpr:{{#var:colourvalue}} > 0.6|{{
+
#ifexpr:{{#var:colourvalue}} > 0.66666666|{{
 
   #vardefine:startcolour|{{WikiColour|BG|blue}}}}{{
 
   #vardefine:startcolour|{{WikiColour|BG|blue}}}}{{
 
   #vardefine:endcolour|{{WikiColour|BG|purple}}}}{{
 
   #vardefine:endcolour|{{WikiColour|BG|purple}}}}{{
   #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.6)*10}}}}|{{
+
   #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.66666666)*9}}}}|{{
  
#ifexpr:{{#var:colourvalue}} > 0.5|{{
+
#ifexpr:{{#var:colourvalue}} > 0.55555555|{{
 
   #vardefine:startcolour|{{WikiColour|BG|cyan}}}}{{
 
   #vardefine:startcolour|{{WikiColour|BG|cyan}}}}{{
 
   #vardefine:endcolour|{{WikiColour|BG|blue}}}}{{
 
   #vardefine:endcolour|{{WikiColour|BG|blue}}}}{{
   #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.5)*10}}}}|{{
+
   #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.55555555)*9}}}}|{{
  
#ifexpr:{{#var:colourvalue}} > 0.4|{{
+
#ifexpr:{{#var:colourvalue}} > 0.44444444|{{
 
   #vardefine:startcolour|{{WikiColour|BG|green}}}}{{
 
   #vardefine:startcolour|{{WikiColour|BG|green}}}}{{
 
   #vardefine:endcolour|{{WikiColour|BG|cyan}}}}{{
 
   #vardefine:endcolour|{{WikiColour|BG|cyan}}}}{{
   #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.4)*10}}}}|{{
+
   #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.44444444)*9}}}}|{{
  
#ifexpr:{{#var:colourvalue}} > 0.3|{{
+
#ifexpr:{{#var:colourvalue}} > 0.33333333|{{
 
   #vardefine:startcolour|{{WikiColour|BG|yellowgreen}}}}{{
 
   #vardefine:startcolour|{{WikiColour|BG|yellowgreen}}}}{{
 
   #vardefine:endcolour|{{WikiColour|BG|green}}}}{{
 
   #vardefine:endcolour|{{WikiColour|BG|green}}}}{{
   #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.3)*10}}}}|{{
+
   #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.33333333)*9}}}}|{{
  
#ifexpr:{{#var:colourvalue}} > 0.2|{{
+
#ifexpr:{{#var:colourvalue}} > 0.22222222|{{
 
   #vardefine:startcolour|{{WikiColour|BG|yellow}}}}{{
 
   #vardefine:startcolour|{{WikiColour|BG|yellow}}}}{{
 
   #vardefine:endcolour|{{WikiColour|BG|yellowgreen}}}}{{
 
   #vardefine:endcolour|{{WikiColour|BG|yellowgreen}}}}{{
   #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.2)*10}}}}|{{
+
   #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.22222222)*9}}}}|{{
  
#ifexpr:{{#var:colourvalue}} > 0.1|{{
+
#ifexpr:{{#var:colourvalue}} > 0.11111111|{{
 
   #vardefine:startcolour|{{WikiColour|BG|orange}}}}{{
 
   #vardefine:startcolour|{{WikiColour|BG|orange}}}}{{
 
   #vardefine:endcolour|{{WikiColour|BG|yellow}}}}{{
 
   #vardefine:endcolour|{{WikiColour|BG|yellow}}}}{{
   #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.1)*10}}}}|{{
+
   #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.11111111)*9}}}}|{{
  
 
#ifexpr:{{#var:colourvalue}} >= 0.0|{{
 
#ifexpr:{{#var:colourvalue}} >= 0.0|{{
 
   #vardefine:startcolour|{{WikiColour|BG|red}}}}{{
 
   #vardefine:startcolour|{{WikiColour|BG|red}}}}{{
 
   #vardefine:endcolour|{{WikiColour|BG|orange}}}}{{
 
   #vardefine:endcolour|{{WikiColour|BG|orange}}}}{{
   #vardefine:newvalue|{{#expr:{{#var:colourvalue}}*10}}}}|}}
+
   #vardefine:newvalue|{{#expr:{{#var:colourvalue}}*9}}}}|}}
}}}}}}}}}}}}}}}}}}{{
+
}}}}}}}}}}}}}}}}{{
 
#vardefine:rmin|{{Hex2Dec|{{#sub:{{#var:startcolour}}|0|2}}}}}}{{
 
#vardefine:rmin|{{Hex2Dec|{{#sub:{{#var:startcolour}}|0|2}}}}}}{{
 
#vardefine:rmax|{{Hex2Dec|{{#sub:{{#var:endcolour}}|0|2}}}}}}{{
 
#vardefine:rmax|{{Hex2Dec|{{#sub:{{#var:endcolour}}|0|2}}}}}}{{
Line 60: Line 55:
 
#vardefine:bmin|{{Hex2Dec|{{#sub:{{#var:startcolour}}|4|2}}}}}}{{
 
#vardefine:bmin|{{Hex2Dec|{{#sub:{{#var:startcolour}}|4|2}}}}}}{{
 
#vardefine:bmax|{{Hex2Dec|{{#sub:{{#var:endcolour}}|4|2}}}}}}{{
 
#vardefine:bmax|{{Hex2Dec|{{#sub:{{#var:endcolour}}|4|2}}}}}}{{
 
#ifexpr:{{#var:rmin}} > {{#var:rmax}}|{{
 
  #vardefine:oldmin|{{#var:rmin}}}}{{
 
  #vardefine:oldmax|{{#var:rmax}}}}{{
 
  #vardefine:rmin|{{#var:oldmax}}}}{{
 
  #vardefine:rmax|{{#var:oldmin}}}}|}}{{
 
#ifexpr:{{#var:gmin}} > {{#var:gmax}}|{{
 
  #vardefine:oldmin|{{#var:gmin}}}}{{
 
  #vardefine:oldmax|{{#var:gmax}}}}{{
 
  #vardefine:gmin|{{#var:oldmax}}}}{{
 
  #vardefine:gmax|{{#var:oldmin}}}}|}}{{
 
#ifexpr:{{#var:bmin}} > {{#var:bmax}}|{{
 
  #vardefine:oldmin|{{#var:bmin}}}}{{
 
  #vardefine:oldmax|{{#var:bmax}}}}{{
 
  #vardefine:bmin|{{#var:oldmax}}}}{{
 
  #vardefine:bmax|{{#var:oldmin}}}}|}}{{
 
  
 
#vardefine:rvalue|{{#expr:{{#var:rmin}} + (({{#var:rmax}}-{{#var:rmin}}) * {{#var:newvalue}})}}}}{{
 
#vardefine:rvalue|{{#expr:{{#var:rmin}} + (({{#var:rmax}}-{{#var:rmin}}) * {{#var:newvalue}})}}}}{{
Line 108: Line 87:
  
 
{|
 
{|
|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
 +
|}
 +
 
 +
{|
 +
|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
 
|}
 
|}
  
 +
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}}
  
*0 {{ColourPercentBG|min=0|max=100|value=0}}
 
*5 {{ColourPercentBG|min=0|max=100|value=5}}
 
*10 {{ColourPercentBG|min=0|max=100|value=10}}
 
*15 {{ColourPercentBG|min=0|max=100|value=15}}
 
*20 {{ColourPercentBG|min=0|max=100|value=20}}
 
*25 {{ColourPercentBG|min=0|max=100|value=25}}
 
*30 {{ColourPercentBG|min=0|max=100|value=30}}
 
*35 {{ColourPercentBG|min=0|max=100|value=35}}
 
*40 {{ColourPercentBG|min=0|max=100|value=40}}
 
*45 {{ColourPercentBG|min=0|max=100|value=45}}
 
*50 {{ColourPercentBG|min=0|max=100|value=50}}
 
*55 {{ColourPercentBG|min=0|max=100|value=55}}
 
*60 {{ColourPercentBG|min=0|max=100|value=60}}
 
*65 {{ColourPercentBG|min=0|max=100|value=65}}
 
*70 {{ColourPercentBG|min=0|max=100|value=70}}
 
*75 {{ColourPercentBG|min=0|max=100|value=75}}
 
*80 {{ColourPercentBG|min=0|max=100|value=80}}
 
*85 {{ColourPercentBG|min=0|max=100|value=85}}
 
*90 {{ColourPercentBG|min=0|max=100|value=90}}
 
*95 {{ColourPercentBG|min=0|max=100|value=95}}
 
*100 {{ColourPercentBG|min=0|max=100|value=100}}
 
*{{#var:startcolour}}
 
*{{#var:endcolour}}
 
  
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)