Detect Light or Dark Mode and Display Both Variations In Previews
Daily Coding Tip 216
There is an environment variable that lets you access the currently selected colour scheme. There is currently only a light and dark mode, but it’s not impossible that new schemes will be introduced in the future.
For this reason I’ve used a switch on the variable with an @unknown default, so that I am prepared for th…


