Class: RainbowColors::Scheme
- Inherits:
-
Object
- Object
- RainbowColors::Scheme
- Defined in:
- lib/rainbow_colors/scheme.rb
Instance Method Summary collapse
- #analogous ⇒ Object
- #complementary ⇒ Object
- #complementary_split ⇒ Object
-
#initialize(primary_color_hex) ⇒ Scheme
constructor
A new instance of Scheme.
- #shades ⇒ Object
- #tints ⇒ Object
- #triad ⇒ Object
Constructor Details
#initialize(primary_color_hex) ⇒ Scheme
Returns a new instance of Scheme.
3 4 5 |
# File 'lib/rainbow_colors/scheme.rb', line 3 def initialize(primary_color_hex) @primary_color = primary_color_hex end |
Instance Method Details
#analogous ⇒ Object
7 8 9 10 11 12 |
# File 'lib/rainbow_colors/scheme.rb', line 7 def analogous secondary = color_with_variance 30 tertiary = color_with_variance -30 [@primary_color, secondary, tertiary] end |
#complementary ⇒ Object
14 15 16 17 18 |
# File 'lib/rainbow_colors/scheme.rb', line 14 def complementary secondary = color_with_variance 180 [@primary_color, secondary] end |
#complementary_split ⇒ Object
20 21 22 23 24 25 |
# File 'lib/rainbow_colors/scheme.rb', line 20 def complementary_split secondary = color_with_variance 150 tertiary = color_with_variance 210 [@primary_color, secondary, tertiary] end |
#shades ⇒ Object
38 39 40 |
# File 'lib/rainbow_colors/scheme.rb', line 38 def shades shades_tints "#424242" end |
#tints ⇒ Object
34 35 36 |
# File 'lib/rainbow_colors/scheme.rb', line 34 def tints shades_tints "#FAFAFA" end |
#triad ⇒ Object
27 28 29 30 31 32 |
# File 'lib/rainbow_colors/scheme.rb', line 27 def triad secondary = color_with_variance 120 tertiary = color_with_variance -120 [@primary_color, secondary, tertiary] end |