Пример #1
0
 public static StiBrush Dark(StiBrush baseBrush, byte value)
 {
     if (baseBrush is StiSolidBrush)
     {
         return(new StiSolidBrush(StiColorUtils.Dark(((StiSolidBrush)baseBrush).Color, value)));
     }
     else if (baseBrush is StiGradientBrush)
     {
         StiGradientBrush gradientBrush = baseBrush as StiGradientBrush;
         return(new StiGradientBrush(
                    StiColorUtils.Dark(gradientBrush.StartColor, value),
                    StiColorUtils.Dark(gradientBrush.EndColor, value),
                    gradientBrush.Angle));
     }
     else if (baseBrush is StiHatchBrush)
     {
         StiHatchBrush hatchBrush = baseBrush as StiHatchBrush;
         return(new StiHatchBrush(
                    hatchBrush.Style,
                    StiColorUtils.Dark(hatchBrush.ForeColor, value),
                    StiColorUtils.Dark(hatchBrush.BackColor, value)));
     }
     else if (baseBrush is StiGlareBrush)
     {
         StiGlareBrush glareBrush = baseBrush as StiGlareBrush;
         return(new StiGlareBrush(
                    StiColorUtils.Dark(glareBrush.StartColor, value),
                    StiColorUtils.Dark(glareBrush.EndColor, value),
                    glareBrush.Angle));
     }
     else if (baseBrush is StiGlassBrush)
     {
         StiGlassBrush glassBrush = baseBrush as StiGlassBrush;
         return(new StiGlassBrush(
                    StiColorUtils.Dark(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);
        }