InDesign Theme Bug on Lightest Mode

Currently the incorrect theme is reported in InDesign UXP when using the lightest theme with

document.theme.onUpdated.addListener()

and

document.theme.getCurrent()

You can see from the logs that darkest, dark, light all work correctly, but when clicking lightest, it first fires correctly as lightest, then immediately incorrectly returns to light.

This makes themes incorrect for UXP in lightest mode.

Thanks

@justin2taylor I’m guessing you found no creative solution for this?

No unfortunately. Even if we tried to catch the quick change from lightest to light and reverted to lightest, that behavior only happens when changing the theme in settings.

If the user loads up InDesign in lightest mode, the theme will only ever report light incorrectly.

We’ll need the InDesign team to fix this on their end in order for it to work correctly.

Combining Capture UI Theme change events - #6 by sttk3 with the theme event listener seems to work ok.

Thank you! This workaround works for now:

require("indesign").app.generalPreferences.uiBrightnessPreference; // number