Module: ActiveFrontendHelper

Defined in:
app/helpers/active_frontend_helper.rb

Instance Method Summary collapse

Instance Method Details

#colors(opacity = 1) ⇒ Object



54
55
56
# File 'app/helpers/active_frontend_helper.rb', line 54

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

#colors_brand(opacity = 1) ⇒ Object

rubocop:disable Metrics/MethodLength



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/helpers/active_frontend_helper.rb', line 6

def colors_brand(opacity = 1)
  {
    lime: { rgba: "rgba(122,197,61,#{opacity})", hex: '#7ac53d' },
    green: { rgba: "rgba(76,188,52,#{opacity})", hex: '#4cbc34' },
    teal: { rgba: "rgba(30,205,147,#{opacity})", hex: '#1ecd93' },
    sky: { rgba: "rgba(0,165,255,#{opacity})", hex: '#00a5ff' },
    blue: { rgba: "rgba(22,126,255,#{opacity})", hex: '#167eff' },
    indigo: { rgba: "rgba(128,95,235,#{opacity})", hex: '#805feb' },
    purple: { rgba: "rgba(157,94,213,#{opacity})", hex: '#9d5ed5' },
    brown: { rgba: "rgba(145,101,73,#{opacity})", hex: '#916549' },
    pink: { rgba: "rgba(232,101,118,#{opacity})", hex: '#e86576' },
    red: { rgba: "rgba(244,53,67,#{opacity})", hex: '#f43543' },
    orange: { rgba: "rgba(252,131,35,#{opacity})", hex: '#fc8323' },
    yellow: { rgba: "rgba(245,202,9,#{opacity})", hex: '#f5ca09' }
  }
end

#colors_global(opacity = 1) ⇒ Object

rubocop:enable Metrics/MethodLength



43
44
45
46
47
48
49
50
51
52
# File 'app/helpers/active_frontend_helper.rb', line 43

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



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'app/helpers/active_frontend_helper.rb', line 23

def colors_grayscale(opacity = 1)
  {
    light_black: { rgba: "rgba(17,42,62,#{opacity})", hex: '#112a3e' },
    black: { rgba: "rgba(13,32,47,#{opacity})", hex: '#0d202f' },
    dark_black: { rgba: "rgba(9,22,32,#{opacity})", hex: '#091620' },
    light_slate: { rgba: "rgba(55,78,98,#{opacity})", hex: '#374e62' },
    slate: { rgba: "rgba(48,68,85,#{opacity})", hex: '#304455' },
    dark_slate: { rgba: "rgba(41,58,72,#{opacity})", hex: '#293a48' },
    light_gray: { rgba: "rgba(113,129,142,#{opacity})", hex: '#71818e' },
    gray: { rgba: "rgba(105,119,131,#{opacity})", hex: '#697783' },
    dark_gray: { rgba: "rgba(96,109,120,#{opacity})", hex: '#606d78' },
    light_haze: { rgba: "rgba(247,248,253,#{opacity})", hex: '#f7f8fd' },
    haze: { rgba: "rgba(238,241,250,#{opacity})", hex: '#edf0f9' },
    dark_haze: { rgba: "rgba(237,240,249,#{opacity})", hex: '#e4e9f4' },
    white: { rgba: "rgba(255,255,255,#{opacity})", hex: '#ffffff' },
    transparent: { rgba: 'rgba(0,0,0,0)', hex: '#ffffff' }
  }
end