DarkMode, DesktopTextArea and normal font color return problem

macOS: Tahoe 26.5
Xojo: 2026 1.2

DesktopTextArea works fine in dark mode until a new text color is selected. Users are then unable to return to the default color black. The text can be set back to black, but that text can no longer be seen in dark mode.

The example shows how all the text in the area can have only one color, black, but the text does not have a uniform appearance in dark mode. Text with color that has been changed loses something in the transition.

Does anyone know of a way to get the missing quality back?

DarkModeTest.zip (6.9 KB)

Yeah, this is one of those “we made the out of the box experience magic” things that bites you once in a while. Setting text to absolute black makes it “just work” and switch to white on dark mode. While that’s usually what people want, it’s not always so. I suggest that if the user picks black, you change the color’s transparency to 1.

Your transparency suggestion works.

I notice too that the color defaults are different when starting the app in dark mode than when starting the app in light mode. Switching from one mode to another reverses the problem of the affected text being hard to read. There is some consolation in knowing users do not switch modes, at least very often.

I realize that managing color for DarkMode in the interface is a different class of problem than managing the color in user data - i.e., StyledText. A StyledText document sent to another user with the opposite DarkMode setting could display incorrectly. Apple’s TextEdit will show a saved RTF differently than will a DesktopTextArea.

the example app with RTF saving & loading added

DarkModeTest.zip (8.0 KB)

Back when Apple was cool, TextEdit was open source.

1 Like