repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: 2dd447a51495053c4b6aa65ba8022d32566c7b50: path_to: revision_to:
commit 2dd447a51495053c4b6aa65ba8022d32566c7b50 Author: Marc LehmannDate: Wed Dec 17 16:03:51 2014 +0000 divide by alpha to avoid black holes diff --git a/Changes b/Changes
--- a/Changes
+++ b/Changes
@@ -43,6 +43,10 @@ TODO: open question, what does the nested set_color calls in get_coplours actual
same height but different ascent.
- implement cvvis in terminfo as blinking cursor, to distinguish it
from cnorm (emacs uses cvvis which is commonly a blinking cursor).
+ - when xft support was compiled in, color queries errornously returned
+ premultiplied values, this also affected internal queries, for example
+ when calculating faded colors. alpha is now divided out when possible,
+ which is more correct but loses color resolution.
- add DECSCUSR xterm extension to set the cursor to a vertical bar.
- add 'extension:string' action, and associated on_action perl
hook, for keysym resources that invokes actions provided by
diff --git a/src/rxvttoolkit.C b/src/rxvttoolkit.C
--- a/src/rxvttoolkit.C
+++ b/src/rxvttoolkit.C
@@ -924,16 +924,26 @@ void
rxvt_color::get (rgba &color) const
{
#if XFT
- //TODO premultiplied alpha??
+
color.r = c.color.red;
color.g = c.color.green;
color.b = c.color.blue;
color.a = c.color.alpha;
+
+ if (IN_RANGE_INC (color.a, 0x0001, 0xfffe))
+ {
+ color.r = color.r * 0xffff / color.a;
+ color.g = color.g * 0xffff / color.a;
+ color.b = color.b * 0xffff / color.a;
+ }
+
#else
+
color.r = c.red;
color.g = c.green;
color.b = c.blue;
color.a = rgba::MAX_CC;
+
#endif
}
-----END OF PAGE-----