Class: Contrek::Bitmaps::RgbColor
- Inherits:
-
Object
- Object
- Contrek::Bitmaps::RgbColor
- Defined in:
- lib/contrek/bitmaps/rgb_color.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
-
#initialize(r:, g:, b:, a: 255) ⇒ RgbColor
constructor
A new instance of RgbColor.
Constructor Details
#initialize(r:, g:, b:, a: 255) ⇒ RgbColor
Returns a new instance of RgbColor.
5 6 7 |
# File 'lib/contrek/bitmaps/rgb_color.rb', line 5 def initialize(r:, g:, b:, a: 255) @raw = (r << 24) + (g << 16) + (b << 8) + a end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
4 5 6 |
# File 'lib/contrek/bitmaps/rgb_color.rb', line 4 def raw @raw end |