Forex_Strategy_Builder.Data.GetGradientColor C# (CSharp) Метод

GetGradientColor() публичный статический Метод

Color change
public static GetGradientColor ( Color baseColor, int depth ) : Color
baseColor Color
depth int
Результат Color
        public static Color GetGradientColor(Color baseColor, int depth)
        {
            if (!Configs.GradientView)
                return baseColor;

            int r = Math.Max(Math.Min(baseColor.R + depth, 255), 0);
            int g = Math.Max(Math.Min(baseColor.G + depth, 255), 0);
            int b = Math.Max(Math.Min(baseColor.B + depth, 255), 0);

            return Color.FromArgb(r, g, b);
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public FancyPanel(string captionText, Color borderColor)
        {
            _caption          = captionText;
            _colorCaptionBack = borderColor;
            _brushCaption     = new SolidBrush(LayoutColors.ColorCaptionText);
            _penBorder        = new Pen(Data.GetGradientColor(borderColor, -LayoutColors.DepthCaption), Border);

            InitializeParameters();
        }
All Usage Examples Of Forex_Strategy_Builder.Data::GetGradientColor