Sha256: 95e3d079453b86d980ab6cfe0799d7b32ffe546892896922604fd0e69f4a75bb

Contents?: true

Size: 490 Bytes

Versions: 1

Compression:

Stored size: 490 Bytes

Contents

class RColor
  attr_reader :display
  attr_reader :color

  include_package 'org.eclipse.swt.graphics'

  class << self
    def for(display, standard_color)
      standard_color_swt_constant = org.eclipse.swt.SWT.const_get(standard_color.to_s.upcase.to_sym)
      display.getSystemColor(standard_color_swt_constant)
    end
  end

  def initialize(display, red, green, blue, alpha = nil)
    @display = display
    @color = Color.new(@display, *[red, green, blue, alpha].compact)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
glimmer-0.3.3 lib/command_handlers/models/r_color.rb