- /* Scale down RGB values to the visual's bits per RGB, and shift
- them to the right position in the pixel color. Note that the
- original RGB values are 16-bit values, as usual in X. */
- pr = (r >> (16 - dpyinfo->red_bits)) << dpyinfo->red_offset;
- pg = (g >> (16 - dpyinfo->green_bits)) << dpyinfo->green_offset;
- pb = (b >> (16 - dpyinfo->blue_bits)) << dpyinfo->blue_offset;
-
- /* Assemble the pixel color. */
- return pr | pg | pb;
+ return x_make_truecolor_pixel (dpyinfo, r, g, b);