Class: SwfRuby::Swf::Rgba

Inherits:
Object
  • Object
show all
Defined in:
lib/swf_ruby/swf/rgba.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bytearray) ⇒ Rgba

Returns a new instance of Rgba.



12
13
14
15
16
17
18
19
# File 'lib/swf_ruby/swf/rgba.rb', line 12

def initialize(bytearray)
  @red = bytearray[0, 1].unpack("C").first
  @green = bytearray[1, 1].unpack("C").first
  @blue = bytearray[2, 1].unpack("C").first
  @alpha = bytearray[3, 1].unpack("C").first
  @length = 4
  self
end

Instance Attribute Details

#alphaObject

Returns the value of attribute alpha.



9
10
11
# File 'lib/swf_ruby/swf/rgba.rb', line 9

def alpha
  @alpha
end

#blueObject

Returns the value of attribute blue.



8
9
10
# File 'lib/swf_ruby/swf/rgba.rb', line 8

def blue
  @blue
end

#greenObject

Returns the value of attribute green.



7
8
9
# File 'lib/swf_ruby/swf/rgba.rb', line 7

def green
  @green
end

#lengthObject (readonly)

Returns the value of attribute length.



10
11
12
# File 'lib/swf_ruby/swf/rgba.rb', line 10

def length
  @length
end

#redObject

Returns the value of attribute red.



6
7
8
# File 'lib/swf_ruby/swf/rgba.rb', line 6

def red
  @red
end