Sha256: b72d7dc53c43107cba50a1a7b2ba463cde1267f0f1d3dd7c2fbbdfbf62d37430

Contents?: true

Size: 412 Bytes

Versions: 42

Compression:

Stored size: 412 Bytes

Contents

class UIColor

  def to_s
    return super unless self.respond_to?(:alpha)

    alpha_s = ((alpha || 1) < 1 ? "(#{alpha})" : '')
    if system_name
      return "UIColor.#{system_name}#{alpha_s.length > 0 ? '.colorWithAlphaComponent' + alpha_s : ''}"
    elsif css_name
      return ":#{css_name}.uicolor#{alpha_s}"
    elsif hex
      return "'#{hex}'.uicolor#{alpha_s}"
    else
      super
    end
  end

end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
sugarcube-3.0.4 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-3.0.3 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-3.0.2 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-3.0.1 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-3.0.0 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-2.12.3 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-2.12.2 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-2.12.1 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-2.12.0 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-2.11.1 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-2.11.0 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-2.10.0 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-2.9.1 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-2.8.2 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-2.8.1 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-2.8.0 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-2.7.1 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-2.7.0 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-2.6.0 lib/ios/sugarcube-to_s/uicolor.rb
sugarcube-2.5.0 lib/ios/sugarcube-to_s/uicolor.rb