]> sigrok.org Git - pulseview.git/blobdiff - pv/view/selectableitem.hpp
Trace: Moved get_text_colour into SelectableItem
[pulseview.git] / pv / view / selectableitem.hpp
index 36ff0dbcd48a95adf8626aefe751185adb1c39f7..1f5944900bafa8d5ed9adafb482c3f77b32c8395 100644 (file)
@@ -83,6 +83,15 @@ public:
         */
        virtual QPoint point() const = 0;
 
+public:
+       /**
+        * Gets the text colour.
+        * @remarks This colour is computed by comparing the lightness
+        * of the trace colour against a threshold to determine whether
+        * white or black would be more visible.
+        */
+       static QColor select_text_colour(QColor background);
+
 public:
        virtual QMenu* create_context_menu(QWidget *parent);