Class: Avo::Configuration::Branding
- Inherits:
-
Object
- Object
- Avo::Configuration::Branding
- Defined in:
- lib/avo/configuration/branding.rb
Instance Method Summary collapse
- #chart_colors ⇒ Object
- #css_colors ⇒ Object
-
#initialize(colors: nil, chart_colors: nil, logo: nil, logomark: nil) ⇒ Branding
constructor
A new instance of Branding.
- #logo ⇒ Object
- #logomark ⇒ Object
Constructor Details
#initialize(colors: nil, chart_colors: nil, logo: nil, logomark: nil) ⇒ Branding
Returns a new instance of Branding.
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/avo/configuration/branding.rb', line 2 def initialize(colors: nil, chart_colors: nil, logo: nil, logomark: nil) @colors = colors @chart_colors = chart_colors @logo = logo @logomark = logomark @default_colors = { background: "#F6F6F7", 100 => "206 231 248", 400 => "57 158 229", 500 => "8 134 222", 600 => "6 107 178" } @default_chart_colors = ["#0B8AE2", "#34C683", "#2AB1EE", "#34C6A8"] @default_logo = "/avo-assets/logo.png" @default_logomark = "/avo-assets/logomark.png" end |
Instance Method Details
#chart_colors ⇒ Object
42 43 44 45 46 |
# File 'lib/avo/configuration/branding.rb', line 42 def chart_colors return @default_chart_colors if Avo::App.license.lacks_with_trial(:branding) @chart_colors || @default_chart_colors end |
#css_colors ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/avo/configuration/branding.rb', line 20 def css_colors rgb_colors.map do |color, value| if color == :background "--color-application-#{color}: #{value};" else "--color-primary-#{color}: #{value};" end end.join("\n") end |