]> git.lyx.org Git - features.git/commitdiff
optimizations (halves the number of multiplication).
authorAbdelrazak Younes <younes@lyx.org>
Thu, 8 Nov 2007 08:00:31 +0000 (08:00 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 8 Nov 2007 08:00:31 +0000 (08:00 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21516 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiPainter.cpp

index 390e1507d52a256275e9b472946cf5b28572c316..98bb44b74c1e7a0eea4f03938274cf01947aa663 100644 (file)
@@ -127,7 +127,7 @@ QColor GuiPainter::filterColor(QColor const & col)
        QColor const & max = monochrome_max_.top();
                        
        qreal v = col.valueF();
-       v = v * v; // make it a bit steeper (i.e. darker)
+       v *= v; // make it a bit steeper (i.e. darker)
                
        qreal minr, ming, minb;
        qreal maxr, maxg, maxb;
@@ -135,7 +135,10 @@ QColor GuiPainter::filterColor(QColor const & col)
        max.getRgbF(&maxr, &maxg, &maxb);
                        
        QColor c;
-       c.setRgbF(v*minr+(1-v)*maxr, v*ming+(1-v)*maxg, v*minb+(1-v)*maxb);
+       c.setRgbF(
+               v * (minr - maxr) + maxr,
+               v * (ming - maxg) + maxg,
+               v * (minb - maxb) + maxb);
        return c;
 }