View Raw SPL
/*****************************************************************************
*                                                                            *
*   SETRGBPROPS.SPL  Copyright (C) 2026 DSP Development Corporation           *
*                               All Rights Reserved                          *
*                                                                            *
*   Author:      Randy Race                                                  *
*                                                                            *
*   Synopsis:    Sets units and colors of RGB colormaps                      *
*                                                                            *
*   Revisions:   12 Mar 2026  RRR  Creation                                  *
*                                                                            *
*****************************************************************************/


#if @HELP_SETRGBPROPS

    SETRGBPROPS

    Purpose: Sets units and colors of RGB traces.

    Syntax:  SETRGBPROPS(rgb)

               rgb - An NX3 array of RGB triples.


    Returns: Nothing, the units and colors of the RGB traces are modified.

    Remarks:
             SETRGBPROPS() is used internally by variuous colormap functions
             to add units and colors to RGB colormap triple.

             See CIVIDIS, INFERNO, MAGMA, PLASMA and VIRIDIS for 
             examples of colormaps.
#endif


/* sets colors and units of RGB traces */
setrgbprops(rgb = refwindow(w0))
{
        setvunits(rgb, "Red",   1);
        setvunits(rgb, "Green", 2);
        setvunits(rgb, "Blue",  3);

        /* set RGB trace colors */
        setcolor(rgb, seriesred,   1, 1);
        setcolor(rgb, seriesgreen, 1, 2);
        setcolor(rgb, seriesblue,  1, 3);

        setcomment(rgb, "RGB Values");

        clearshading(rgb);
}