From f6a6ab51c5b5d5686e55320f09887b1f9b5d565d Mon Sep 17 00:00:00 2001 From: Stephan Hradek Date: Thu, 3 Apr 2014 19:12:51 +0200 Subject: [PATCH] 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) --- src/calibre/gui2/preferences/create_custom_column.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/preferences/create_custom_column.py b/src/calibre/gui2/preferences/create_custom_column.py index b089844127..c2f21bd2bf 100644 --- a/src/calibre/gui2/preferences/create_custom_column.py +++ b/src/calibre/gui2/preferences/create_custom_column.py @@ -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))