class Color

Attributes

alpha[RW]
blue[RW]
green[RW]
red[RW]

Public Class Methods

_load(obj) click to toggle source
# File lib/rmxp_extractor/classnames.rb, line 24
def self._load(obj)
  data = *obj.unpack("EEEE")
  s_hash = {
    red: data[0],
    green: data[1],
    blue: data[2],
    alpha: data[3],
  }
  hash = {}
  s_hash.each do |key, value|
    hash[key.to_s] = value
  end
  Color.new hash
end
new(hash) click to toggle source
# File lib/rmxp_extractor/classnames.rb, line 4
def initialize(hash)
  @red = hash["red"]
  @green = hash["green"]
  @blue = hash["blue"]
  @alpha = hash["alpha"]
end

Public Instance Methods

_dump(limit) click to toggle source
# File lib/rmxp_extractor/classnames.rb, line 20
def _dump(limit)
  [@red, @green, @blue, @alpha].pack("EEEE")
end
hash() click to toggle source
# File lib/rmxp_extractor/classnames.rb, line 11
def hash
  dump = {
    red: @red,
    green: @green,
    blue: @blue,
    alpha: @alpha,
  }
end