diff --git a/qutebrowser/utils/utils.py b/qutebrowser/utils/utils.py index 0a2fc364a..3e4740c0d 100644 --- a/qutebrowser/utils/utils.py +++ b/qutebrowser/utils/utils.py @@ -174,9 +174,9 @@ def interpolate_color(start, end, percent, colorspace=QColor.Rgb): if colorspace is None: if percent == 100: - return end + return QColor(*end.getRgb()) else: - return start + return QColor(*start.getRgb()) out = QColor() if colorspace == QColor.Rgb: diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py index 22a8d59e0..f0ec48531 100644 --- a/tests/unit/utils/test_utils.py +++ b/tests/unit/utils/test_utils.py @@ -347,6 +347,7 @@ class TestInterpolateColor: """Test an interpolation with a gradient turned off.""" color = utils.interpolate_color(Color(0, 0, 0), Color(255, 255, 255), percentage, None) + assert isinstance(color, QColor) assert Color(color) == Color(*expected)