Module: ActiveFrontendHelper

Defined in:
app/helpers/active_frontend_helper.rb

Instance Method Summary collapse

Instance Method Details

#colors(opacity = 1) ⇒ Object



58
59
60
61
62
# File 'app/helpers/active_frontend_helper.rb', line 58

def colors(opacity = 1)
  colors_global(opacity).merge(colors_base(opacity))
                        .merge(colors_brand(opacity))
                        .merge(colors_grayscale(opacity))
end

#colors_base(opacity = 1) ⇒ Object

rubocop:disable Metrics/MethodLength



6
7
8
9
10
11
12
13
# File 'app/helpers/active_frontend_helper.rb', line 6

def colors_base(opacity = 1)
  {
    black: { rgba: "rgba(16,37,51,#{opacity})", hex: '#102533' },
    steel: { rgba: "rgba(46,66,97,#{opacity})", hex: '#2e4261' },
    white: { rgba: "rgba(255,255,255,#{opacity})", hex: '#ffffff' },
    transparent: { rgba: 'rgba(0,0,0,0)', hex: '#ffffff' }
  }
end

#colors_brand(opacity = 1) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/helpers/active_frontend_helper.rb', line 15

def colors_brand(opacity = 1)
  {
    lime: { rgba: "rgba(171,189,49,#{opacity})", hex: '#abbd31' },
    green: { rgba: "rgba(72,197,54,#{opacity})", hex: '#48c536' },
    teal: { rgba: "rgba(39,196,144,#{opacity})", hex: '#27c490' },
    sky: { rgba: "rgba(45,166,255,#{opacity})", hex: '#2da6ff' },
    blue: { rgba: "rgba(0,123,255,#{opacity})", hex: '#007bff' },
    indigo: { rgba: "rgba(134,96,254,#{opacity})", hex: '#8660fe' },
    purple: { rgba: "rgba(187,100,250,#{opacity})", hex: '#bb64fa' },
    brown: { rgba: "rgba(128,88,78,#{opacity})", hex: '#80584e' },
    pink: { rgba: "rgba(245,112,129,#{opacity})", hex: '#f57081' },
    red: { rgba: "rgba(239,46,67,#{opacity})", hex: '#ef2e43' },
    orange: { rgba: "rgba(247,115,55,#{opacity})", hex: '#f77337' },
    yellow: { rgba: "rgba(245,200,40,#{opacity})", hex: '#f5c828' }
  }
end

#colors_global(opacity = 1) ⇒ Object

rubocop:enable Metrics/MethodLength



47
48
49
50
51
52
53
54
55
56
# File 'app/helpers/active_frontend_helper.rb', line 47

def colors_global(opacity = 1)
  available_colors = colors_brand(opacity)

  {
    primary: available_colors[:blue],
    secondary: available_colors[:green],
    tertiary: available_colors[:red],
    quaditiary: available_colors[:yellow]
  }
end

#colors_grayscale(opacity = 1) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'app/helpers/active_frontend_helper.rb', line 32

def colors_grayscale(opacity = 1)
  {
    light_slate: { rgba: "rgba(40,63,92,#{opacity})", hex: '#283f5c' },
    slate: { rgba: "rgba(34,54,78,#{opacity})", hex: '#22364e' },
    dark_slate: { rgba: "rgba(28,45,64,#{opacity})", hex: '#1c2d40' },
    light_gray: { rgba: "rgba(171,189,212,#{opacity})", hex: '#abbdd4' },
    gray: { rgba: "rgba(158,179,205,#{opacity})", hex: '#9eb3cd' },
    dark_gray: { rgba: "rgba(145,169,198,#{opacity})", hex: '#91a9c6' },
    light_haze: { rgba: "rgba(246,248,252,#{opacity})", hex: '#f6f8fc' },
    haze: { rgba: "rgba(234,239,250,#{opacity})", hex: '#eaeffa' },
    dark_haze: { rgba: "rgba(223,230,246,#{opacity})", hex: '#dfe6f6' }
  }
end