Class: Wx::Colour

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/classes/colour.rb

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object

Colours are equal to one another if they have the same red, green and blue intensity, and the same alpha



35
36
37
38
39
40
41
42
43
# File 'lib/wx/classes/colour.rb', line 35

def ==(other)
  case other
  when Wx::Colour
    [  self.red,  self.green,  self.blue,  self.alpha ] == 
    [ other.red, other.green, other.blue, other.alpha ]
  else
    false
  end
end

#to_sObject

More informative output for inspect etc



46
47
48
# File 'lib/wx/classes/colour.rb', line 46

def to_s
  "#<Wx::Colour: (#{red}, #{green}, #{blue} *#{alpha})>"
end