To specify a color by its red, green, and blue (RGB) intensities, send the red:green:blue: message to
CgRGBColor with integer arguments specifying the intensities of the red, green, and blue components of the color. The values range between 0 and 65535. Higher values add more of the color to the color mix. Lower values specify less color in the color mix. In the following example,
color1 specifies 50% gray and
color2 specifies bright magenta.
The intensity: class method of
CgRGBColor creates a gray-scale color, where the red, green, and blue intensities have the same value. In the following example,
color1 and
color2 are equivalent:
The black and
white class methods of
CgRGBColor answer preexisting instances of
CgRGBColor representing black (all intensities = 0) and white (all intensities = 65535), respectively.