Sha256: dbf36ee7ad6221cb6fc8d23760a8d74d1c662a5027c42c0bde424294d7575e1f
Contents?: true
Size: 519 Bytes
Versions: 2
Compression:
Stored size: 519 Bytes
Contents
class Shoes class Gradient include Common::Inspect include Comparable def initialize(color1, color2, alpha = Shoes::Color::OPAQUE) @color1 = color1 @color2 = color2 @alpha = alpha end attr_reader :alpha, :color1, :color2 def <=>(other) # arbitrarily compare 1st non-equal color return unless other.is_a?(self.class) [color1, color2] <=> [other.color1, other.color2] end private def inspect_details " #{color1}->#{color2}" end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
shoes-core-4.0.0.pre8 | lib/shoes/gradient.rb |
shoes-core-4.0.0.pre7 | lib/shoes/gradient.rb |