---
name: "MPE_Add_RGB_color"
section: "4"
platform: "linux"
package: "mpi-doc"
version: "1.2.7-9.1"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/MPE_Add_RGB_color"
---

# MPE\_Add\_RGB\_color(4)

Adds a color to the colormap given its RGB values

## NAME

MPE\_Add\_RGB\_color -  Adds a color to the colormap given its RGB values

## SYNOPSIS

```
#include "mpe.h"
int MPE_Add_RGB_color( graph, red, green, blue, mapping )
MPE_XGraph graph;
int red, green, blue;
MPE_Color *mapping;
```

## INPUT PARAMETERS

- **graph**

  \- MPE graphics handle

- **red, green, blue**

  \- color levels from 0 to 65535

## OUTPUT PARAMETER

- **mapping**

  \- index of the new color

## RETURN VALUES

- **-1**

  \- maxcolors too large (equal to numcolors)

- **MPE\_SUCCESS**

  \- successful

- **mapping**

  \- index of the new color

## NOTES

This call adds a color cell to X11's color table, increments maxcolors (the index), and writes it to the mapping parameter.

## NOTES FOR FORTRAN INTERFACE

The Fortran interface to this routine is different from its C counterpart and it has an additional argument, ierr, at the end of the argument list, i.e. the returned function value (the error code) in C interface is returned as the additional argument in Fortran interface.  The Fortran interface is invoked with the CALL statement.

All MPI and MPE objects, MPI\_Comm, MPE\_XGraph and MPE\_Color, are of type INTEGER in Fortran.

## LOCATION

mpe\_graphics.c
