mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Dont serialize alpha color component as the QColor constructor cannot handle them
This commit is contained in:
parent
f6a6ab51c5
commit
3346f0af4f
@ -84,9 +84,5 @@ class ColorButton(QPushButton):
|
||||
def choose_color(self):
|
||||
col = QColorDialog.getColor(QColor(self._color or Qt.white), self, _('Choose a color'))
|
||||
if col.isValid():
|
||||
r, g, b, a = col.getRgb()
|
||||
if a != 255:
|
||||
self.color = '#%02x%02x%02x%02x' % col.getRgb()
|
||||
else:
|
||||
self.color = '#%02x%02x%02x' % (r, g, b)
|
||||
self.color = unicode(col.name())
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user