Pinta.ColorGradientWidget.GetValueFromY C# (CSharp) Method

GetValueFromY() private method

private GetValueFromY ( double py ) : int
py double
return int
        private int GetValueFromY(double py)
        {
            Rectangle rect = GradientRectangle;
            Rectangle all = Allocation.ToCairoRectangle ();

            py -= all.Y + ypad * all.Height;
            return ((int)(255 * (rect.Height - py) / rect.Height));
        }