• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 14. Dialogs > ColorDialog

14.7. ColorDialog

ColorDialog allows the user to select a color from a predefined color palette. Like the other built-in platform dialogs, color dialogs vary wildly in appearance across platforms. Some dialogs allow the user to choose a color from a color wheel or grid. Others offer an area for the user to enter integers to be used as color values. Some offer both.

Instances of class RGB are used to model device-independent red-green-blue color values. Instances of class Color are the result of allocating these red-green-blue values on a particular device.[1] Although it may seem counter-intuitive, ColorDialog uses RGB objects instead of Color objects. This makes the ColorDialog API consistent with the rules for allocating and freeing resource-based SWT objects. Instead of returning an allocated color that the programmer would need to free, a ColorDialog returns an RGB object.

[1] For more on the classes RGB and Color, see the Colors chapter.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint