protected void DarkenPalette(int redScale, int greenScale, int blueScale, int startColor, int endColor)
{
if (startColor <= endColor)
{
var max = _game.Version >= 5 && _game.Version <= 6 ? 252 : 255;
var currentPalette = Game.Version == 8 ? _darkenPalette : roomData.Palettes[_curPalIndex];
for (var j = startColor; j <= endColor; j++)
{
var color = currentPalette.Colors[j];
var red = (color.R * redScale) / 255;
if (red > max)
red = max;
var green = (color.G * greenScale) / 255;
if (green > max)
green = max;
var blue = (color.B * blueScale) / 255;
if (blue > max)
blue = max;
_currentPalette.Colors[j] = Color.FromRgb(red, green, blue);
// if (_game.features & GF_16BIT_COLOR)
// _16BitPalette[idx] = get16BitColor(_currentPalette[idx * 3 + 0], _currentPalette[idx * 3 + 1], _currentPalette[idx * 3 + 2]);
}
SetDirtyColors(startColor, endColor);
}
}