Class: Color
- Inherits:
-
Object
- Object
- Color
- Defined in:
- lib/classes.rb
Class Method Summary collapse
Instance Method Summary collapse
- #_dump(*_ignored) ⇒ Object
-
#initialize(bytes) ⇒ Color
constructor
A new instance of Color.
Constructor Details
#initialize(bytes) ⇒ Color
Returns a new instance of Color.
37 38 39 |
# File 'lib/classes.rb', line 37 def initialize(bytes) @r, @g, @b, @a = *bytes.unpack('D4') end |
Class Method Details
._load(bytes) ⇒ Object
45 46 47 |
# File 'lib/classes.rb', line 45 def self._load(bytes) new(bytes) end |
Instance Method Details
#_dump(*_ignored) ⇒ Object
41 42 43 |
# File 'lib/classes.rb', line 41 def _dump(*_ignored) [@r, @g, @b, @a].pack('D4') end |