CUE.NET.Brushes.LinearGradientBrush.GetColorAtPoint C# (CSharp) Метод

GetColorAtPoint() защищенный Метод

Gets the color at an specific point assuming the brush is drawn into the given rectangle.
protected GetColorAtPoint ( RectangleF rectangle, BrushRenderTarget renderTarget ) : CorsairColor
rectangle System.Drawing.RectangleF The rectangle in which the brush should be drawn.
renderTarget BrushRenderTarget The target (key/point) from which the color should be taken.
Результат CUE.NET.Devices.Generic.CorsairColor
        protected override CorsairColor GetColorAtPoint(RectangleF rectangle, BrushRenderTarget renderTarget)
        {
            if (Gradient == null) return CorsairColor.Transparent;

            PointF startPoint = new PointF(StartPoint.X * rectangle.Width, StartPoint.Y * rectangle.Height);
            PointF endPoint = new PointF(EndPoint.X * rectangle.Width, EndPoint.Y * rectangle.Height);

            float offset = GradientHelper.CalculateLinearGradientOffset(startPoint, endPoint, renderTarget.Point);
            return Gradient.GetColor(offset);
        }