Map and Table Calculation

CLRRED( ) function

Returns the Red component of an (R,G,B) color.

Syntax

CLRRED(Color)

Input

Color is a map or a column with the Color domain or a picture domain, or an expression which results in a color
Domain type: system domain Color or a Picture domain

Output

CLRRED returns: a value
Domain: system domain Image

Note:

The CLRRED(Color) function is equivalent to MAPCOLORSEP(InMap, Red) operation.

Tips:

Usable in

Simple calculators, MapCalc, TabCalc

Examples

Pocket line calculator example:

? CLRRED(RPRCOLOR(Landuse,"Airport"))

returns the red component of class "Airport" from representation Landuse, e.g. 255.

TabCalc example:

Red = CLRRED(Color)

 

Landuse.rpr

Landunit

Colorname

Color

Red

Agriculture

Yellow

(255, 255, 0)

255

Airport

Red

(255, 0, 0)

255

Bare soils

Brown

(164, 40, 40)

164

Forest

Forest Green

(48, 128, 76)

48

Grass

Yellow Green

(98, 98, 98)

98

Lake

Blue

(0, 0, 255)

0

Riverbed

Cyan

(0, 255, 255)

0

Rocks

Gray

(128, 128, 128)

128

Shrubs

Magenta

(255, 0, 255)

255

MapCalc example:

LandColor = MAPCOLOR(Landuse)

Red = CLRRED(LandColor)

 

Landuse

LandColor

Red

Forest Forest Rocks
Shrubs Lake Grass
? Grass Airport
(48,128,76) (48,128,76) (128,128,128)
(255,0,255) (0,0,255) (98,98,98)
(0,0,0) (98,98,98) (255,0,0)
48 48 128
255 0 98
0 98 255

See also:

COLOR CLRGREEN CLRYELLOW CLRHUE
MAPCOLOR CLRBLUE CLRMAGENTA CLRSAT
RPRCOLOR CLRCYAN CLRINTENS
    CLRGREY COLORHSI