Sha256: a744fff817784e6d71a0b4fc4317f4eb47332f80b3cc9955f84b57699b3409a3

Contents?: true

Size: 324 Bytes

Versions: 16

Compression:

Stored size: 324 Bytes

Contents

module Clevic

class Field
  # Convert something that responds to to_s into a Qt::Color,
  # or just return the argument if it's already a Qt::Color
  def string_or_color( s_or_c )
    case s_or_c
    when NilClass
      nil
    when Qt::Color
      s_or_c
    else
      Qt::Color.new( s_or_c.to_s )
    end
  end
end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
clevic-0.14.6 lib/clevic/qt/field.rb
clevic-0.14.5 lib/clevic/qt/field.rb
clevic-0.14.4 lib/clevic/qt/field.rb
clevic-0.14.3 lib/clevic/qt/field.rb
clevic-0.14.2 lib/clevic/qt/field.rb
clevic-0.14.1 lib/clevic/qt/field.rb
clevic-0.14.0 lib/clevic/qt/field.rb
clevic-0.13.0.b12 lib/clevic/qt/field.rb
clevic-0.13.0.b11 lib/clevic/qt/field.rb
clevic-0.13.0.b10 lib/clevic/qt/field.rb
clevic-0.13.0.b9 lib/clevic/qt/field.rb
clevic-0.13.0.b6 lib/clevic/qt/field.rb
clevic-0.13.0.b5 lib/clevic/qt/field.rb
clevic-0.13.0.b3 lib/clevic/qt/field.rb
clevic-0.13.0.b2 lib/clevic/qt/field.rb
clevic-0.13.0.b1 lib/clevic/qt/field.rb