QwtLinearColorMap and alpha/transparency problem?
Brought to you by:
rathmann
|
From: Clarkson, E. C. <Edw...@gt...> - 2019-02-22 20:04:51
|
Several years ago, I filed away https://sourceforge.net/p/qwt/mailman/message/33109926/ thinking that when we finally upgraded to qwt 6.1 from 6.0 I'd play with transparency support for one of our charts. We are finally on qwt 6.1.3 (compiled against Qt 5.9), but I am extremely confused by what I'm seeing from this code: QColor c1(255,0,0,100); QColor c2(0,255,0,100); QwtLinearColorMap foobar(c1, c2); qDebug() << c1 << c2 << foobar.color1() << foobar.color2(); Yields: QColor(ARGB 0.392157, 1, 0, 0) QColor(ARGB 0.392157, 0, 1, 0) QColor(ARGB 1, 1, 0, 0) QColor(ARGB 1, 0, 1, 0) I don't have a working debugger/qwt debug build to step through, but I have read through QwtLinearColorMap::ColorStops::insert and related methods; it sure seems like the alpha is being preserved between the various QColor/QRgb conversions inside QwtLinearColorMap and ColorStops (also per old mailing list post above from 2014)... but somehow it's not? Am I missing something (I feel like there must be)? As it stands, I don't see a bug in either my code or qwt... Appreciate any pointers, obvious or otherwise, Ed |