In Files

Parent

Color

A Color object defines a colour in the RGB (Red, Green, Blue) colour space with optional Alpha (opacity/transparency). Color objects are used by most objects that draw to the GUI, including Pens, Brushes and text.

Public Class Methods

new(brightness) → Color click to toggle source
new(red, green, blue) → Color
new(alpha, red, green, blue) → Color

Creates a new Color object with the given parameters. All values are integers (Fixnums) in the range 0 to 255.

If only one argument is given, a monochrome (grey) is created where the red, green and blue values are all the same - from 0 (black) through to white (255). Alpha is set to 255 (totally opaque).

If three arguments are given, they specify the red, green and blue levels in that order. Alpha is set to 255 (totally opaque).

If four are given, the alpha is set first followed by red, green and blue. Alpha sets the opacity of the color from completely transparent (0) through to totally opaque (255).

# File GUI_Classes.rb, line 25
def self.new
  #DUMMY
end

Public Instance Methods

getARGB → Array click to toggle source

Returns an Array of four integers that give the Alpha, Red, Green and Blue components of the color in that order. All values are from 0 to 255.

# File GUI_Classes.rb, line 35
def getARGB
  #DUMMY
end
setARGB(alpha, red, green, blue) → Color click to toggle source

Changes the colour components of an exisiting Color object. Unlike creating a new color, all four values must always be given - all integers from 0 to 255. This may be useful if you wish to avoid the overheads of allocating memory for a new object, or garbage collecting an old one.

The changed Color object is returned.

# File GUI_Classes.rb, line 50
def setARBG
  #DUMMY
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.