Dark/light custom widget themes?

Is it possible to create custom widget themes that automatically switch between dark and light mode as the default widget theme does?

Hi @larbob, currently it can't be done. I couldn't find a reliable way to adjust it at the moment. Thanks!

In Scriptable, there's a way to specify light and dark options using a dynamic color: https://docs.scriptable.app/color/#dynamic.

I'm not sure what the JS function wraps underlyingly, but it seems to work pretty reliably for making widgets look different in light and dark modes. For example, in Scriptable, I can write something like this:

let backgroundColor = Color.dynamic(Color.white(), Color.black())

let foregroundColor = Color.dynamic(Color.black(), Color.white())

If you could mimic something like this, would it be possible to load two theme files and merge the colors in a similar way?

Thanks for the details. I'm not sure if it can be done on GoodTask with this method but I'll take a look. Thanks!

Hi, Thanks for looking into it.

I wrote a quick Scriptable script to demonstrate what what I was thinking about. It loads two GoodTask widget theme files saved in Scriptable's iCloud directory, then creates the necessary UIColors from them. It relies on whatever Scriptable is doing with its Color.dynamic() function. Simon Støvring might be able to explain what the Javascript function actually does in Swift. I don't know how it would translate into GoodTask's widget code. But I do appreciate your work on the app! Thanks!