Class: Color
- Inherits:
-
Object
- Object
- Color
- Defined in:
- lib/RGSS.rb
Class Method Summary collapse
Instance Method Summary collapse
- #_dump(*ignored) ⇒ Object
-
#initialize(bytes, g = nil, b = nil) ⇒ Color
constructor
A new instance of Color.
Constructor Details
#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 |
Class Method Details
Instance Method Details
#_dump(*ignored) ⇒ Object
87 88 89 |
# File 'lib/RGSS.rb', line 87 def _dump(*ignored) return [@r, @g, @b, @a].pack('D4') end |