Fixed rounding in quantization reference

This commit is contained in:
Darth Affe 2024-07-21 21:36:04 +02:00
parent bd7a2bca48
commit cd4ad4de78

View File

@ -97,10 +97,10 @@ internal class ColorCube
int b = _colors.Sum(x => x.B);
int a = _colors.Sum(x => x.A);
return T.Create((byte)(r / _colors.Count),
(byte)(g / _colors.Count),
(byte)(b / _colors.Count),
(byte)(a / _colors.Count));
return T.Create((byte)MathF.Round(r / (float)_colors.Count),
(byte)MathF.Round(g / (float)_colors.Count),
(byte)MathF.Round(b / (float)_colors.Count),
(byte)MathF.Round(a / (float)_colors.Count));
}
#endregion