I have this code in the activate event but the color of the text in dark mode is always white (latest Xojo, macOS 10.15.7) What could be stopping it from making the text Black?
if color.IsDarkMode then
self.BackgroundColor = color.DarkGray
rectangle1.FillColor = color.DarkGray
label1.TextColor = color.Black
else
self.BackgroundColor = color.LightGray
rectangle1.FillColor = color.Gray
label1.TextColor = color.Black
end if
Controls whose text defaults to Solid Black (&c00000000) will automatically use the system’s Text Color (except Label, see below), which changes depending on Light or Dark mode.
While I strongly oppose putting extra code in the paint event that isn’t needed, system colors do need the paint event as that is the only time (which I know of) where you can guarantee that you’re going to get the most appropriate color.
I had a bad surprise lately concerning my eyes and I can tell you white text on a black background is far better than the opposite (strange, but true). At the same text size, I wa able to read with the former, while not in the later.
Also, contrast between the two colors is very important; I have a drug from pharmacy whose background is dark-red (!) and the text color is… black. Even with magnifyng glasses, I was not able to read…
Now, you are the developer, and your target may have perfect eyes / younger than me.