Dynamically detect dark backgrounds for dark mode