mirror of
https://github.com/LukeSmithxyz/st.git
synced 2024-11-22 15:25:58 +01:00
Premultiply background RGB values if alpha is used
This commit is contained in:
parent
d06bf1fd7e
commit
ffcacfa98d
1 changed files with 9 additions and 3 deletions
6
x.c
6
x.c
|
@ -785,6 +785,12 @@ xloadcols(void)
|
|||
if (opt_alpha)
|
||||
alpha = strtof(opt_alpha, NULL);
|
||||
dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha);
|
||||
dc.col[defaultbg].color.red =
|
||||
((unsigned short)(dc.col[defaultbg].color.red * alpha)) & 0xff00;
|
||||
dc.col[defaultbg].color.green =
|
||||
((unsigned short)(dc.col[defaultbg].color.green * alpha)) & 0xff00;
|
||||
dc.col[defaultbg].color.blue =
|
||||
((unsigned short)(dc.col[defaultbg].color.blue * alpha)) & 0xff00;
|
||||
dc.col[defaultbg].pixel &= 0x00FFFFFF;
|
||||
dc.col[defaultbg].pixel |= (unsigned char)(0xff * alpha) << 24;
|
||||
loaded = 1;
|
||||
|
|
Loading…
Reference in a new issue