Make color validator less permissive and increase minimum color lumination.

Closes #7902.
This commit is contained in:
reaperrr
2015-06-05 02:02:30 +02:00
parent 21f0d5c5a0
commit 621cdeb996

View File

@@ -22,8 +22,8 @@ namespace OpenRA.Mods.Common.Server
public class ColorValidator : ServerTrait, IClientJoined
{
// The bigger the color threshold, the less permitive is the algorithm
const int ColorThreshold = 0x40;
const byte ColorLowerBound = 0x33;
const int ColorThreshold = 0x70;
const byte ColorLowerBound = 0x80;
const byte ColorHigherBound = 0xFF;
static bool ValidateColorAgainstForbidden(Color askedColor, IEnumerable<Color> forbiddenColors, out Color forbiddenColor)
@@ -134,7 +134,7 @@ namespace OpenRA.Mods.Common.Server
{
var hue = (byte)server.Random.Next(255);
var sat = (byte)server.Random.Next(255);
var lum = (byte)server.Random.Next(51, 255);
var lum = (byte)server.Random.Next(129, 255);
askColor = new HSLColor(hue, sat, lum);
} while (!ValidatePlayerNewColor(server, askColor.RGB, playerIndex));
}