# RSL_get_color_table
RSL_set_color_table

#

### Synopsis

#include "rsl.h"
void RSL_get_color_table(int icolor, char buffer[256], int *ncolors)
void RSL_set_color_table(int icolor, char buffer[256], int ncolors)

###

Description

RSL_get_color_table: Given a color table index, one of RSL_RED_TABLE, RSL_GREEN_TABLE or RSL_BLUE_TABLE, return up to 256 color indexes each containing the color intensity for that color at each index. The number of colors in the table is indicated in *ncolors.

RSL_set_color_table: Given a color table index icolor, one of RSL_RED_TABLE, RSL_GREEN_TABLE or RSL_BLUE_TABLE, and a character buffer, at most 256 color indexes long, and the number of indexes in the character buffer, set the color table. Each color index in buffer contains the color intensity for that color. Range of color intensities is 0 to 255.

You must make three calls to both the get and set functions to change the entire color table entry for a particular index. For example, to change the 5th index of the color table to cyan (Red=0, Green=255, Blue=255), perform the following (provided a color table is already loaded):

`char r[256], g[256], b[256];`
`RSL_get_color_table(RSL_RED_TABLE, r, &ncolors);`
`RSL_get_color_table(RSL_GREEN_TABLE, g, &ncolors);`
`RSL_get_color_table(RSL_BLUE_TABLE, b, &ncolors);```

`r[4] = (char)0; /* [4] is the 5-th index */`
`g[4] = (char)255;`
`b[4] = (char)255;```

`RSL_set_color_table(RSL_RED_TABLE, r, ncolors);`
`RSL_set_color_table(RSL_GREEN_TABLE, g, ncolors);`
`RSL_set_color_table(RSL_BLUE_TABLE, b, ncolors);`
``
`` ``

### Return value

None.

### See also

RSL_rebin_velocity_ray, RSL_rebin_velocity_sweep, RSL_rebin_velocity_volume,
RSL_sweep_to_gif, RSL_sweep_to_pict, Vsweep_to_pgm, Vsweep_to_ppm,
RSL_load_color_table, RSL_load_green_table, RSL_load_red_table, RSL_load_blue_table,
RSL_load_refl_color_table, RSL_load_sw_color_table, RSL_load_vel_color_table,
RSL_volume_to_gif, RSL_volume_to_pict, RSL_volume_to_pgm, RSL_volume_to_ppm.

Author: John H. Merritt