Class: RainbowColors::Scheme
- Inherits:
-
Object
- Object
- RainbowColors::Scheme
- Defined in:
- lib/rainbow_colors/scheme.rb
Class Method Summary collapse
- .analogous(base_color) ⇒ Object
- .complementary(base_color) ⇒ Object
- .complementary_split(base_color) ⇒ Object
- .harmonious_grays(base_color) ⇒ Object
- .shades(base_color) ⇒ Object
- .tints(base_color) ⇒ Object
- .triad(base_color) ⇒ Object
Class Method Details
.analogous(base_color) ⇒ Object
3 4 5 6 7 8 |
# File 'lib/rainbow_colors/scheme.rb', line 3 def self.analogous(base_color) secondary = color_with_variance 30, base_color tertiary = color_with_variance -30, base_color [base_color, secondary, tertiary] end |
.complementary(base_color) ⇒ Object
10 11 12 13 14 |
# File 'lib/rainbow_colors/scheme.rb', line 10 def self.complementary(base_color) secondary = color_with_variance 180, base_color [base_color, secondary] end |
.complementary_split(base_color) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/rainbow_colors/scheme.rb', line 16 def self.complementary_split(base_color) secondary = color_with_variance 150, base_color tertiary = color_with_variance 210, base_color [base_color, secondary, tertiary] end |
.harmonious_grays(base_color) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/rainbow_colors/scheme.rb', line 38 def self.harmonious_grays(base_color) weight = 90 colors = [] colors << mix("#424242", base_color, weight) colors << mix("#FAFAFA", base_color, weight) colors end |
.shades(base_color) ⇒ Object
34 35 36 |
# File 'lib/rainbow_colors/scheme.rb', line 34 def self.shades(base_color) shades_tints "#000000", base_color end |
.tints(base_color) ⇒ Object
30 31 32 |
# File 'lib/rainbow_colors/scheme.rb', line 30 def self.tints(base_color) shades_tints "#FFFFFF", base_color end |
.triad(base_color) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/rainbow_colors/scheme.rb', line 23 def self.triad(base_color) secondary = color_with_variance 120, base_color tertiary = color_with_variance -120, base_color [base_color, secondary, tertiary] end |