Class: SwfRuby::Swf::Rgba
- Inherits:
-
Object
- Object
- SwfRuby::Swf::Rgba
- Defined in:
- lib/swf_ruby/swf/rgba.rb
Instance Attribute Summary collapse
-
#alpha ⇒ Object
Returns the value of attribute alpha.
-
#blue ⇒ Object
Returns the value of attribute blue.
-
#green ⇒ Object
Returns the value of attribute green.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#red ⇒ Object
Returns the value of attribute red.
Instance Method Summary collapse
-
#initialize(bytearray) ⇒ Rgba
constructor
A new instance of Rgba.
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
#alpha ⇒ Object
Returns the value of attribute alpha.
9 10 11 |
# File 'lib/swf_ruby/swf/rgba.rb', line 9 def alpha @alpha end |
#blue ⇒ Object
Returns the value of attribute blue.
8 9 10 |
# File 'lib/swf_ruby/swf/rgba.rb', line 8 def blue @blue end |
#green ⇒ Object
Returns the value of attribute green.
7 8 9 |
# File 'lib/swf_ruby/swf/rgba.rb', line 7 def green @green end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
10 11 12 |
# File 'lib/swf_ruby/swf/rgba.rb', line 10 def length @length end |
#red ⇒ Object
Returns the value of attribute red.
6 7 8 |
# File 'lib/swf_ruby/swf/rgba.rb', line 6 def red @red end |