more generic way of dealing with background color changes