Class: Shoes::Swt::Color
- Inherits:
-
Object
- Object
- Shoes::Swt::Color
- Includes:
- DisposedProtection
- Defined in:
- shoes-swt/lib/shoes/swt/color.rb
Instance Attribute Summary collapse
-
#dsl ⇒ Object
readonly
Returns the value of attribute dsl.
Class Method Summary collapse
Instance Method Summary collapse
-
#alpha ⇒ Integer
The alpha value, from 0 (transparent) to 255 (opaque).
-
#apply_as_fill(gc, _dsl = nil) ⇒ Object
_dsl unused by this method, passed to satisfy the Pattern interface.
-
#apply_as_stroke(gc, _dsl = nil) ⇒ Object
_dsl unused by this method, passed to satisfy the Pattern interface.
- #dispose ⇒ Object
-
#initialize(color) ⇒ Color
constructor
A new instance of Color.
Methods included from DisposedProtection
Constructor Details
Instance Attribute Details
#dsl ⇒ Object (readonly)
Returns the value of attribute dsl.
22 23 24 |
# File 'shoes-swt/lib/shoes/swt/color.rb', line 22 def dsl @dsl end |
Class Method Details
Instance Method Details
#alpha ⇒ Integer
Returns the alpha value, from 0 (transparent) to 255 (opaque).
25 26 27 |
# File 'shoes-swt/lib/shoes/swt/color.rb', line 25 def alpha @dsl.alpha end |
#apply_as_fill(gc, _dsl = nil) ⇒ Object
_dsl unused by this method, passed to satisfy the Pattern interface
31 32 33 34 |
# File 'shoes-swt/lib/shoes/swt/color.rb', line 31 def apply_as_fill(gc, _dsl = nil) gc.set_background real gc.set_alpha alpha end |
#apply_as_stroke(gc, _dsl = nil) ⇒ Object
_dsl unused by this method, passed to satisfy the Pattern interface
38 39 40 41 |
# File 'shoes-swt/lib/shoes/swt/color.rb', line 38 def apply_as_stroke(gc, _dsl = nil) gc.set_foreground real gc.set_alpha alpha end |
#dispose ⇒ Object
18 19 20 |
# File 'shoes-swt/lib/shoes/swt/color.rb', line 18 def dispose real.dispose end |