diff options
author | FRIGN <dev@frign.de> | 2014-05-25 12:13:22 +0200 |
---|---|---|
committer | Christoph Lohmann <20h@r-36.net> | 2014-06-01 16:20:22 +0200 |
commit | a32c5f5726f514b49bd396f27aab0e78c40126d3 (patch) | |
tree | a088ae52e97793d458a980813292f50239663c35 /st.info | |
parent | ba36d1394b3add5b9d4c174f1443cc312bcc7e09 (diff) |
Refactor xsetcolorname()
I mainly improved the slightly off algorithm used to load colours in the 256-colour-space and
removed unnecessary local values (r,g,b,colour).
"colour" is not necessary as a punchbag for XftColorAlloc[Value,Name], as they don't mess with
the result-adress until they are absolutely sure everything worked out[0].
Being at it, I changed the error-returns for AllocValue to dies (just like in xloadcols()), as
a failure is most likely an OOM-situation you better catch early.
In case of an invalid name everything stays the same.
[0]: http://www.opensource.apple.com/source/X11libs/X11libs-40/libXft/libXft-2.1.13/src/xftcolor.c
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Diffstat (limited to 'st.info')
0 files changed, 0 insertions, 0 deletions