Robot.createScreenCapture() gets the wrong colours if the option awt.robot.gtk is set to false, see attachments. The problem is reproducible on Linux (e.g. Ubuntu 18.04) in VNC environment when server depth is set to 16.
Steps to reproduce:
1. Start VNC server, (e.g. vncserver :18 -depth 16 &)
2. Start VNC client, (e.g. gvncviewer localhost:18 &)
3. Run RobotScreenCaptureTest.java, (i.e. java -Dawt.robot.gtk=false RobotScreenCaptureTest)
Note: it might be necessary to repeat step 3 several times (~10) to reproduce the issue
Actual result:
The test fails due to wrong colour, see ���screenCapture_awt.robot.gtk=false.png��� in the attachment
Expected result:
The test should pass, see ���screenCapture_awt.robot.gtk=true.png��� in the attachment