3
<em>r.what.color</em> outputs the color associated with user-specified
4
category values in a raster input map.
5
<p>Values may be specified either using the <b>values=</b> option, or by
6
specifying the <b>-i</b> flag and passing the values on
7
<tt>stdin</tt>, one per line.
8
<p>For each value which is specified, a line of output will be generated
9
consisting of the category value followed by the color, e.g.:
11
<div class="code"><pre>
12
r.what.color input=elevation.dem value=1500
16
<p>If the input map is an integer (CELL) map, the category will be
17
written as an integer (no decimal point), otherwise it will be written
18
in floating point format (<i>printf("%.15g")</i> format).
20
<p>If the lookup fails for a value, the color will be output as an
23
<div class="code"><pre>
24
r.what.color input=elevation.dem value=9999
28
<p>If a value cannot be parsed, both the value and the color will be
29
output as an asterisk, e.g.:
31
<div class="code"><pre>
32
r.what.color input=elevation.dem value=bogus
36
<p>The format can be changed using the <b>format=</b> option. The value
37
should be a <i>printf()</i>-style format string containing three
38
conversion specifiers for the red, green and blue values respectively,
41
<div class="code"><pre>
42
r.what.color input=elevation.dem value=1500 format='%02x:%02x:%02x'
46
<p>If your system supports the <i>%m$</i> syntax, you can change the
47
ordering of the components, e.g.:
49
<div class="code"><pre>
50
r.what.color input=elevation.dem value=1500 format='%3$02x:%2$02x:%1$02x'
54
<p>Common formats:<br>
56
<li>Tcl/Tk: <tt>format="#%02x%02x%02x"</tt>
57
<li>WxPython: <tt>format='"#%02x%02x%02x"'</tt> or <tt>format='"(%d,%d,%d)"'</tt>
64
<a href="r.what.html">r.what</a>