MCPcopy Create free account
hub / github.com/ElementsProject/elements / MakeSingleColorImage

Function MakeSingleColorImage

src/qt/platformstyle.cpp:30–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28/* Local functions for colorizing single-color images */
29
30void MakeSingleColorImage(QImage& img, const QColor& colorbase)
31{
32 img = img.convertToFormat(QImage::Format_ARGB32);
33 for (int x = img.width(); x--; )
34 {
35 for (int y = img.height(); y--; )
36 {
37 const QRgb rgb = img.pixel(x, y);
38 img.setPixel(x, y, qRgba(colorbase.red(), colorbase.green(), colorbase.blue(), qAlpha(rgb)));
39 }
40 }
41}
42
43QIcon ColorizeIcon(const QIcon& ico, const QColor& colorbase)
44{

Callers 2

ColorizeIconFunction · 0.85
ColorizeImageFunction · 0.85

Calls 1

heightMethod · 0.45

Tested by

no test coverage detected