Xojo turns text that is &c000000 to the system provided text color so that dark mode works correctly. To disable the auto system-color feature you have to use a slightly off-black as you’ve discovered. Doing so by only one is all that’s necessary, as long as it’s not &c000000.
Edit: It probably shouldn’t happen on systems that don’t support dark mode, but I would guess that feature is why you’re not able to use &c000000 black.
maybe a value like “Default” which, on a supported OS, follows the default for the control (textcolor for labels,text areas, textfields)
this way when you’re in Dark mode on macOS its one color, in light mode its different
Right now &c00000000 serves purpose 3
If you want it to NEVER change from “black” use &c01000000
I had a suspicion that I was dealing with a “magic number” implementation. I truly hate magic numbers. I agree with Norman that there needs to be some additional metadata like the “Default” he suggests to indicate that the object should track the OS specified color scheme.
&c00000000 really should yield Black, not some undocumented alternate color and/or behavior.
Anyway, my curiosity is assuaged and I’ll add some code to fudge my way around this.
OS color support should not be assumed to be 32 bit values
NSColor represent each component as a CGFloat and so can represent colors that dont have an exact equivalent in a Xojo color
.Net’s “Color” has ScA, ScB, ScG, ScR which are all floats
Xojo doesnt have a color type that maps onto those well as it assumes colors are only 32 bits
Perhaps Xojo could add Color.Default to the color enumeration and have it always set the System’s default text color. Then &c000000 could always return black. Would that solve the dark mode issue?
The reason black became the “automatic switch” color was so that old projects could be instantly updated for dark mode without needing to adjust colors.
Sorry for the brief description. Yes I followed the thread. I am having an issue with turning a field red (that works ok) but when I try to turn the field black it does not show up in dark mode. I tried using LabelSpread.TextColor = &c00000000 and still in dark mode when I go from red to black sit dose not show correctly. ( it shows fine out of dark mode but in dark mode it is no visible).
Not sure about color.Text. I am coverting over to the screen or Mobile (latest release). I have noticed that it is set up to accommodate the dark mode and works and looks great. I have a field or two that I turn red to highlight information and then of course I would like to turn back to black when another field is selected. This field that I turn back to black does don’t appear or is unreadable because the text is black. The text is there because in “light mode” the label is there in back.
So I tried the code above and the red works nicely and the &c00000000 is black so in dark mode you can not see it. How do I turn the text dark and have it also respond to be readable in dark mode?