Commit graph

13 commits

Author SHA1 Message Date
Uli Schlachter
8a44d59716 Correctly convert colors with alpha to a Lua string
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-03-03 10:57:48 +01:00
Uli Schlachter
1acae2aa6c Make alpha work on window borders
Up to now, we always asked the X11 server for color allocation ("which
pixel value corresponds to (r,g,b)?", an AllocCollor request).

This commit adds direct support for TrueColor and DirectColor visuals.
In such a visual, the X11 server gives tells us where the red, green,
and blue color components are in a pixel value and we can then just
directly compute the pixel value.

Additionally, this commit adds code that assumes that in a depth=32
visual, the remaining values (after handling red, green, blue) is the
alpha channel for colors. Thus, this adds support for transparent client
borders.

This commit also touches code for the systray. However, the systray must
always use the X11 server's default visual and that one always(?) has
depth=24, i.e. does not support an alpha channel. Thus, the systray
background still cannot be transparent.

Also, in theory this commit should support visuals where some color
component does not have 8 bits, for example RGB565. However, this is
just theoretic and I have no idea how to actually test this (without
jumping through too many hoops).

Fixes: https://github.com/awesomeWM/awesome/issues/162
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-03-03 10:57:48 +01:00
Gregor Best
c2ea920ca0 remove encoding=utf-8 from modelines
This option is no longer valid in modelines, so it has been removed from
all modelines using the following shellscript:

    #!/bin/ksh

    git ls-tree -r HEAD | cut -f2 | while read f; do
        egrep -e '^(//|--) vim: .*encoding=' $f >/dev/null || continue
        sed -E -e '/^(\/\/|--) vim:/s/:encoding=utf-8//' $f > /tmp/foo
        mv /tmp/foo $f
    done

Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-11 17:34:09 +02:00
Uli Schlachter
ae8567bef3 Color: Remove alpha, it is unused
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 20:18:24 +02:00
Uli Schlachter
0e819f2328 xcolor: Rename to color
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 20:14:19 +02:00
Uli Schlachter
2c52bc7001 Color: Remove, we are only using xcolor now
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 20:12:57 +02:00
Uli Schlachter
cf679c2db3 Remove named colors
The only string format for colors that we now support are #rrggbb and #rrggbbaa.
All other strings will cause errors.

Thanks to this, color_init_cookie_t can be removed. There won't be a request to
the X server for transforming named colors any more and so there won't be a
cookie. This means that color_init_reply() has to be removed, too.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-10 11:27:40 +02:00
Julien Danjou
ada6056c89 color: do not take pointer to push
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-17 17:46:35 +02:00
Julien Danjou
df20e95f82 color: move push color function to color.c
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-19 17:01:01 +02:00
Julien Danjou
9b35ad7983 color: simplify includes
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-18 14:02:21 +02:00
Uli Schlachter
293f2a312d Add an API for converting a xcolor_t to a color_t
Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-18 14:02:21 +02:00
Uli Schlachter
19e30e56d0 Add new color management api
This api is intended for uses where you don't need a color's pixel value but
only the color components.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-18 14:02:20 +02:00
Uli Schlachter
5dadaa59a9 Move xcolor into its own source files
Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-18 13:55:38 +02:00