diff options
Diffstat (limited to 'render.c')
| -rw-r--r-- | render.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -213,14 +213,10 @@ attrs_to_font(const struct terminal *term, const struct attributes *attrs) static inline pixman_color_t color_hex_to_pixman_with_alpha(uint32_t color, uint16_t alpha) { - if (alpha == 0) - return (pixman_color_t){0, 0, 0, 0}; - - int alpha_div = 0xffff / alpha; return (pixman_color_t){ - .red = ((color >> 16 & 0xff) | (color >> 8 & 0xff00)) / alpha_div, - .green = ((color >> 8 & 0xff) | (color >> 0 & 0xff00)) / alpha_div, - .blue = ((color >> 0 & 0xff) | (color << 8 & 0xff00)) / alpha_div, + .red = ((color >> 16 & 0xff) | (color >> 8 & 0xff00)) * alpha / 0xffff, + .green = ((color >> 8 & 0xff) | (color >> 0 & 0xff00)) * alpha / 0xffff, + .blue = ((color >> 0 & 0xff) | (color << 8 & 0xff00)) * alpha / 0xffff, .alpha = alpha, }; } |
