Community
Participate
Working Groups
Please launch the attached snippet on macOS 10.15 switched to dark theme. As you can see, the text is hard to read. Maybe an alpha-blended color reported by macOS was not correctly converted to a real color?
Created attachment 281641 [details] Snippet
Created attachment 281642 [details] Screenshot on macOS 10.15
Created attachment 281643 [details] Screenshot on macOS 10.14.6
Frankly, my findings surprised me: GC ignores alpha component of 'GC.setBackground()', 'GC.setForeground()' etc, replacing it with GC.getAlpha() instead. This seems to happen on all 3 platforms, and for example on macOS the code seems to remain unchanged since initial implementation. See for example 'GC.checkGC' on macOS: NSColor bg = data.bg = NSColor.colorWithDeviceRed(color[0], color[1], color[2], data.alpha / 255f); In 21st century, I see the behavior of ignoring Color's alpha as... ancient, at best. I see a simple solution here: multiply gc.getAlpha() by Color.getAlpha(), problem solved. However, this is a breaking change, and could cause issues if for whatever reason some colors had wrong alpha values which were previously ignored. Yes, technically that's a bug in that other code, yet still... What do you think?
Gosh, sorry, posted things to a wrong bug. I was meaning to post to Bug 558258.
There seem to be weird things going on inside SWT even on macOS 10.14. When launching the snippet 2 (which differs only from 1st snippet by logging the foreground color and possibly setting it), it makes a difference whether the toolbar's foreground color is set to its own value or not. Without setting it, the toolbar's texts are (dark) gray, with setting it, they are black.
Created attachment 282187 [details] Snippet 2
Created attachment 282188 [details] Screenshot macOS 10.14 - default (light system theme)
Created attachment 282189 [details] Screenshot macOS 10.14 - with re-setting the toolbar foreground color (light system theme)