]> sigrok.org Git - pulseview.git/blobdiff - pv/view/trace.h
Moved text colour calculation into Trace::get_text_colour
[pulseview.git] / pv / view / trace.h
index 07f90f4c92734e718f085f7b9b0bc0fc1d913564..415a7dc28c70c4e273f2bcde3bd5d037306d10f2 100644 (file)
@@ -137,6 +137,14 @@ protected:
         */
        int get_y() const;
 
+       /**
+        * 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.
+        */
+       QColor get_text_colour() const;
+
        /**
         * Paints a zero axis across the viewport.
         * @param p the QPainter to paint into.