mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow specifying arbitrary colors as hex triplets when creating custom columns with a fixed set of values. Fixes #1302078 [Allowing RGB colors for custom columns](https://bugs.launchpad.net/calibre/+bug/1302078)
This commit is contained in:
parent
fce3f56826
commit
f6a6ab51c5
@ -297,7 +297,7 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn):
|
||||
return self.simple_error('', _('The colors box must be empty or '
|
||||
'contain the same number of items as the value box'))
|
||||
for tc in c:
|
||||
if tc not in QColor.colorNames():
|
||||
if tc not in QColor.colorNames() and not re.match("#(?:[0-9a-f]{3}){1,4}",tc,re.I):
|
||||
return self.simple_error('',
|
||||
_('The color {0} is unknown').format(tc))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user