Actions

Template

Difference between revisions of "ColourPercentBG"

From NEC Retro

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.9|{{
#ifexpr:{{#var:value}} > 0.8|{{WikiColour|BG|magenta}}|{{
+
  #vardefine:startcolour|{{WikiColour|BG|redmagenta}}}}{{
#ifexpr:{{#var:value}} > 0.7|{{WikiColour|BG|purple}}|{{
+
  #vardefine:endcolour|{{WikiColour|BG|red}}}}{{
#ifexpr:{{#var:value}} > 0.6|{{WikiColour|BG|blue}}|{{
+
  #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.9)*10}}}}|{{
#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.8|{{
 +
  #vardefine:startcolour|{{WikiColour|BG|magenta}}}}{{
 +
  #vardefine:endcolour|{{WikiColour|BG|redmagenta}}}}{{
 +
  #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.8)*10}}}}|{{
 +
 +
#ifexpr:{{#var:colourvalue}} > 0.7|{{
 +
  #vardefine:startcolour|{{WikiColour|BG|purple}}}}{{
 +
  #vardefine:endcolour|{{WikiColour|BG|magenta}}}}{{
 +
  #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.7)*10}}}}|{{
 +
 +
#ifexpr:{{#var:colourvalue}} > 0.6|{{
 +
  #vardefine:startcolour|{{WikiColour|BG|blue}}}}{{
 +
  #vardefine:endcolour|{{WikiColour|BG|purple}}}}{{
 +
  #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.6)*10}}}}|{{
 +
 +
#ifexpr:{{#var:colourvalue}} > 0.5|{{
 +
  #vardefine:startcolour|{{WikiColour|BG|cyan}}}}{{
 +
  #vardefine:endcolour|{{WikiColour|BG|blue}}}}{{
 +
  #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.5)*10}}}}|{{
 +
 +
#ifexpr:{{#var:colourvalue}} > 0.4|{{
 +
  #vardefine:startcolour|{{WikiColour|BG|green}}}}{{
 +
  #vardefine:endcolour|{{WikiColour|BG|cyan}}}}{{
 +
  #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.4)*10}}}}|{{
 +
 +
#ifexpr:{{#var:colourvalue}} > 0.3|{{
 +
  #vardefine:startcolour|{{WikiColour|BG|yellowgreen}}}}{{
 +
  #vardefine:endcolour|{{WikiColour|BG|green}}}}{{
 +
  #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.3)*10}}}}|{{
 +
 +
#ifexpr:{{#var:colourvalue}} > 0.2|{{
 +
  #vardefine:startcolour|{{WikiColour|BG|yellow}}}}{{
 +
  #vardefine:endcolour|{{WikiColour|BG|yellowgreen}}}}{{
 +
  #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.2)*10}}}}|{{
 +
 +
#ifexpr:{{#var:colourvalue}} > 0.1|{{
 +
  #vardefine:startcolour|{{WikiColour|BG|orange}}}}{{
 +
  #vardefine:endcolour|{{WikiColour|BG|yellow}}}}{{
 +
  #vardefine:newvalue|{{#expr:({{#var:colourvalue}}-0.1)*10}}}}|{{
 +
 +
#ifexpr:{{#var:colourvalue}} > 0.0|{{
 +
  #vardefine:startcolour|{{WikiColour|BG|red}}}}{{
 +
  #vardefine:endcolour|{{WikiColour|BG|orange}}}}{{
 +
  #vardefine:newvalue|{{#expr:{{#var:colourvalue}}*10}}}}|}}
 +
}}}}}}}}}}}}}}}}}}{{
 +
#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|{{Percent
 +
|min={{#var:rmin}}
 +
|max={{#var:rmax}}
 +
|value={{#expr:{{#var:rmin}} + (({{#var:rmax}}-{{#var:rmin}}) * {{#var:newvalue}})}}
 +
}}}}{{
 +
#vardefine:gvalue|{{Percent
 +
|min={{#var:gmin}}
 +
|max={{#var:gmax}}
 +
|value={{#expr:{{#var:gmin}} + (({{#var:gmax}}-{{#var:gmin}}) * {{#var:newvalue}})}}
 +
}}}}{{
 +
#vardefine:bvalue|{{Percent
 +
|min={{#var:bmin}}
 +
|max={{#var:bmax}}
 +
|value={{#expr:{{#var:bmin}} + (({{#var:bmax}}-{{#var:bmin}}) * {{#var:newvalue}})}}
 +
}}}}<!--
 +
 +
*{{#var:rmin}} {{#var:rmax}} {{#var:colourvalue}} {{#var:newvalue}} -> RED {{#var:rvalue}}
 +
*>>{{#expr:{{#var:rmin}} + (({{#var:rmax}}-{{#var:rmin}}) * {{#var:value}})}}
 +
*{{#var:gmin}} {{#var:gmax}} {{#var:colourvalue}} {{#var:newvalue}} -> GREEN {{#var:gvalue}}
 +
*>>{{#expr:{{#var:gmin}} + (({{#var:gmax}}-{{#var:gmin}}) * {{#var:value}})}}
 +
*{{#var:bmin}} {{#var:bmax}} {{#var:colourvalue}} {{#var:newvalue}} -> BLUE {{#var:bvalue}}
 +
*>>{{#expr:{{#var:bmin}} + (({{#var:bmax}}-{{#var:bmin}}) * {{#var:value}})}}
 +
 +
-->rgb({{#expr:{{#var:rvalue}}*255}}, {{#expr:{{#var:gvalue}}*255}}, {{#expr:{{#var:bvalue}}*255}})</includeonly><noinclude>
 
{|
 
{|
 
|style="background-color:{{ColourPercentBG|min=0|max=100|value=5}}"|5
 
|style="background-color:{{ColourPercentBG|min=0|max=100|value=5}}"|5
Line 55: Line 125:
 
|}
 
|}
  
*{{#vardefine:redmagentadec|{{Hex2Dec|{{#sub:{{WikiColour|BG|redmagenta}}|0|6}}}}}} {{#var:redmagentadec}}
 
*{{#vardefine:reddec|{{Hex2Dec|{{#sub:{{WikiColour|BG|red}}|0|6}}}}}} {{#var:reddec}}
 
 
*{{ColourPercentBG|min={{#var:redmagentadec}}|max={{#var:reddec}}|value=11}}
 
  
 +
*{{ColourPercentBG|min=0|max=100|value=0}}
 +
*{{ColourPercentBG|min=0|max=100|value=10}}
 +
*{{ColourPercentBG|min=0|max=100|value=20}}
 +
*{{ColourPercentBG|min=0|max=100|value=30}}
 +
*{{ColourPercentBG|min=0|max=100|value=40}}
 +
*{{ColourPercentBG|min=0|max=100|value=50}}
 +
*{{ColourPercentBG|min=0|max=100|value=60}}
 +
*{{ColourPercentBG|min=0|max=100|value=70}}
 +
*{{ColourPercentBG|min=0|max=100|value=80}}
 +
*{{ColourPercentBG|min=0|max=100|value=90}}
 +
*{{ColourPercentBG|min=0|max=100|value=100}}
 +
*{{#var:startcolour}}
 +
*{{#var:endcolour}}
  
 
TODO
 
TODO
 
[[Category:Templates]]</noinclude>
 
[[Category:Templates]]</noinclude>

Revision as of 07:22, 24 February 2022

5 15 25 35 45 55 65 75 85 95
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


  • rgb(255, 255, 255)
  • rgb(255, 255, 255)
  • rgb(255, 255, 255)
  • rgb(255, 255, 255)
  • rgb(255, 255, 255)
  • rgb(255, 255, 255)
  • rgb(255, 255, 255)
  • rgb(255, 255, 255)
  • rgb(255, 255, 255)
  • rgb(255, 255, 255)
  • rgb(255, 255, 255)
  • #F8BBCF;
  • #F8C8BB;

TODO