Class: RGBUtils::ComplexContrastColorResolver
- Defined in:
- lib/rgb_utils/resolvers/complex_contrast_color_resolver.rb
Instance Method Summary collapse
- #for ⇒ Object
-
#initialize(color, options = {}) ⇒ ComplexContrastColorResolver
constructor
A new instance of ComplexContrastColorResolver.
Methods inherited from Resolver
Constructor Details
#initialize(color, options = {}) ⇒ ComplexContrastColorResolver
Returns a new instance of ComplexContrastColorResolver.
3 4 5 6 7 |
# File 'lib/rgb_utils/resolvers/complex_contrast_color_resolver.rb', line 3 def initialize(color, = {}) @color = color @light_color = .fetch(:light_color, Config.light_color) @dark_color = .fetch(:dark_color, Config.dark_color) end |
Instance Method Details
#for ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/rgb_utils/resolvers/complex_contrast_color_resolver.rb', line 9 def for @result ||= begin return dark_color if luminance > luminance_cutoff light_color end end |