Ted Roden <[EMAIL PROTECTED]> writes:

> Ok, I've another silly question.
> 
> I have my fonts drawing beautifully, but I can only seem to get black
> fonts to work (unless I use XftColorAllocName). I'm guessing that it has
> something to do with alpha, but I don't know how that works enough to be
> sure.
> 
> If anyone could help me out I'd appreciate it, and if anyone has links
> to documents on the alpha channel that would also be great.
> 
> The code I am using is this:
> 
> render_color.red = 189;
> render_color.green = 182;
> render_color.blue = 107;
> render_color.alpha = 0xffff;
>      
> XftColorAllocValue (dis,
>               DefaultVisual(dis, screen), 
>               DefaultColormap(dis, screen),
>               &render_color,
>               &xft_color);

Values are 0-65535 not 0-255. (Also, if you start to use 
alpha values other 65535, you'll run into the fact that
color values use premultiplied alpha, so a 50% transparent
red is (0x8000, 0, 0, 0x8000), not the
(0x8000, 0, 0, 0xffff) you might expect.)

Regards,
                                        Owen
_______________________________________________
Render mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/render

Reply via email to