X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fview%2Fselectableitem.hpp;fp=pv%2Fview%2Fselectableitem.hpp;h=1f5944900bafa8d5ed9adafb482c3f77b32c8395;hb=d8d724cc987b7edb6a5e4e9d0dc8415f3cca06e9;hp=36ff0dbcd48a95adf8626aefe751185adb1c39f7;hpb=2a56e4485a97c1d3e679325ec5413039d7a0c06c;p=pulseview.git diff --git a/pv/view/selectableitem.hpp b/pv/view/selectableitem.hpp index 36ff0dbc..1f594490 100644 --- a/pv/view/selectableitem.hpp +++ b/pv/view/selectableitem.hpp @@ -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);