Class: Shoes::Swt::Gradient
- Inherits:
-
Object
- Object
- Shoes::Swt::Gradient
- Includes:
- Common::Remove
- Defined in:
- shoes-swt/lib/shoes/swt/gradient.rb
Instance Method Summary collapse
- #alpha ⇒ Object
- #apply_as_fill(gc, dsl) ⇒ Object
- #apply_as_stroke(gc, dsl) ⇒ Object
- #color1 ⇒ Object
- #color2 ⇒ Object
- #dispose ⇒ Object
-
#initialize(dsl) ⇒ Gradient
constructor
A new instance of Gradient.
Methods included from Common::Remove
Constructor Details
#initialize(dsl) ⇒ Gradient
Returns a new instance of Gradient.
19 20 21 22 23 24 |
# File 'shoes-swt/lib/shoes/swt/gradient.rb', line 19 def initialize(dsl) @dsl = dsl @patterns = [] @color1 = nil @color2 = nil end |
Instance Method Details
#alpha ⇒ Object
43 44 45 |
# File 'shoes-swt/lib/shoes/swt/gradient.rb', line 43 def alpha @dsl.alpha end |
#apply_as_fill(gc, dsl) ⇒ Object
47 48 49 50 |
# File 'shoes-swt/lib/shoes/swt/gradient.rb', line 47 def apply_as_fill(gc, dsl) pattern = create_pattern(dsl) gc.set_background_pattern pattern end |
#apply_as_stroke(gc, dsl) ⇒ Object
52 53 54 55 |
# File 'shoes-swt/lib/shoes/swt/gradient.rb', line 52 def apply_as_stroke(gc, dsl) pattern = create_pattern(dsl) gc.set_foreground_pattern pattern end |
#color1 ⇒ Object
35 36 37 |
# File 'shoes-swt/lib/shoes/swt/gradient.rb', line 35 def color1 @color1 ||= Color.create @dsl.color1 end |