alpha: multiply each RGB value with alpha for a darker blend
This commit is contained in:
parent
4997f1b1ae
commit
f773016680
6
x.c
6
x.c
|
@ -1018,6 +1018,9 @@ xloadcols(void)
|
||||||
dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha);
|
dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha);
|
||||||
dc.col[defaultbg].pixel &= 0x00FFFFFF;
|
dc.col[defaultbg].pixel &= 0x00FFFFFF;
|
||||||
dc.col[defaultbg].pixel |= (unsigned char)(0xff * alpha) << 24;
|
dc.col[defaultbg].pixel |= (unsigned char)(0xff * alpha) << 24;
|
||||||
|
dc.col[defaultbg].color.red *= alpha;
|
||||||
|
dc.col[defaultbg].color.green *= alpha;
|
||||||
|
dc.col[defaultbg].color.blue *= alpha;
|
||||||
#endif // ALPHA_PATCH
|
#endif // ALPHA_PATCH
|
||||||
loaded = 1;
|
loaded = 1;
|
||||||
}
|
}
|
||||||
|
@ -1058,6 +1061,9 @@ xsetcolorname(int x, const char *name)
|
||||||
dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha);
|
dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha);
|
||||||
dc.col[defaultbg].pixel &= 0x00FFFFFF;
|
dc.col[defaultbg].pixel &= 0x00FFFFFF;
|
||||||
dc.col[defaultbg].pixel |= (unsigned char)(0xff * alpha) << 24;
|
dc.col[defaultbg].pixel |= (unsigned char)(0xff * alpha) << 24;
|
||||||
|
dc.col[defaultbg].color.red *= alpha;
|
||||||
|
dc.col[defaultbg].color.green *= alpha;
|
||||||
|
dc.col[defaultbg].color.blue *= alpha;
|
||||||
}
|
}
|
||||||
#endif // ALPHA_PATCH
|
#endif // ALPHA_PATCH
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue