Difference between revisions of "Template:Hex interpolate"

From QBWiki
Jump to navigation Jump to search
 
Line 12: Line 12:
 
--><!---->{{#ifexpr:{{#var:j1}}>{{#var:j2}}<!--
 
--><!---->{{#ifexpr:{{#var:j1}}>{{#var:j2}}<!--
 
--><!----><!---->|{{#expr:(({{#var:j1}}-{{#var:j2}}) * {{{fraction|1}}} round 0) + {{#var:j2}}}} <!--
 
--><!----><!---->|{{#expr:(({{#var:j1}}-{{#var:j2}}) * {{{fraction|1}}} round 0) + {{#var:j2}}}} <!--
--><!----><!---->|{{#expr:(({{#var:j2}}-{{#var:j1}}) * {{{fraction|1}}} round 0) + {{#var:j1}}}} <!--
+
--><!----><!---->|{{#expr:(({{#var:j2}}-{{#var:j1}}) * (1-{{{fraction|1}}}) round 0) + {{#var:j1}}}} <!--
 
--><!---->}}{{#ifexpr:{{#var:i}}<2|.}}<!--
 
--><!---->}}{{#ifexpr:{{#var:i}}<2|.}}<!--
 
-->}}}}<!--
 
-->}}}}<!--
Line 45: Line 45:
 
| bgcolor={{Hex interpolate|90e077|ffffff|fraction=1}} | {{Hex interpolate|90e077|ffffff|fraction=1}}
 
| bgcolor={{Hex interpolate|90e077|ffffff|fraction=1}} | {{Hex interpolate|90e077|ffffff|fraction=1}}
 
|-
 
|-
| bgcolor={{Hex interpolate|e09292|ffffff|fraction=0}} | {{Hex interpolate|e09292|ffffff|fraction=0}}
+
| bgcolor={{Hex interpolate|ffffff|90e077|fraction=0}} | {{Hex interpolate|ffffff|90e077|fraction=0}}
| bgcolor={{Hex interpolate|e09292|ffffff|fraction=0.2}} | {{Hex interpolate|e09292|ffffff|fraction=0.2}}
+
| bgcolor={{Hex interpolate|ffffff|90e077|fraction=0.2}} | {{Hex interpolate|ffffff|90e077|fraction=0.2}}
| bgcolor={{Hex interpolate|e09292|ffffff|fraction=0.4}} | {{Hex interpolate|e09292|ffffff|fraction=0.4}}
+
| bgcolor={{Hex interpolate|ffffff|90e077|fraction=0.4}} | {{Hex interpolate|ffffff|90e077|fraction=0.4}}
| bgcolor={{Hex interpolate|e09292|ffffff|fraction=0.6}} | {{Hex interpolate|e09292|ffffff|fraction=0.6}}
+
| bgcolor={{Hex interpolate|ffffff|90e077|fraction=0.6}} | {{Hex interpolate|ffffff|90e077|fraction=0.6}}
| bgcolor={{Hex interpolate|e09292|ffffff|fraction=0.8}} | {{Hex interpolate|e09292|ffffff|fraction=0.8}}
+
| bgcolor={{Hex interpolate|ffffff|90e077|fraction=0.8}} | {{Hex interpolate|ffffff|90e077|fraction=0.8}}
| bgcolor={{Hex interpolate|e09292|ffffff|fraction=1}} | {{Hex interpolate|e09292|ffffff|fraction=1}}
+
| bgcolor={{Hex interpolate|ffffff|90e077|fraction=1}} | {{Hex interpolate|ffffff|90e077|fraction=1}}
 
|}
 
|}

Latest revision as of 22:19, 20 June 2022

000000

Input Output
{{Hex interpolate}}
000000
{{Hex interpolate|000000|ffffff|fraction=0.5}}
808080
{{Hex interpolate|fraction=0}}
ffffff
0.0 0.2 0.4 0.6 0.8 1.0
ffffff e9f9e4 d3f3c9 bcecad a6e692 90e077
90e077 a6e692 bcecad d3f3c9 e9f9e4 ffffff