is a monochrome frame, return MONO_COLOR regardless of what ARG says.
Signal an error if color can't be allocated. */
-static int
+static unsigned long
x_decode_color (struct frame *f, Lisp_Object color_name, int mono_color)
{
XColor cdef;
INLINE unsigned long
x_make_truecolor_pixel (struct x_display_info *dpyinfo, int r, int g, int b)
{
- unsigned long pr, pg, pb, pa = 0;
+ unsigned long pr, pg, pb, pa = dpyinfo->alpha_mask;
/* 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
pg = (g >> (16 - dpyinfo->green_bits)) << dpyinfo->green_offset;
pb = (b >> (16 - dpyinfo->blue_bits)) << dpyinfo->blue_offset;
- if (dpyinfo->alpha_bits)
- pa = (((unsigned long) 0xffff >> (16 - dpyinfo->alpha_bits))
- << dpyinfo->alpha_offset);
- else
- pa = 0;
-
/* Assemble the pixel color. */
return pr | pg | pb | pa;
}