Class: Jpeg::Color
- Inherits:
-
Struct
- Object
- Struct
- Jpeg::Color
- Defined in:
- lib/jpeg/color.rb
Instance Attribute Summary collapse
-
#b ⇒ Object
Returns the value of attribute b.
-
#g ⇒ Object
Returns the value of attribute g.
-
#r ⇒ Object
Returns the value of attribute r.
Instance Method Summary collapse
- #inspect ⇒ Object
- #rgb ⇒ Object (also: #to_a)
- #to_s ⇒ Object
Instance Attribute Details
#b ⇒ Object
Returns the value of attribute b
2 3 4 |
# File 'lib/jpeg/color.rb', line 2 def b @b end |
#g ⇒ Object
Returns the value of attribute g
2 3 4 |
# File 'lib/jpeg/color.rb', line 2 def g @g end |
#r ⇒ Object
Returns the value of attribute r
2 3 4 |
# File 'lib/jpeg/color.rb', line 2 def r @r end |
Instance Method Details
#inspect ⇒ Object
12 13 14 |
# File 'lib/jpeg/color.rb', line 12 def inspect format '<Jpeg::Color r=0x%02x g=0x%02x b=0x%02x>', *rgb end |
#rgb ⇒ Object Also known as: to_a
3 4 5 |
# File 'lib/jpeg/color.rb', line 3 def rgb [r, g, b] end |
#to_s ⇒ Object
8 9 10 |
# File 'lib/jpeg/color.rb', line 8 def to_s format '#%02x%02x%02x', *rgb end |