Class: RainbowColors::Scheme

Inherits:
Object
  • Object
show all
Defined in:
lib/rainbow_colors/scheme.rb

Instance Method Summary collapse

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

#analogousObject



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

#complementaryObject



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_splitObject



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

#shadesObject



38
39
40
# File 'lib/rainbow_colors/scheme.rb', line 38

def shades
  shades_tints "#424242"
end

#tintsObject



34
35
36
# File 'lib/rainbow_colors/scheme.rb', line 34

def tints
  shades_tints "#FAFAFA"
end

#triadObject



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