xmag's pixel-value popup sometimes unreadable
xorg-xmag 1.0.6-2 on Arch Linux. Holding Button1 down over the scaled image has xmag display a pop-up at the other vertical end of the scaled image that gives details about the pixel.
XQueryColor(dpy, data->win_info.colormap, &color);
snprintf(string, sizeof(string),
"Pixel %ld at (%d,%d) colored (%x,%x,%x).",
pixel, x + data->x, y + data->y,
color.red, color.green, color.blue);
The foreground and background of the popup are set to colours in the colormap used based on what's highest and lowest intensity so a readable contrast occurs. But this often fails with, say, a white foreground and no background so the text is mostly unreadable if the popup is over scaled pixels that are white or light.
xwininfo(1) on a xfce4-terminal(1) window gives
Depth: 32
Visual: 0x546
Visual Class: TrueColor
Colormap: 0x2000002 (not installed)
xdpyinfo(1) says that visual is
visual id: 0x546
class: TrueColor
depth: 32 planes
available colormap entries: 256 per subfield
red, green, blue masks: 0xff0000, 0xff00, 0xff
significant bits in color specification: 8 bits
xmag on that window gives, on clicking on a scaled pixel for a reading, an error on xmag's stderr.
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 91 (X_QueryColors)
Value in failed request: 0xff0f002d
Serial number of failed request: 298
Current serial number in output stream: 298
The pixel value displayed in the popup is 4279173165, 0xff0f002d, matching the failed-request value above. The RGB of the terminal's background is probably RRGGBB=0f002d as far as I can tell by eye.