This commit is contained in:
ShrlAlgo
2025-07-11 09:20:23 +08:00
parent c7b104f44f
commit 4d35cadb56
840 changed files with 102347 additions and 11595 deletions

View File

@@ -0,0 +1,23 @@
using System.Windows.Media;
namespace WPFDark.Internals
{
internal static class ColorHelper
{
internal static Color Lerp(double ratio, Color c1, Color c2)
=> Color.FromArgb(
(byte)((c2.A - c1.A) * ratio + c1.A),
(byte)((c2.R - c1.R) * ratio + c1.R),
(byte)((c2.G - c1.G) * ratio + c1.G),
(byte)((c2.B - c1.B) * ratio + c1.B));
internal static ByteColor Lerp(double ratio, ByteColor c1, ByteColor c2)
=> new ByteColor(
(byte)((c2.A - c1.A) * ratio + c1.A),
(byte)((c2.R - c1.R) * ratio + c1.R),
(byte)((c2.G - c1.G) * ratio + c1.G),
(byte)((c2.B - c1.B) * ratio + c1.B));
}
}