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 36
|
#background=(value) ⇒ Color
Set the background color of this object.
47 |
# File 'lib/cura/attributes/has_colors.rb', line 47 attribute(:background) { |value| validate_color_attribute(value) } |
#foreground ⇒ Color
Get the foreground color of this object.
|
# File 'lib/cura/attributes/has_colors.rb', line 23
|
#foreground=(value) ⇒ Color
Set the foreground color of this object.
34 |
# File 'lib/cura/attributes/has_colors.rb', line 34 attribute(:foreground) { |value| validate_color_attribute(value) } |
#initialize(attributes = {}) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/cura/attributes/has_colors.rb', line 16 def initialize(attributes={}) @foreground = :inherit unless instance_variable_defined?(:@foreground) @background = :inherit unless instance_variable_defined?(:@background) super end |