Module: Cura::Attributes::HasColors
Overview
Adds the #foreground and #background attributes. TODO: Should be color and background… HasBackground and HasColor
Instance Method Summary collapse
-
#background ⇒ Color
Get the background color of this object.
-
#background=(value) ⇒ Color
Set the background color of this object.
-
#foreground ⇒ Color
Get the foreground color of this object.
-
#foreground=(value) ⇒ Color
Set the foreground color of this object.
- #initialize(attributes = {}) ⇒ Object
Methods included from HasAttributes
Instance Method Details
#background ⇒ Color
Get the background color of this object.
|
# File 'lib/cura/attributes/has_colors.rb', line 38
|
#background=(value) ⇒ Color
Set the background color of this object.
49 |
# File 'lib/cura/attributes/has_colors.rb', line 49 attribute(:background) { |value| validate_color_attribute(value) } |
#foreground ⇒ Color
Get the foreground color of this object.
|
# File 'lib/cura/attributes/has_colors.rb', line 25
|
#foreground=(value) ⇒ Color
Set the foreground color of this object.
36 |
# File 'lib/cura/attributes/has_colors.rb', line 36 attribute(:foreground) { |value| validate_color_attribute(value) } |
#initialize(attributes = {}) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/cura/attributes/has_colors.rb', line 18 def initialize(attributes={}) @foreground = :inherit unless instance_variable_defined?(:@foreground) @background = :inherit unless instance_variable_defined?(:@background) super end |