Class: Colour
- Inherits:
-
Object
- Object
- Colour
- Defined in:
- mrb_doc/models/colour.rb
Overview
The Colour class is used for setting the colour of basic primatives (Circle, Rectangle, etc) but also for setting transparency on Texture2D objects.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Compares the values of two Colours.
-
#initialize(red, green, blue, alpha) ⇒ Colour
constructor
Creates a new instance of Colour.
-
#to_h ⇒ Hash
Return the object represented by a Hash.
Constructor Details
Instance Attribute Details
#alpha ⇒ Integer
59 60 61 |
# File 'mrb_doc/models/colour.rb', line 59 def alpha @alpha end |
#blue ⇒ Integer
59 60 61 |
# File 'mrb_doc/models/colour.rb', line 59 def blue @blue end |
#green ⇒ Integer
59 60 61 |
# File 'mrb_doc/models/colour.rb', line 59 def green @green end |
#red ⇒ Integer
59 60 61 |
# File 'mrb_doc/models/colour.rb', line 59 def red @red end |
Instance Method Details
#==(other) ⇒ Boolean
Compares the values of two Colours
100 101 102 103 104 105 106 |
# File 'mrb_doc/models/colour.rb', line 100 def ==(other) # src/mruby_integration/models/colour.cpp self.red == other.red && self.green == other.green && self.blue == other.blue && self.alpha == other.alpha end |
#to_h ⇒ Hash
Return the object represented by a Hash
110 111 112 113 114 115 116 117 118 |
# File 'mrb_doc/models/colour.rb', line 110 def to_h # src/mruby_integration/models/colour.cpp { red: red, green: green, blue: blue, alpha: alpha, } end |