From 77e3691eec7a385c16188e4f856d1721431816d6 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Sat, 5 Aug 2017 16:32:16 +0200 Subject: [PATCH] Refactoring --- RGB.NET.Brushes/Helper/GradientHelper.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/RGB.NET.Brushes/Helper/GradientHelper.cs b/RGB.NET.Brushes/Helper/GradientHelper.cs index be99a1c..b350af4 100644 --- a/RGB.NET.Brushes/Helper/GradientHelper.cs +++ b/RGB.NET.Brushes/Helper/GradientHelper.cs @@ -10,6 +10,8 @@ namespace RGB.NET.Brushes.Helper /// 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/ /// /// Calculates the offset of an given on an gradient. @@ -72,9 +74,8 @@ namespace RGB.NET.Brushes.Helper /// The first . /// The second . /// The distance between the two . - public static double CalculateDistance(Point point1, Point point2) - { - return Math.Sqrt(((point1.Y - point2.Y) * (point1.Y - point2.Y)) + ((point1.X - point2.X) * (point1.X - point2.X))); - } + 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))); + + #endregion } }