mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
Refactoring
This commit is contained in:
parent
8e0b8ae883
commit
77e3691eec
@ -10,6 +10,8 @@ namespace RGB.NET.Brushes.Helper
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class GradientHelper
|
public static class GradientHelper
|
||||||
{
|
{
|
||||||
|
#region Methods
|
||||||
|
|
||||||
// Based on https://web.archive.org/web/20170125201230/https://dotupdate.wordpress.com/2008/01/28/find-the-color-of-a-point-in-a-lineargradientbrush/
|
// Based on https://web.archive.org/web/20170125201230/https://dotupdate.wordpress.com/2008/01/28/find-the-color-of-a-point-in-a-lineargradientbrush/
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Calculates the offset of an given <see cref="Point"/> on an gradient.
|
/// Calculates the offset of an given <see cref="Point"/> on an gradient.
|
||||||
@ -72,9 +74,8 @@ namespace RGB.NET.Brushes.Helper
|
|||||||
/// <param name="point1">The first <see cref="Point"/>.</param>
|
/// <param name="point1">The first <see cref="Point"/>.</param>
|
||||||
/// <param name="point2">The second <see cref="Point"/>.</param>
|
/// <param name="point2">The second <see cref="Point"/>.</param>
|
||||||
/// <returns>The distance between the two <see cref="Point"/>.</returns>
|
/// <returns>The distance between the two <see cref="Point"/>.</returns>
|
||||||
public static double CalculateDistance(Point point1, Point point2)
|
public static double CalculateDistance(Point point1, Point point2) => Math.Sqrt(((point1.Y - point2.Y) * (point1.Y - point2.Y)) + ((point1.X - point2.X) * (point1.X - point2.X)));
|
||||||
{
|
|
||||||
return Math.Sqrt(((point1.Y - point2.Y) * (point1.Y - point2.Y)) + ((point1.X - point2.X) * (point1.X - point2.X)));
|
#endregion
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user