class interface RGB_COLOR

creation
   white

   black

   dark_red

   dark_green

   dark_yellow

   dark_blue

   dark_magenta

   dark_cyan

   money_green

   sky_blue

   cream

   light_gray

   light_grey

   medium_gray

   medium_grey

   dark_gray

   dark_grey

   normal_red

   normal_green

   normal_blue

   yellow

   magenta

   cyan

   rgb (r, g, b: INTEGER)
      --  Set RGB colour components. On palletised displays, the colour will be 
      --  dithered from the standard colours above (e.g. from 20 colours, even on 
      --  a 256 colour palettised display). On the other hand, the colour will not 
      --  change when the palette is changed. To use a wider range of colours a 
      --  palette must be used in association with RGB_PALETTE_COLOR.

      require
         valid_values: valid_rgb(r,g,b)
      ensure
         done: red = r and green = g and blue = b

   from_string (str: STRING)
      --  Init object from string.

      require
         valid: str /= Void
      ensure
         done:  --  success implies to_string.is_equal(str)

feature(s) from P_TEXT_OBJECT
   --  Public interface

   to_string: STRING
      ensure
         is_copy: Result /= Void

   from_string (str: STRING)
      --  Init object from string.

      require
         valid: str /= Void
      ensure
         done:  --  success implies to_string.is_equal(str)

feature(s) from RGB_COLOR
   --  Standard colours. Always available (even when palette changed).

   white

   black

   dark_red

   dark_green

   dark_yellow

   dark_blue

   dark_magenta

   dark_cyan

   light_gray

   light_grey

   money_green

   sky_blue

   cream

   medium_gray

   medium_grey

   dark_gray

   dark_grey

   normal_red

   normal_green

   yellow

   normal_blue

   magenta

   cyan

feature(s) from RGB_COLOR
   --  RGB

   valid_rgb (r, g, b: INTEGER): BOOLEAN
      --  Valid rgb values within [0-255].


   rgb (r, g, b: INTEGER)
      --  Set RGB colour components. On palletised displays, the colour will be 
      --  dithered from the standard colours above (e.g. from 20 colours, even on 
      --  a 256 colour palettised display). On the other hand, the colour will not 
      --  change when the palette is changed. To use a wider range of colours a 
      --  palette must be used in association with RGB_PALETTE_COLOR.

      require
         valid_values: valid_rgb(r,g,b)
      ensure
         done: red = r and green = g and blue = b

feature(s) from RGB_COLOR
   --  RGB Components

   red: INTEGER

feature(s) from RGB_COLOR
   --  RGB Components

   green: INTEGER

feature(s) from RGB_COLOR
   --  RGB Components

   blue: INTEGER

invariant
   valid_rgb: valid_rgb(red,green,blue);

end of RGB_COLOR