mirror of
https://github.com/QuasarApp/ViewSolutions.git
synced 2025-05-07 15:09:45 +00:00
fix
This commit is contained in:
parent
49c2e8f830
commit
4a3f591ca7
@ -32,15 +32,15 @@ QColor ColorPicker::pick(const QImage &img, int density) const {
|
|||||||
A += (pixel & 0xFF000000) >> 24;
|
A += (pixel & 0xFF000000) >> 24;
|
||||||
R += (pixel & 0x00FF0000) >> 16;
|
R += (pixel & 0x00FF0000) >> 16;
|
||||||
G += (pixel & 0x0000FF00) >> 8;
|
G += (pixel & 0x0000FF00) >> 8;
|
||||||
B += pixel & 0x000000FF;
|
B += pixel & 0x000000FF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int count = density * 2;
|
int count = density * density;
|
||||||
return QColor::fromRgba(((A / count) << 24) |
|
return QColor::fromRgba(((A / count) << 24) |
|
||||||
((R / count) << 16) |
|
((R / count) << 16) |
|
||||||
((G / count) << 8) |
|
((G / count) << 8) |
|
||||||
B / count);
|
B / count);
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor ColorPicker::pick(const QString &img) const {
|
QColor ColorPicker::pick(const QString &img) const {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user