示例#1
0
        public static StiBrush Light(StiBrush baseBrush, byte value)
        {
            if (baseBrush is StiSolidBrush)
            {
                return(new StiSolidBrush(StiColorUtils.Light(((StiSolidBrush)baseBrush).Color, value)));
            }
            else if (baseBrush is StiGradientBrush)
            {
                StiGradientBrush gradientBrush = baseBrush as StiGradientBrush;
                return(new StiGradientBrush(
                           StiColorUtils.Light(gradientBrush.StartColor, value),
                           StiColorUtils.Light(gradientBrush.EndColor, value),
                           gradientBrush.Angle));
            }
            else if (baseBrush is StiHatchBrush)
            {
                StiHatchBrush hatchBrush = baseBrush as StiHatchBrush;
                return(new StiHatchBrush(
                           hatchBrush.Style,
                           StiColorUtils.Light(hatchBrush.ForeColor, value),
                           StiColorUtils.Light(hatchBrush.BackColor, value)));
            }
            else if (baseBrush is StiGlareBrush)
            {
                StiGlareBrush glareBrush = baseBrush as StiGlareBrush;
                return(new StiGlareBrush(
                           StiColorUtils.Light(glareBrush.StartColor, value),
                           StiColorUtils.Light(glareBrush.EndColor, value),
                           glareBrush.Angle));
            }
            else if (baseBrush is StiGlassBrush)
            {
                StiGlassBrush glassBrush = baseBrush as StiGlassBrush;
                return(new StiGlassBrush(
                           StiColorUtils.Light(glassBrush.Color, value),
                           glassBrush.DrawHatch,
                           glassBrush.Blend));
            }

            return(baseBrush);
        }
示例#2
0
        public static void InitColors()
        {
            activeCaptionEnd   = System.Drawing.SystemColors.ActiveCaption;
            inactiveCaptionEnd = System.Drawing.SystemColors.InactiveCaption;

            focus        = CalcColor(System.Drawing.SystemColors.Highlight, System.Drawing.SystemColors.Window, 70);
            selected     = CalcColor(System.Drawing.SystemColors.Highlight, System.Drawing.SystemColors.Window, 30);
            selectedText = CalcColor(System.Drawing.SystemColors.Highlight, System.Drawing.SystemColors.Window, 220);
            content      = CalcColor(System.Drawing.SystemColors.Window, System.Drawing.SystemColors.Control, 200);
            contentDark  = StiColorUtils.Dark(StiColors.Content, 10);
            controlStart = StiColorUtils.Light(System.Drawing.SystemColors.Control, 30);
            controlEnd   = StiColorUtils.Dark(System.Drawing.SystemColors.Control, 10);
            controlText  = System.Drawing.SystemColors.ControlText;

            controlStartLight = StiColorUtils.Light(ControlStart, 20);
            controlEndLight   = StiColorUtils.Light(ControlEnd, 20);
            controlStartDark  = StiColorUtils.Dark(ControlStart, 20);
            controlEndDark    = StiColorUtils.Dark(ControlEnd, 20);

            activeCaptionStart   = StiColorUtils.GetSysColor(Win32.ColorType.COLOR_GRADIENTACTIVECAPTION);
            inactiveCaptionStart = StiColorUtils.GetSysColor(Win32.ColorType.COLOR_GRADIENTINACTIVECAPTION);
        }
 /// <summary>
 /// Creates an ActiveCaptionLight from the specified Rectangle and Angle.
 /// </summary>
 /// <param name="rectangle">Rectangle that defines the starting and ending points of the gradient.</param>
 /// <param name="angle">The angle, measured in degrees clockwise from the x-axis, of the gradient orientation line.</param>
 /// <returns>This method creates The LinearGradientBrush object.</returns>
 public static Brush GetActiveCaptionLightBrush(Rectangle rectangle, float angle)
 {
     return(new LinearGradientBrush(rectangle,
                                    StiColorUtils.Light(StiColors.ActiveCaptionStart, 20),
                                    StiColorUtils.Light(StiColors.ActiveCaptionEnd, 20), angle));
 }
 public Color GetBottomColorLight()
 {
     return(StiColorUtils.Light(GetBottomColor(), 2));
 }
 public Color GetTopColorLight()
 {
     return(StiColorUtils.Light(StiColorUtils.Light(this.Color, (byte)((float)64 * this.Blend)), 5));
 }