fix: color lerping not working from bright to darker
This commit is contained in:
@@ -95,7 +95,7 @@ public readonly struct ColorRGB(byte r, byte g, byte b) : IEquatable<ColorRGB>
|
||||
int greenDiff = to.G - from.G;
|
||||
int blueDiff = to.B - from.B;
|
||||
|
||||
return from + new ColorRGB((byte)(redDiff * t), (byte)(greenDiff * t), (byte)(blueDiff * t));
|
||||
return new((byte)(from.R - redDiff * t), (byte)(from.G - greenDiff * t), (byte)(from.B - blueDiff * t));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -125,7 +125,7 @@ public readonly struct ColorRGBA(byte r, byte g, byte b, byte a = 255) : IEquata
|
||||
int blueDiff = to.B - from.B;
|
||||
int alphaDiff = to.A - from.A;
|
||||
|
||||
return from + new ColorRGBA((byte)(redDiff * t), (byte)(greenDiff * t), (byte)(blueDiff * t), (byte)(alphaDiff * t));
|
||||
return new((byte)(from.R - redDiff * t), (byte)(from.G - greenDiff * t), (byte)(from.B - blueDiff * t), (byte)(from.A - alphaDiff * t));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
1
Engine.Serializers/YamlDotNet
Submodule
1
Engine.Serializers/YamlDotNet
Submodule
Submodule Engine.Serializers/YamlDotNet added at 62048d7abe
Reference in New Issue
Block a user