Sometimes setting the 'bg' option would also reset the colorscheme,
so we need to save the g:colors_name value before toggling the
background option value.
It's only an issue with older ViM versions, probably before 8.x. Based on my test setup, it's highly likely it is because the native package handling feature missing before 8.x.
Sometimes setting the 'bg' option would also reset the colorscheme, so we need to save the g:colors_name value before toggling the background option value.