Difference between revisions of "Template:Color scale"

From blackwiki
Jump to navigation Jump to search
imported>Evolution and evolvability
(Created page with '<!-- Comment -->{{Hexadecimal|{{#expr:(({{{Rvalue|5}}}-{{{Rmin|0}}}) / ({{{Rmax|10}}}-{{{Rmin|0}}}))*255}}|no}}<!-- Red -->{{Hexadecimal|{{#expr:(({{{Gvalue|5}...')
 
imported>Evolution and evolvability
(+ doc)
Line 3: Line 3:
 
-->{{Hexadecimal|{{#expr:(({{{Gvalue|5}}}-{{{Gmin|0}}}) / ({{{Gmax|10}}}-{{{Gmin|0}}}))*255}}|no}}<!-- Green
 
-->{{Hexadecimal|{{#expr:(({{{Gvalue|5}}}-{{{Gmin|0}}}) / ({{{Gmax|10}}}-{{{Gmin|0}}}))*255}}|no}}<!-- Green
 
-->{{Hexadecimal|{{#expr:(({{{Bvalue|5}}}-{{{Bmin|0}}}) / ({{{Bmax|10}}}-{{{Bmin|0}}}))*255}}|no}}<!-- Blue
 
-->{{Hexadecimal|{{#expr:(({{{Bvalue|5}}}-{{{Bmin|0}}}) / ({{{Bmax|10}}}-{{{Bmin|0}}}))*255}}|no}}<!-- Blue
-->
+
--><noinclude>{{doc}}</noinclude>

Revision as of 00:16, 4 July 2019

7F7F7F

50px Template documentation[view] [edit] [history] [purge]

Usage

Used to create a colour hex code based on a value. Can be used for colour scales from numbers.

{{Color scale
|value  = value (is overridden by specifying Rvalue/Gvalue/Bvalue ; default 0)
|Rvalue = red value   (default 0)
|Gvalue = green value (default 0)
|Bvalue = blue value  (default 0)
|Rmax   = maximum value to scale red channel to   (default 10)
|Rmin   = minimum value to scale red channel to   (default 0)
|Gmax   = maximum value to scale green channel to (default 10)
|Gmin   = minimum value to scale green channel to (default 0)
|Bmax   = maximum value to scale blue channel to  (default 10)
|Bmin   = minimum value to scale blue channel to  (default 0)
}}

Example 1, red scale

{{Color scale| Rvalue = 0 }}
{{Color scale| Rvalue = 3 }}
{{Color scale| Rvalue = 6 }}
{{Color scale| Rvalue = 9 }}

produces → 007F7F 4C7F7F 997F7F E57F7F

Example 2, mixed scale

{{Color scale| value = 4.0 |Rmin=7|Rmax=4|Gmin=7|Gmax=0|Bmin=4|Bmax=30}}
{{Color scale| value = 4.5 |Rmin=7|Rmax=4|Gmin=7|Gmax=0|Bmin=4|Bmax=30}}
{{Color scale| value = 5.0 |Rmin=7|Rmax=4|Gmin=7|Gmax=0|Bmin=4|Bmax=30}}
{{Color scale| value = 5.5 |Rmin=7|Rmax=4|Gmin=7|Gmax=0|Bmin=4|Bmax=30}}
{{Color scale| value = 6.0 |Rmin=7|Rmax=4|Gmin=7|Gmax=0|Bmin=4|Bmax=30}}
{{Color scale| value = 6.5 |Rmin=7|Rmax=4|Gmin=7|Gmax=0|Bmin=4|Bmax=30}}

produces → AA4809 AA4809 AA4809 AA4809 AA4809 AA4809