Sha256: db6b2c2c2f5f5d78271f5915ffd82903d7ed32d3013f73962775a232ede667cd
Contents?: true
Size: 954 Bytes
Versions: 4
Compression:
Stored size: 954 Bytes
Contents
require_relative 'g_swt' require_relative 'g_display' module Glimmer module SWT class GColor attr_reader :display, :red, :green, :blue, :alpha include_package 'org.eclipse.swt.graphics' class << self include_package 'org.eclipse.swt' def color_for(display = nil, standard_color) standard_color = "color_#{standard_color}".to_sym unless standard_color.to_s.include?('color_') display ||= GDisplay.instance.display display.getSystemColor(GSWT[standard_color]) end end def initialize(display, red, green, blue, alpha = nil) @display = display @red = red @green = green @blue = blue @alpha = alpha end def color @color ||= Color.new(@display, *[@red, @green, @blue, @alpha].compact) end def display=(a_display) @display = a_display @color = nil end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
glimmer-0.4.7 | lib/glimmer/swt/g_color.rb |
glimmer-0.4.6 | lib/glimmer/swt/g_color.rb |
glimmer-0.4.5 | lib/glimmer/swt/g_color.rb |
glimmer-0.4.4 | lib/glimmer/swt/g_color.rb |