Class: Styles::Properties::MatchBackgroundColor
- Defined in:
- lib/styles/properties/match_background_color.rb
Constant Summary collapse
- COLOR_PROPERTY_TYPE =
:match
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#colors, #initialize, multiple_names?, names, other_names, sub_engine, sub_engines, to_sym
Constructor Details
This class inherits a constructor from Styles::Properties::Base
Instance Method Details
#color_to_use ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/styles/properties/match_background_color.rb', line 12 def color_to_use if value.is_a? Array value.map { |color| convert_to_background_color color } elsif value.is_a? Symbol convert_to_background_color value end end |
#valid_value? ⇒ Boolean
8 9 10 |
# File 'lib/styles/properties/match_background_color.rb', line 8 def valid_value? [value].flatten.all? { |color| colors.is_basic_color?(color) || color == :none } end |