Community
Participate
Working Groups
Please launch the attached snippet on macOS 10.14 or 10.15. You will see following output: background = Color {255, 255, 255, 63} foreground = Color {255, 255, 255, 255} Now select table cell - and you will notice that it will be white on white background.
Created attachment 281214 [details] Snippet to reproduce
Created attachment 281215 [details] macOS preferences Forgot to mention: you need to switch the macOS 'Accent colour' from the default blue (left) to graphite (right).
Created attachment 281216 [details] Screenshot on macOS 10.14.5
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?