From 201c71495704bf3074fd020e6e83b738a90cc201 Mon Sep 17 00:00:00 2001 From: Pierre Raybaut Date: Thu, 15 Feb 2024 19:01:46 +0100 Subject: [PATCH] Update QwtLinearColorMap.colorStops API to return list of ColorStop objects --- CHANGELOG.md | 2 ++ qwt/color_map.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a561f0..60c0b01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ - Added an additional margin to the left of ticks labels: this margin is set to one character width, to avoid the labels to be truncated while keeping a tight layout - Slighly improved the new flat style (see V0.7.0) by selecting default fonts +- API breaking change: `QwtLinearColorMap.colorStops` now returns a list of `ColorStop` + objects instead of the list of stop values ## Version 0.11.2 diff --git a/qwt/color_map.py b/qwt/color_map.py index 9c4cdb9..0b652e5 100644 --- a/qwt/color_map.py +++ b/qwt/color_map.py @@ -28,8 +28,8 @@ :members: """ -from qtpy.QtGui import QColor, qRed, qGreen, qBlue, qRgb, qRgba, qAlpha from qtpy.QtCore import Qt, qIsNaN +from qtpy.QtGui import QColor, qAlpha, qBlue, qGreen, qRed, qRgb, qRgba class ColorStop(object): @@ -92,7 +92,7 @@ def insert(self, pos, color): def stops(self): if self.__stops: - return [stop.pos for stop in self.__stops] + return [stop for stop in self.__stops] else: return []