[Qgis-developer] Transparency/Opacity (was: Outline/border -> stroke? )

John Hawkinson jhawk at MIT.EDU
Mon Feb 20 06:19:20 PST 2017


> An outstanding question is what range we should allow? Behind the
> scenes it's generally going to be converted to a 0-255 value, but for
> users a 0-100% may be more explanatory. Opinions?

The tools I use again express opacity in 0-100%, and I think that's
the correct thing for the user interface. Why should users presume
the internals are going to be 8-bit unsigned? Why shouldn't it be
0-65536? Or floating point? 

> The API is ALL OVER THE PLACE here, and should also be fixed. We have
> a mix of transparency/opacity/alpha and ranges of 0-1, 0-100, 0-255.
> It's confusing for developers too!

So, I imagine at some point in the future someone is going to
decide 8-bit alpha channels are too limiting. The API should
probably be forward-looking with respect to that. I'm not
sure exactly what that means, but to me it suggests
not 0-255. Maybe 0-1 floating point. But I dunno.

--jhawk


More information about the Qgis-developer mailing list