Add opacity to null-toolkit-defined rgba_color_trait#374
Conversation
If ETSConfig.toolkit is not `wx` or `qt4`, the alpha channel of `rgba_color` is not available. This patch defaults the opacity to 1.0 in that case. You can reproduce the bug by running ``` from enable.trait_defs.rgba_color_trait import rgba_color from traits.etsconfig.api import ETSConfig ETSConfig.toolkit = '' print(rgba_color(255)[3]) # Throws IndexError, should be alpha channel ```
|
I'm curious about the use case: most of the time Enable/Chaco uses |
Codecov Report
@@ Coverage Diff @@
## master #374 +/- ##
=======================================
Coverage 33.33% 33.33%
=======================================
Files 206 206
Lines 18273 18273
Branches 2470 2470
=======================================
Hits 6091 6091
Misses 11789 11789
Partials 393 393
Continue to review full report at Codecov.
|
This particular bug was evoked because the code managed to import this module before importing TraitsUI/PyFace/etc. that actually picked a backend. It was worked around by setting |
If ETSConfig.toolkit is not
wxorqt4, the alpha channel ofrgba_coloris not available. This patch defaults the opacity to 1.0 in that case.You can reproduce the bug by running