Difference between revisions of "Template:Color scale/doc"

From blackwiki
Jump to navigation Jump to search
imported>Evolution and evolvability
(Created page with '→{{Documentation subpage}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikipedia:Wikidata) -->...')
 
imported>Evolution and evolvability
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Documentation subpage}}
+
{{Documentation subpage}}
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
  
Line 6: Line 6:
 
<pre>
 
<pre>
 
{{Color scale
 
{{Color scale
|value  = value (is overridden by; specifying Rvalue/Gvalue/Bvalue default 0)
+
|value  = value (is overridden by specifying Rvalue/Gvalue/Bvalue ; default 0)
 
|Rvalue = red value  (default 0)
 
|Rvalue = red value  (default 0)
 
|Gvalue = green value (default 0)
 
|Gvalue = green value (default 0)
Line 19: Line 19:
 
</pre>
 
</pre>
  
Example red scale: <nowiki>{{Color scale|Rvalue=3}}, {{Color scale|Rvalue=6}}, {{Color scale|Rvalue=9}}</nowiki>
+
====Example 1, red scale====
→ {{Color scale|Rvalue=3}}, {{Color scale|Rvalue=6}}, {{Color scale|Rvalue=9}}
+
<Pre>
 +
{{Color scale| Rvalue = 0 }}
 +
{{Color scale| Rvalue = 3 }}
 +
{{Color scale| Rvalue = 6 }}
 +
{{Color scale| Rvalue = 9 }}
 +
</pre>
 +
produces
 +
{{Color scale| Rvalue = 0 }}
 +
{{Color scale| Rvalue = 3 }}
 +
{{Color scale| Rvalue = 6 }}
 +
{{Color scale| Rvalue = 9 }}
 +
 
 +
====Example 2, mixed scale====
 +
<Pre>
 +
{{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}}
 +
</pre>
 +
produces →
 +
{{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}}
 +
 
 +
 
  
 
<includeonly>{{sandbox other||
 
<includeonly>{{sandbox other||

Latest revision as of 01:13, 4 July 2019

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 → #000000 #4C0000 #990000 #E50000

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 → #FF6D00 #D45B04 #AA4809 #7F360E #552413 #2A1218