I can’t change ListWidget background based on the dark mode on/off. It seems that it’s working in the App but as a Widget placed in home screen not.
function setupBackground(widget) {
let gradient = new LinearGradient()
gradient.locations = [0, 1]
let colors
if (Device.isUsingDarkAppearance()) {
colors = [new Color(“#08203E”), new Color(“#557C93”)]
} else {
colors = [new Color(“#2980B9”), new Color(“#6DD5FA”)]
}
gradient.colors = colors
widget.backgroundGradient = gradient
}