Minor correction to alpha distribution equation.

This commit is contained in:
Iron Prando da Silva
2021-11-23 13:22:09 +01:00
parent f5cbaea0a5
commit 0c97541c95

View File

@@ -51,8 +51,9 @@ QColor ColorObject::getAlphaColored(unsigned int i)
{
const int minAlpha = 50;
const int alphaLevels = 20 - 255 / minAlpha;
int alpha = minAlpha + (int)(((255. - minAlpha) / alphaLevels) * (i % alphaLevels));
const int alphaStep = (255. - minAlpha) / alphaLevels;
int alpha = minAlpha + (int)(alphaStep * (i % alphaLevels));
i = (i / alphaLevels) % numberOfColors;
QColor result(r[i], g[i], b[i]);
result.setAlpha(alpha);