diff colors.py @ 74:66773b576282

ColourPicker: enable transparency So, turns out that Qt's indexed images are totally okay with alpha channels. This might come in handy some day when I enable overlying tiles without regard for grid boundaries.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Tue, 10 Sep 2019 12:58:47 -0400
parents 74ebf2f4e801
children 3886c3d656b7
line wrap: on
line diff
--- a/colors.py
+++ b/colors.py
@@ -71,3 +71,11 @@
 ]
 
 QT_NES_PALETTE = [QG.QColor(color).rgb() for color in NES_PALETTE]
+def palette_to_qt(palette):
+    return [
+        QG.QColor(0, 0, 0, 0).rgba() if color_idx is None
+        else QG.QColor(NES_PALETTE[color_idx]).rgb()
+        for color_idx in palette
+    ]
+
+