Class: Contrek::Bitmaps::RgbColor

Inherits:
Object
  • Object
show all
Defined in:
lib/contrek/bitmaps/rgb_color.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#rawObject (readonly)

Returns the value of attribute raw.



4
5
6
# File 'lib/contrek/bitmaps/rgb_color.rb', line 4

def raw
  @raw
end