diff layer/ColourDatabase.cpp @ 1367:f5566f7271fe waverevision

Rework waveform renderer to use smooth paths, aiming to get near-pixel-identical results when zoomed out far enough for a single path not to be relevant
author Chris Cannam
date Wed, 31 Oct 2018 15:06:32 +0000
parents a34a2a25907c
children ad86aa712d11
line wrap: on
line diff
--- a/layer/ColourDatabase.cpp	Tue Oct 30 16:23:03 2018 +0000
+++ b/layer/ColourDatabase.cpp	Wed Oct 31 15:06:32 2018 +0000
@@ -85,6 +85,26 @@
     return -1;
 }
 
+QColor
+ColourDatabase::getContrastingColour(int c) const
+{
+    QColor col = getColour(c);
+    if (col.red() > col.blue()) {
+        if (col.green() > col.blue()) {
+            return Qt::blue;
+        } else {
+            return Qt::yellow;
+        }
+    } else {
+        if (col.green() > col.blue()) {
+            return Qt::yellow;
+        } else {
+            return Qt::red;
+        }
+    }
+    return Qt::red;
+}
+
 bool
 ColourDatabase::useDarkBackground(int c) const
 {