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
# File 'lib/wx/classes/colour.rb', line 35

def ==(other)
  if not other.is_a?(self.class)
    raise ArgumentError, "No comparison of #{self} to #{other}"
  end
  [ red, green, blue, alpha ] == 
    [ other.red, other.green, other.blue, other.alpha ]
end

#to_sObject

More informative output for inspect etc



44
45
46
# File 'lib/wx/classes/colour.rb', line 44

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