Hi Paweid!
Thank you for chiming in - it is much appreciated.
Your project example illustrates the effect.
The background color of the Form is more grey/blueish than the titlebar of your project.
At designtime they are almost the same color.
The form.color uses clDefault, a color I cannot match with any of the standard colors.
At runtime it seems to switch to the color clForm (or something like that), which could make sense, but is not the same color. (see screenshot)
Easiest way to reproduce with code; Start a new fresh application, just a plain form, without
any modifications, you'll see exact the same effect: The color in design mode is being different than in runtime mode.
See second screenshot, which is a combination of 3 screenshots, since inactive windows will have a slightly darker color under macOS which I wanted to avoid.
From left to right in the second screenshot:
I created a blank
form in XCode. I'll just call that "the correct colors" for a Form under macOS.
The second window in the screenshot shows the
Lazarus TForm at designtime (I disabled the grid), which seems to use a color that seems about correct when comparing them with the XCode form.
The third one however, is that same
Lazarus form at runtime, showing a more grey-ish.
So for some reason, at runtime the default (clDefault) color of the form is changed and seems to be "off".
Note: the warmer color that we see during design time, matches the color that I see with other macOS applications as well. Not sure why it would change at runtime.
This is just one example.
When assigning the color "clForm" for example to the
TForm.color and a
TEdit.color, then they both look the same kind of "dirty" greyish - unlike what one would see in XCode. However still slightly off (maybe this is what you meant).
Now I could use a dropper to pick that specific color at runtime, and hardcode it. But my fear would be that this color could be different again in the future with different OS versions for example. So I'd rather pick a color the right way (if there is any).
Initial though was using the standard colors, under the assumption those would be consistently be matching the system colors.
The alternative would be grabbing a pixel from the form (self.canvas.pixels[]), but under Cocoa this always returns the color black.
In the end I'm looking for a proper way to determine the Form color (or other controls), and just ran into this issue which may be a bug?
Note: when looking at some of my Cocoa applications that have been compiled a while ago, then this issue does not arise and the forms are the proper warmer color. So this change in color must have snuck in the code somewhere in the past year or so (just guessing).