Solaris X Window System Developer's Guide

Visual Selection Alternatives

It is recommended that applications be written to handle a wide variety of visual configurations. Some devices, for example the GX, do not have any linear visuals. Other devices have only a single linear 24-bit TrueColor visual. Other types of devices may support both linear and nonlinear visuals at the same time. In general, the most prudent way to write a portable application is to deal gracefully with all these configurations. This may involve printing a warning message if the visual of the desired linearity is not found. Or, if a linear application cannot find a linear visual, a useful trick is to manually darken in the application the colors given to X11. This is tantamount to performing your own gamma correction. The gamma value returned by XSolarisGetVisualGamma can be used to determine how much to darken the colors.


Note –

XSolarisGetVisualGamma is a Public interface of Solaris and is fully supported. In the future, a color management system may also provide this functionality. When this occurs, this will become the preferred way of getting this information. But until then, XSolarisGetVisualGamma should be used. When this color management system is introduced, applications using XSolarisGetVisualGamma will continue to run with no modification and will actually benefit from the increased accuracy of the color management system.