View Raw SPL
/* composite color value to 0-255 RGB values */
color2rgb(color)
{
        local r, g, b, rgb;

        /* 0.0 to 1.0 values */
        (r, g, b) = colortorgb(color);

        r *= 255;
        g *= 255;
        b *= 255;

        if (outargc > 1)
        {
                return(r, g, b);
        }
        else
        {
                rgb = concat({r}, {g}, {b});
                setvunits(rgb, "RGB");

                return(rgb);
        }
}