Method: Vic::ColorScheme#background!
- Defined in:
- lib/vic/color_scheme.rb
#background! ⇒ String
Sets the background automatically
By default this will return “dark”. If a highlight with the ‘group` “Normal” and a `guibg` setting has been added to the colorscheme, it will determine the setting to use. If the `guibg` is strictly less than “#808080” the background will be set to “dark” otherwise it will be set to “light”.
88 89 90 91 92 |
# File 'lib/vic/color_scheme.rb', line 88 def background! normal = find_highlight(:Normal) return @background = 'dark' unless normal && normal.guibg @background = normal.guibg[1..-1].to_i(16) < 8421504 ? 'dark' : 'light' end |