Mercurial > hg > svgui
comparison 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 |
comparison
equal
deleted
inserted
replaced
1366:c2a3ac0a6688 | 1367:f5566f7271fe |
---|---|
83 } | 83 } |
84 | 84 |
85 return -1; | 85 return -1; |
86 } | 86 } |
87 | 87 |
88 QColor | |
89 ColourDatabase::getContrastingColour(int c) const | |
90 { | |
91 QColor col = getColour(c); | |
92 if (col.red() > col.blue()) { | |
93 if (col.green() > col.blue()) { | |
94 return Qt::blue; | |
95 } else { | |
96 return Qt::yellow; | |
97 } | |
98 } else { | |
99 if (col.green() > col.blue()) { | |
100 return Qt::yellow; | |
101 } else { | |
102 return Qt::red; | |
103 } | |
104 } | |
105 return Qt::red; | |
106 } | |
107 | |
88 bool | 108 bool |
89 ColourDatabase::useDarkBackground(int c) const | 109 ColourDatabase::useDarkBackground(int c) const |
90 { | 110 { |
91 if (!in_range_for(m_colours, c)) return false; | 111 if (!in_range_for(m_colours, c)) return false; |
92 return m_colours[c].darkbg; | 112 return m_colours[c].darkbg; |