Class: Color

Inherits:
Object show all
Defined in:
lib/rmxp_extractor/classnames.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#alphaObject

Returns the value of attribute alpha.



92
93
94
# File 'lib/rmxp_extractor/classnames.rb', line 92

def alpha
  @alpha
end

#blueObject

Returns the value of attribute blue.



92
93
94
# File 'lib/rmxp_extractor/classnames.rb', line 92

def blue
  @blue
end

#greenObject

Returns the value of attribute green.



92
93
94
# File 'lib/rmxp_extractor/classnames.rb', line 92

def green
  @green
end

#redObject

Returns the value of attribute red.



92
93
94
# File 'lib/rmxp_extractor/classnames.rb', line 92

def red
  @red
end

Class Method Details

._load(data) ⇒ Object



98
99
100
101
102
# File 'lib/rmxp_extractor/classnames.rb', line 98

def self._load(data)
  obj = Color.new
  obj.red, obj.green, obj.blue, obj.alpha = *data.unpack("d4")
  obj
end

Instance Method Details

#_dump(limit) ⇒ Object



94
95
96
# File 'lib/rmxp_extractor/classnames.rb', line 94

def _dump(limit)
  [@red, @green, @blue, @alpha].pack("d4")
end