mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 05:33:33 +00:00
optimizations (halves the number of multiplication).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21516 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
3a1290815e
commit
b9eecfab8a
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user