Home Segments Index Top Previous Next

686: Sidetrip

The ColorConstants dictionary provides keys for common colors. If you need other colors, you can create your own by sending the red:green:blue: class method to the GraphicsTool class. The three arguments specify the intensity of red, green, and blue in the color, on a scale that ranges from 0 to 255. In the following example, the answer produced, 6553600, is a large integer that represents dark blue.

                  *-- Red intensity 
                  | 
                  |        *-- Green intensity 
                  |        | 
                  |        |        *-- Blue intensity 
                  |        |        | 
                  v        v        v 
GraphicsTool red: 0 green: 0 blue: 100