RGB.GetColor

OpenTuring

RGB.GetColorPart of RGB module

Syntax   RGB.GetColor (colorNumber : int,
 var redComp, greenComp, blueComp : real)

Description   The RGB.GetColor procedure returns the red, green and blue components to the color associated with the colorNumber parameter. The red, green and blue values are normalized to be between 0 and 1. Thus color white returns 1.0 for the redComp, greenComp and blueComp values and color black returns 0.0 for all three.

Example   This program gets the components of all the available colors.

        put "Color   Red     Green     Blue"
        for clr : 0 .. maxcolor
            var redComp, greenComp, blueComp : int
            RGB.GetColor (clr, redComp, greenComp, blueComp)
            put clr : 4, "  ", redComp : 6 : 4 , "  ", greenComp : 6 : 4, " ", 
                                        blueComp : 6 : 4
        end for
Details RGB.GetColour is an alternate spelling for RGB.GetColor.

Status   Exported qualified.

This means that you can only call the function by calling RGB.GetColor, not by calling GetColor.

See also   RGB.SetColorand RGB.AddColor.