Method: Color#initialize

Defined in:
lib/RGSS.rb

#initialize(bytes, g = nil, b = nil) ⇒ Color

Returns a new instance of Color.



75
76
77
78
79
80
81
82
83
84
85
# File 'lib/RGSS.rb', line 75

def initialize(bytes, g = nil, b = nil)
  # massive hack to support triple param color
  if g && b
    @r = bytes
    @g = g
    @b = b
    @a = 255
  else
    @r, @g, @b, @a = *bytes.unpack('D4')
  end
end