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

Chapter 17. Colors > Class RGB

17.1. Class RGB

The simplest color-related class in SWT is RGB. Instances of this class are descriptions of particular abstract colors, represented as three 8-bit quantities modeling the red, green, and blue components of the color.[1] This is less accuracy than would be required by some high-end photo applications, but it is fine for almost all other uses. There is no operating system storage associated with RGB; thus, instances do not have a dispose() method. They have no interesting API, only a constructor that sets the public fields, which are subsequently accessed directly.

[1] This is typically called the primary additive color model. The color being represented is the color that would result if the light from three sources, one red, one green, and one blue, with intensities relative to the given values, were mixed together.

RGB(int red, int green, int blue) Constructs a new instance of RGB that has its red, green, and blue fields set to the given values.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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