Skip to content

r.colors.out

Exports the color table associated with a raster map.

r.colors.out [-p] map=name [rules=name] format=name color_format=name [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

r.colors.out map=name format=plain color_format=hex

grass.script.parse_command("r.colors.out", map, rules=None, format="plain", color_format="hex", flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.parse_command("r.colors.out", map="name", format="json", color_format="hex")

Parameters

map=name [required]
    Name of raster map
rules=name
    Path to output rules file
    If not given write to standard output
format=name [required]
    Output format
    Allowed values: plain, json
    Default: plain
    plain: Plain text output
    json: JSON (JavaScript Object Notation)
color_format=name [required]
    Color format
    Color format for output values.
    Allowed values: rgb, hex, hsv, triplet
    Default: hex
    rgb: output color in RGB format
    hex: output color in HEX format
    hsv: output color in HSV format (experimental)
    triplet: output color in colon-separated RGB format
-p
    Output values as percentages
--overwrite
    Allow output files to overwrite existing files
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

map : str, required
    Name of raster map
    Used as: input, raster, name
rules : str, optional
    Path to output rules file
    If not given write to standard output
    Used as: output, file, name
format : str, required
    Output format
    Used as: name
    Allowed values: plain, json
    plain: Plain text output
    json: JSON (JavaScript Object Notation)
    Default: plain
color_format : str, required
    Color format
    Color format for output values.
    Used as: name
    Allowed values: rgb, hex, hsv, triplet
    rgb: output color in RGB format
    hex: output color in HEX format
    hsv: output color in HSV format (experimental)
    triplet: output color in colon-separated RGB format
    Default: hex
flags : str, optional
    Allowed values: p
    p
        Output values as percentages
overwrite: bool, optional
    Allow output files to overwrite existing files
    Default: False
verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

r.colors.out allows the user to export the color table for a raster map to a file which is suitable as input to r.colors.

EXAMPLES

r.colors.out map=el_D782_6m rules=rules.txt
r.colors map=el_D783_6m rules=rules.txt
r.colors.out map=el_D782_6m rules=rules.json format=json

SEE ALSO

r.colors

AUTHOR

Glynn Clements

SOURCE CODE

Available at: r.colors.out source code (history)
Latest change: Wednesday Jun 04 20:44:43 2025 in commit 7cd2631