Sha256: d2cf8e434590ea8975a3fe871553c31cd70dff0c029cc6d7af07244ed326277f
Contents?: true
Size: 550 Bytes
Versions: 1
Compression:
Stored size: 550 Bytes
Contents
# frozen_string_literal: true 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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
shoes-core-4.0.0.rc1 | lib/shoes/gradient.rb |