Class: Shoes::Gradient
- Inherits:
-
Object
- Object
- Shoes::Gradient
- Includes:
- Comparable, Common::Inspect
- Defined in:
- shoes-core/lib/shoes/gradient.rb
Instance Attribute Summary collapse
-
#alpha ⇒ Object
readonly
Returns the value of attribute alpha.
-
#color1 ⇒ Object
readonly
Returns the value of attribute color1.
-
#color2 ⇒ Object
readonly
Returns the value of attribute color2.
Instance Method Summary collapse
-
#<=>(other) ⇒ Object
arbitrarily compare 1st non-equal color.
-
#initialize(color1, color2, alpha = Shoes::Color::OPAQUE) ⇒ Gradient
constructor
A new instance of Gradient.
Methods included from Common::Inspect
Constructor Details
Instance Attribute Details
#alpha ⇒ Object (readonly)
Returns the value of attribute alpha.
14 15 16 |
# File 'shoes-core/lib/shoes/gradient.rb', line 14 def alpha @alpha end |
#color1 ⇒ Object (readonly)
Returns the value of attribute color1.
14 15 16 |
# File 'shoes-core/lib/shoes/gradient.rb', line 14 def color1 @color1 end |
#color2 ⇒ Object (readonly)
Returns the value of attribute color2.
14 15 16 |
# File 'shoes-core/lib/shoes/gradient.rb', line 14 def color2 @color2 end |
Instance Method Details
#<=>(other) ⇒ Object
arbitrarily compare 1st non-equal color
16 17 18 19 |
# File 'shoes-core/lib/shoes/gradient.rb', line 16 def <=>(other) # arbitrarily compare 1st non-equal color return unless other.is_a?(self.class) [color1, color2] <=> [other.color1, other.color2] end |