Пример #1
0
 /// <summary>
 /// Set a pattern fill with a preset pattern, foreground color and background color.
 /// </summary>
 /// <param name="PresetPattern">A preset fill pattern.</param>
 /// <param name="ForegroundColorTheme">The theme color to be used for the foreground.</param>
 /// <param name="BackgroundColor">The color to be used for the background.</param>
 public void SetPatternFill(A.PresetPatternValues PresetPattern, SLThemeColorIndexValues ForegroundColorTheme, System.Drawing.Color BackgroundColor)
 {
     this.Type          = SLFillType.PatternFill;
     this.PatternPreset = PresetPattern;
     this.PatternForegroundColor.SetColor(ForegroundColorTheme, 0, 0);
     this.PatternBackgroundColor.SetColor(BackgroundColor, 0);
 }
Пример #2
0
 /// <summary>
 /// Set a pattern fill with a preset pattern, foreground color and background color.
 /// </summary>
 /// <param name="PresetPattern">A preset fill pattern.</param>
 /// <param name="ForegroundColorTheme">The theme color to be used for the foreground.</param>
 /// <param name="ForegroundColorTint">The tint applied to the foreground theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 /// <param name="BackgroundColorTheme">The theme color to be used for the background.</param>
 /// <param name="BackgroundColorTint">The tint applied to the background theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 public void SetPatternFill(A.PresetPatternValues PresetPattern, SLThemeColorIndexValues ForegroundColorTheme, double ForegroundColorTint, SLThemeColorIndexValues BackgroundColorTheme, double BackgroundColorTint)
 {
     this.Type          = SLFillType.PatternFill;
     this.PatternPreset = PresetPattern;
     this.PatternForegroundColor.SetColor(ForegroundColorTheme, ForegroundColorTint, 0);
     this.PatternBackgroundColor.SetColor(BackgroundColorTheme, BackgroundColorTint, 0);
 }
Пример #3
0
 /// <summary>
 ///     Set a pattern fill with a preset pattern, foreground color and background color.
 /// </summary>
 /// <param name="PresetPattern">A preset fill pattern.</param>
 /// <param name="ForegroundColorTheme">The theme color to be used for the foreground.</param>
 /// <param name="BackgroundColorTheme">The theme color to be used for the background.</param>
 public void SetPatternFill(A.PresetPatternValues PresetPattern, SLThemeColorIndexValues ForegroundColorTheme,
                            SLThemeColorIndexValues BackgroundColorTheme)
 {
     Type          = SLFillType.PatternFill;
     PatternPreset = PresetPattern;
     PatternForegroundColor.SetColor(ForegroundColorTheme, 0, 0);
     PatternBackgroundColor.SetColor(BackgroundColorTheme, 0, 0);
 }
Пример #4
0
 /// <summary>
 ///     Set a pattern fill with a preset pattern, foreground color and background color.
 /// </summary>
 /// <param name="PresetPattern">A preset fill pattern.</param>
 /// <param name="ForegroundColorTheme">The theme color to be used for the foreground.</param>
 /// <param name="ForegroundColorTint">
 ///     The tint applied to the foreground theme color, ranging from -1.0 to 1.0. Negative
 ///     tints darken the theme color and positive tints lighten the theme color.
 /// </param>
 /// <param name="BackgroundColor">The color to be used for the background.</param>
 public void SetPatternFill(A.PresetPatternValues PresetPattern, SLThemeColorIndexValues ForegroundColorTheme,
                            double ForegroundColorTint, Color BackgroundColor)
 {
     Type          = SLFillType.PatternFill;
     PatternPreset = PresetPattern;
     PatternForegroundColor.SetColor(ForegroundColorTheme, ForegroundColorTint, 0);
     PatternBackgroundColor.SetColor(BackgroundColor, 0);
 }
Пример #5
0
        internal void AppendGradientStop(SLThemeColorIndexValues Color, double Tint, decimal Transparency, decimal Position)
        {
            SLGradientStop gs = new SLGradientStop(this.listThemeColors);

            gs.Color.SetColor(Color, Tint, Transparency);
            gs.Position = Position;
            this.GradientStops.Add(gs);
        }
Пример #6
0
 /// <summary>
 /// Set the shadow color.
 /// </summary>
 /// <param name="Color">The theme color used.</param>
 /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 /// <param name="Transparency">Transparency of the color ranging from 0% to 100%. Accurate to 1/1000 of a percent.</param>
 public void SetShadowColor(SLThemeColorIndexValues Color, double Tint, decimal Transparency)
 {
     if (IsInnerShadow != null)
     {
         if (IsInnerShadow.Value)
         {
             this.InnerShadowColor.SetColor(Color, Tint, Transparency);
         }
         else
         {
             this.OuterShadowColor.SetColor(Color, Tint, Transparency);
         }
     }
 }
Пример #7
0
        /// <summary>
        ///     Set a color using a theme color.
        /// </summary>
        /// <param name="ThemeColorIndex">The theme color to be used.</param>
        public void SetThemeColor(SLThemeColorIndexValues ThemeColorIndex)
        {
            var index = (int)ThemeColorIndex;

            if ((index >= 0) && (index < listThemeColors.Count))
            {
                clrDisplay = listThemeColors[index];
            }
            Auto    = null;
            Indexed = null;
            Rgb     = null;
            Theme   = (uint)ThemeColorIndex;
            Tint    = null;
        }
Пример #8
0
        /// <summary>
        /// Set a color using a theme color.
        /// </summary>
        /// <param name="ThemeColorIndex">The theme color to be used.</param>
        public void SetThemeColor(SLThemeColorIndexValues ThemeColorIndex)
        {
            int index = (int)ThemeColorIndex;

            if (index >= 0 && index < this.listThemeColors.Count)
            {
                this.clrDisplay = this.listThemeColors[index];
            }
            this.Auto    = null;
            this.Indexed = null;
            this.Rgb     = null;
            this.Theme   = (uint)ThemeColorIndex;
            this.Tint    = null;
        }
Пример #9
0
        /// <summary>
        ///     Set a color using a theme color, modifying the theme color with a tint value.
        /// </summary>
        /// <param name="ThemeColorIndex">The theme color to be used.</param>
        /// <param name="Tint">
        ///     The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color
        ///     and positive tints lighten the theme color.
        /// </param>
        public void SetThemeColor(SLThemeColorIndexValues ThemeColorIndex, double Tint)
        {
            var clrRgb = new Color();
            var index  = (int)ThemeColorIndex;

            if ((index >= 0) && (index < listThemeColors.Count))
            {
                clrRgb = listThemeColors[index];
            }
            Auto       = null;
            Indexed    = null;
            Rgb        = null;
            Theme      = (uint)ThemeColorIndex;
            this.Tint  = Tint;
            clrDisplay = SLTool.ToColor(clrRgb, Tint);
        }
Пример #10
0
        /// <summary>
        /// Set a color using a theme color, modifying the theme color with a tint value.
        /// </summary>
        /// <param name="ThemeColorIndex">The theme color to be used.</param>
        /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
        public void SetThemeColor(SLThemeColorIndexValues ThemeColorIndex, double Tint)
        {
            System.Drawing.Color clrRgb = new System.Drawing.Color();
            int index = (int)ThemeColorIndex;

            if (index >= 0 && index < this.listThemeColors.Count)
            {
                clrRgb = this.listThemeColors[index];
            }
            this.Auto       = null;
            this.Indexed    = null;
            this.Rgb        = null;
            this.Theme      = (uint)ThemeColorIndex;
            this.Tint       = Tint;
            this.clrDisplay = SLTool.ToColor(clrRgb, Tint);
        }
Пример #11
0
 /// <summary>
 ///     Set the diagonal border with a border style and a theme color, modifying the theme color with a tint value.
 /// </summary>
 /// <param name="BorderStyle">The border style. Default is none.</param>
 /// <param name="BorderColor">The theme color to be used.</param>
 /// <param name="Tint">
 ///     The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color
 ///     and positive tints lighten the theme color.
 /// </param>
 public void SetDiagonalBorder(BorderStyleValues BorderStyle, SLThemeColorIndexValues BorderColor, double Tint)
 {
     DiagonalBorder.BorderStyle = BorderStyle;
     DiagonalBorder.SetBorderThemeColor(BorderColor, Tint);
 }
Пример #12
0
 /// <summary>
 /// Set the shadow color.
 /// </summary>
 /// <param name="Color">The theme color used.</param>
 /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 /// <param name="Transparency">Transparency of the color ranging from 0% to 100%. Accurate to 1/1000 of a percent.</param>
 public void SetShadowColor(SLThemeColorIndexValues Color, double Tint, decimal Transparency)
 {
     if (IsInnerShadow != null)
     {
         if (IsInnerShadow.Value)
         {
             this.InnerShadowColor.SetColor(Color, Tint, Transparency);
         }
         else
         {
             this.OuterShadowColor.SetColor(Color, Tint, Transparency);
         }
     }
 }
        /// <summary>
        /// Set a custom 3-color scale.
        /// </summary>
        /// <param name="MinType">The conditional format type for the minimum.</param>
        /// <param name="MinValue">The value for the minimum. If <paramref name="MinType"/> is Value, you can just set this to "0".</param>
        /// <param name="MinColor">The theme color for the minimum.</param>
        /// <param name="MinColorTint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
        /// <param name="MidPointType">The conditional format type for the midpoint.</param>
        /// <param name="MidPointValue">The value for the midpoint.</param>
        /// <param name="MidPointColor">The theme color for the midpoint.</param>
        /// <param name="MidPointColorTint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
        /// <param name="MaxType">The conditional format type for the maximum.</param>
        /// <param name="MaxValue">The value for the maximum. If <paramref name="MaxType"/> is Value, you can just set this to "0".</param>
        /// <param name="MaxColor">The theme color for the maximum.</param>
        /// <param name="MaxColorTint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
        public void SetCustom3ColorScale(SLConditionalFormatMinMaxValues MinType, string MinValue, SLThemeColorIndexValues MinColor, double MinColorTint,
            SLConditionalFormatRangeValues MidPointType, string MidPointValue, SLThemeColorIndexValues MidPointColor, double MidPointColorTint,
            SLConditionalFormatMinMaxValues MaxType, string MaxValue, SLThemeColorIndexValues MaxColor, double MaxColorTint)
        {
            List<System.Drawing.Color> listempty = new List<System.Drawing.Color>();
            SLColor minclr = new SLColor(listempty, listempty);
            if (MinColorTint == 0) minclr.SetThemeColor(MinColor);
            else minclr.SetThemeColor(MinColor, MinColorTint);
            SLColor maxclr = new SLColor(listempty, listempty);
            if (MaxColorTint == 0) maxclr.SetThemeColor(MaxColor);
            else maxclr.SetThemeColor(MaxColor, MaxColorTint);

            SLColor midclr = new SLColor(listempty, listempty);
            if (MidPointColorTint == 0) midclr.SetThemeColor(MidPointColor);
            else midclr.SetThemeColor(MidPointColor, MidPointColorTint);
            this.SetCustomColorScale(MinType, MinValue, minclr, true, MidPointType, MidPointValue, midclr, MaxType, MaxValue, maxclr);
        }
Пример #14
0
 /// <summary>
 ///     Set the color of the border with one of the theme colors.
 /// </summary>
 /// <param name="ThemeColorIndex">The theme color to be used.</param>
 public void SetBorderThemeColor(SLThemeColorIndexValues ThemeColorIndex)
 {
     clrReal.SetThemeColor(ThemeColorIndex);
     HasColor = clrReal.Color.IsEmpty ? false : true;
 }
Пример #15
0
 /// <summary>
 /// Set a gradient fill given the shading style and 2 colors.
 /// </summary>
 /// <param name="ShadingStyle">The gradient shading style.</param>
 /// <param name="Color1Theme">The first color as one of the theme colors.</param>
 /// <param name="Color1Tint">The tint applied to the first theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 /// <param name="Color2Theme">The second color as one of the theme colors.</param>
 /// <param name="Color2Tint">The tint applied to the second theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 public void SetGradient(SLGradientShadingStyleValues ShadingStyle, SLThemeColorIndexValues Color1Theme, double Color1Tint, SLThemeColorIndexValues Color2Theme, double Color2Tint)
 {
     HasBeenAssignedValues = true;
     UsePatternFill = false;
     this.gfReal.SetGradientFill(ShadingStyle, Color1Theme, Color1Tint, Color2Theme, Color2Tint);
 }
Пример #16
0
 /// <summary>
 /// Set the pattern type, foreground color and background color of the fill pattern.
 /// </summary>
 /// <param name="PatternType">The pattern type. Default value is None.</param>
 /// <param name="ForegroundColor">The color to be used for the foreground.</param>
 /// <param name="BackgroundColorTheme">The theme color to be used for the background.</param>
 /// <param name="BackgroundColorTint">The tint applied to the background theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 public void SetPattern(PatternValues PatternType, System.Drawing.Color ForegroundColor, SLThemeColorIndexValues BackgroundColorTheme, double BackgroundColorTint)
 {
     HasBeenAssignedValues = true;
     UsePatternFill = true;
     pfReal.PatternType = PatternType;
     pfReal.ForegroundColor = ForegroundColor;
     pfReal.SetBackgroundThemeColor(BackgroundColorTheme, BackgroundColorTint);
 }
Пример #17
0
        /// <summary>
        /// Set a gradient fill given the shading style and 2 colors.
        /// </summary>
        /// <param name="ShadingStyle">The gradient shading style.</param>
        /// <param name="Color1Theme">The first color as one of the theme colors.</param>
        /// <param name="Color1Tint">The tint applied to the first theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
        /// <param name="Color2Theme">The second color as one of the theme colors.</param>
        /// <param name="Color2Tint">The tint applied to the second theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
        public void SetGradientFill(SLGradientShadingStyleValues ShadingStyle, SLThemeColorIndexValues Color1Theme, double Color1Tint, SLThemeColorIndexValues Color2Theme, double Color2Tint)
        {
            SLColor clr1 = new SLColor(this.listThemeColors, this.listIndexedColors);
            SLColor clr2 = new SLColor(this.listThemeColors, this.listIndexedColors);

            clr1.SetThemeColor(Color1Theme, Color1Tint);
            clr2.SetThemeColor(Color2Theme, Color2Tint);

            SetGradientFill(ShadingStyle, clr1, clr2);
        }
Пример #18
0
 /// <summary>
 /// Set the extrusion (or depth) color.
 /// </summary>
 /// <param name="Color">The theme color to be used.</param>
 /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 public void SetExtrusionColor(SLThemeColorIndexValues Color, double Tint)
 {
     this.clrExtrusionColor.SetColor(Color, Tint, 0);
     this.HasExtrusionColor = true;
 }
Пример #19
0
 /// <summary>
 ///     Set the horizontal border with a border style and a theme color.
 /// </summary>
 /// <param name="BorderStyle">The border style. Default is none.</param>
 /// <param name="BorderColor">The theme color to be used.</param>
 public void SetHorizontalBorder(BorderStyleValues BorderStyle, SLThemeColorIndexValues BorderColor)
 {
     HorizontalBorder.BorderStyle = BorderStyle;
     HorizontalBorder.SetBorderThemeColor(BorderColor);
 }
Пример #20
0
 /// <summary>
 ///     Set the font color with one of the theme colors.
 /// </summary>
 /// <param name="ThemeColorIndex">The theme color to be used.</param>
 public void SetFontThemeColor(SLThemeColorIndexValues ThemeColorIndex)
 {
     clrFontColor.SetThemeColor(ThemeColorIndex);
     HasFontColor = clrFontColor.Color.IsEmpty ? false : true;
 }
Пример #21
0
 /// <summary>
 /// Set the contour color.
 /// </summary>
 /// <param name="Color">The theme color to be used.</param>
 /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 public void SetContourColor(SLThemeColorIndexValues Color, double Tint)
 {
     this.clrContourColor.SetColor(Color, Tint, 0);
     this.HasContourColor = true;
 }
Пример #22
0
 /// <summary>
 ///     Set the extrusion (or depth) color.
 /// </summary>
 /// <param name="Color">The theme color to be used.</param>
 /// <param name="Tint">
 ///     The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color
 ///     and positive tints lighten the theme color.
 /// </param>
 public void SetExtrusionColor(SLThemeColorIndexValues Color, double Tint)
 {
     clrExtrusionColor.SetColor(Color, Tint, 0);
     HasExtrusionColor = true;
 }
        /// <summary>
        /// </summary>
        /// <param name="Color">The theme color used.</param>
        /// <param name="Tint">
        ///     The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color
        ///     and positive tints lighten the theme color.
        /// </param>
        /// <param name="Transparency"></param>
        internal void SetColor(SLThemeColorIndexValues Color, double Tint, decimal Transparency)
        {
            IsRgbColorModelHex = false;
            switch (Color)
            {
            case SLThemeColorIndexValues.Dark1Color:
                SchemeColor = A.SchemeColorValues.Dark1;
                break;

            case SLThemeColorIndexValues.Light1Color:
                SchemeColor = A.SchemeColorValues.Light1;
                break;

            case SLThemeColorIndexValues.Dark2Color:
                SchemeColor = A.SchemeColorValues.Dark2;
                break;

            case SLThemeColorIndexValues.Light2Color:
                SchemeColor = A.SchemeColorValues.Light2;
                break;

            case SLThemeColorIndexValues.Accent1Color:
                SchemeColor = A.SchemeColorValues.Accent1;
                break;

            case SLThemeColorIndexValues.Accent2Color:
                SchemeColor = A.SchemeColorValues.Accent2;
                break;

            case SLThemeColorIndexValues.Accent3Color:
                SchemeColor = A.SchemeColorValues.Accent3;
                break;

            case SLThemeColorIndexValues.Accent4Color:
                SchemeColor = A.SchemeColorValues.Accent4;
                break;

            case SLThemeColorIndexValues.Accent5Color:
                SchemeColor = A.SchemeColorValues.Accent5;
                break;

            case SLThemeColorIndexValues.Accent6Color:
                SchemeColor = A.SchemeColorValues.Accent6;
                break;

            case SLThemeColorIndexValues.Hyperlink:
                SchemeColor = A.SchemeColorValues.Hyperlink;
                break;

            case SLThemeColorIndexValues.FollowedHyperlinkColor:
                SchemeColor = A.SchemeColorValues.FollowedHyperlink;
                break;
            }
            this.Tint         = (decimal)Tint;
            this.Transparency = Transparency;

            var index = (int)Color;

            if ((index >= 0) && (index < listThemeColors.Count))
            {
                DisplayColor = System.Drawing.Color.FromArgb(255, listThemeColors[index]);
                if (this.Tint != 0)
                {
                    DisplayColor = SLTool.ToColor(DisplayColor, Tint);
                }
            }
        }
Пример #24
0
 /// <summary>
 ///     Set the extrusion.
 /// </summary>
 /// <param name="Color">The theme color to be used.</param>
 /// <param name="Tint">
 ///     The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color
 ///     and positive tints lighten the theme color.
 /// </param>
 /// <param name="Height">
 ///     Extrusion height, ranging from 0 pt to 2147483647 pt. However, a suggested maximum is 1584 pt.
 ///     Accurate to 1/12700 of a point.
 /// </param>
 public void SetExtrusion(SLThemeColorIndexValues Color, double Tint, decimal Height)
 {
     clrExtrusionColor.SetColor(Color, Tint, 0);
     HasExtrusionColor = true;
     ExtrusionHeight   = Height;
 }
Пример #25
0
 /// <summary>
 /// Set the foreground color with one of the theme colors.
 /// </summary>
 /// <param name="ColorTheme">The theme color to be used.</param>
 public void SetPatternForegroundColor(SLThemeColorIndexValues ColorTheme)
 {
     HasBeenAssignedValues = true;
     UsePatternFill = true;
     pfReal.SetForegroundThemeColor(ColorTheme);
 }
Пример #26
0
 /// <summary>
 ///     Set the contour color.
 /// </summary>
 /// <param name="Color">The theme color to be used.</param>
 /// <param name="Tint">
 ///     The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color
 ///     and positive tints lighten the theme color.
 /// </param>
 public void SetContourColor(SLThemeColorIndexValues Color, double Tint)
 {
     clrContourColor.SetColor(Color, Tint, 0);
     HasContourColor = true;
 }
Пример #27
0
 /// <summary>
 /// Set the pattern type, foreground color and background color of the fill pattern.
 /// </summary>
 /// <param name="PatternType">The pattern type. Default value is None.</param>
 /// <param name="ForegroundColorTheme">The theme color to be used for the foreground.</param>
 /// <param name="ForegroundColorTint">The tint applied to the foreground theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 /// <param name="BackgroundColorTheme">The theme color to be used for the background.</param>
 /// <param name="BackgroundColorTint">The tint applied to the background theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 public void SetPattern(PatternValues PatternType, SLThemeColorIndexValues ForegroundColorTheme, double ForegroundColorTint, SLThemeColorIndexValues BackgroundColorTheme, double BackgroundColorTint)
 {
     HasBeenAssignedValues = true;
     UsePatternFill = true;
     pfReal.PatternType = PatternType;
     pfReal.SetForegroundThemeColor(ForegroundColorTheme, ForegroundColorTint);
     pfReal.SetBackgroundThemeColor(BackgroundColorTheme, BackgroundColorTint);
 }
Пример #28
0
 /// <summary>
 ///     Set the contour.
 /// </summary>
 /// <param name="Color">The theme color to be used.</param>
 /// <param name="Tint">
 ///     The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color
 ///     and positive tints lighten the theme color.
 /// </param>
 /// <param name="Width">
 ///     Contour width, ranging from 0 pt to 2147483647 pt. However, a suggested maximum is 1584 pt.
 ///     Accurate to 1/12700 of a point.
 /// </param>
 public void SetContour(SLThemeColorIndexValues Color, double Tint, decimal Width)
 {
     clrContourColor.SetColor(Color, Tint, 0);
     HasContourColor = true;
     ContourWidth    = Width;
 }
Пример #29
0
 /// <summary>
 /// Set the foreground color with a theme color.
 /// </summary>
 /// <param name="ThemeColorIndex">The theme color to be used.</param>
 public void SetForegroundThemeColor(SLThemeColorIndexValues ThemeColorIndex)
 {
     this.clrForegroundColor.SetThemeColor(ThemeColorIndex);
     HasForegroundColor = (clrForegroundColor.Color.IsEmpty) ? false : true;
 }
Пример #30
0
 /// <summary>
 /// Set a solid fill.
 /// </summary>
 /// <param name="FillColor">The theme color used.</param>
 /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 /// <param name="Transparency">Transparency of the color ranging from 0% to 100%. Accurate to 1/1000 of a percent.</param>
 public void SetSolidFill(SLThemeColorIndexValues FillColor, double Tint, decimal Transparency)
 {
     this.Type = SLFillType.SolidFill;
     this.SolidColor.SetColor(FillColor, Tint, Transparency);
 }
        /// <summary>
        /// Set a custom 2-color scale.
        /// </summary>
        /// <param name="MinType">The conditional format type for the minimum.</param>
        /// <param name="MinValue">The value for the minimum. If <paramref name="MinType"/> is Value, you can just set this to "0".</param>
        /// <param name="MinColor">The theme color for the minimum.</param>
        /// <param name="MinColorTint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
        /// <param name="MaxType">The conditional format type for the maximum.</param>
        /// <param name="MaxValue">The value for the maximum. If <paramref name="MaxType"/> is Value, you can just set this to "0".</param>
        /// <param name="MaxColor">The color for the maximum.</param>
        public void SetCustom2ColorScale(SLConditionalFormatMinMaxValues MinType, string MinValue, SLThemeColorIndexValues MinColor, double MinColorTint,
            SLConditionalFormatMinMaxValues MaxType, string MaxValue, System.Drawing.Color MaxColor)
        {
            List<System.Drawing.Color> listempty = new List<System.Drawing.Color>();
            SLColor minclr = new SLColor(listempty, listempty);
            if (MinColorTint == 0) minclr.SetThemeColor(MinColor);
            else minclr.SetThemeColor(MinColor, MinColorTint);
            SLColor maxclr = new SLColor(listempty, listempty);
            maxclr.Color = MaxColor;

            SLColor midclr = new SLColor(listempty, listempty);
            this.SetCustomColorScale(MinType, MinValue, minclr, false, SLConditionalFormatRangeValues.Percentile, "", midclr, MaxType, MaxValue, maxclr);
        }
Пример #32
0
 /// <summary>
 /// Set a pattern fill with a preset pattern, foreground color and background color.
 /// </summary>
 /// <param name="PresetPattern">A preset fill pattern.</param>
 /// <param name="ForegroundColorTheme">The theme color to be used for the foreground.</param>
 /// <param name="BackgroundColor">The color to be used for the background.</param>
 public void SetPatternFill(A.PresetPatternValues PresetPattern, SLThemeColorIndexValues ForegroundColorTheme, System.Drawing.Color BackgroundColor)
 {
     this.Type = SLFillType.PatternFill;
     this.PatternPreset = PresetPattern;
     this.PatternForegroundColor.SetColor(ForegroundColorTheme, 0, 0);
     this.PatternBackgroundColor.SetColor(BackgroundColor, 0);
 }
        /// <summary>
        /// Set a custom data bar formatting.
        /// </summary>
        /// <param name="ShowBarOnly">True to show only the data bar. False to show both data bar and value.</param>
        /// <param name="MinLength">The minimum length of the data bar as a percentage of the cell width. The default value is 10.</param>
        /// <param name="MaxLength">The maximum length of the data bar as a percentage of the cell width. The default value is 90.</param>
        /// <param name="ShortestBarType">The conditional format type for the shortest bar.</param>
        /// <param name="ShortestBarValue">The value for the shortest bar. If <paramref name="ShortestBarType"/> is Value, you can just set this to "0".</param>
        /// <param name="LongestBarType">The conditional format type for the longest bar.</param>
        /// <param name="LongestBarValue">The value for the longest bar. If <paramref name="LongestBarType"/> is Value, you can just set this to "0".</param>
        /// <param name="BarColor">The theme color to be used for the data bar.</param>
        /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
        public void SetCustomDataBar(bool ShowBarOnly, uint MinLength, uint MaxLength, SLConditionalFormatMinMaxValues ShortestBarType, string ShortestBarValue, SLConditionalFormatMinMaxValues LongestBarType, string LongestBarValue, SLThemeColorIndexValues BarColor, double Tint)
        {
            SLDataBarOptions dbo = new SLDataBarOptions(false);
            dbo.ShowBarOnly = ShowBarOnly;
            dbo.MinLength = MinLength;
            dbo.MaxLength = MaxLength;
            dbo.MinimumType = this.TranslateMinMaxValues(ShortestBarType);
            dbo.MinimumValue = ShortestBarValue;
            dbo.MaximumType = this.TranslateMinMaxValues(LongestBarType);
            dbo.MaximumValue = LongestBarValue;
            dbo.FillColor.SetThemeColor(BarColor, Tint);

            this.SetCustomDataBar(dbo);
        }
Пример #34
0
 /// <summary>
 /// Set a pattern fill with a preset pattern, foreground color and background color.
 /// </summary>
 /// <param name="PresetPattern">A preset fill pattern.</param>
 /// <param name="ForegroundColorTheme">The theme color to be used for the foreground.</param>
 /// <param name="ForegroundColorTint">The tint applied to the foreground theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 /// <param name="BackgroundColorTheme">The theme color to be used for the background.</param>
 /// <param name="BackgroundColorTint">The tint applied to the background theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 public void SetPatternFill(A.PresetPatternValues PresetPattern, SLThemeColorIndexValues ForegroundColorTheme, double ForegroundColorTint, SLThemeColorIndexValues BackgroundColorTheme, double BackgroundColorTint)
 {
     this.Type = SLFillType.PatternFill;
     this.PatternPreset = PresetPattern;
     this.PatternForegroundColor.SetColor(ForegroundColorTheme, ForegroundColorTint, 0);
     this.PatternBackgroundColor.SetColor(BackgroundColorTheme, BackgroundColorTint, 0);
 }
Пример #35
0
 /// <summary>
 /// Set a solid fill.
 /// </summary>
 /// <param name="FillColor">The theme color used.</param>
 /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 /// <param name="Transparency">Transparency of the color ranging from 0% to 100%. Accurate to 1/1000 of a percent.</param>
 public void SetSolidFill(SLThemeColorIndexValues FillColor, double Tint, decimal Transparency)
 {
     this.Type = SLFillType.SolidFill;
     this.SolidColor.SetColor(FillColor, Tint, Transparency);
 }
Пример #36
0
 /// <summary>
 /// Append a gradient stop given a color, the color's transparency and the position of gradient stop.
 /// </summary>
 /// <param name="Color">The theme color to be used.</param>
 /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 /// <param name="Transparency">Transparency of the color ranging from 0% to 100%. Accurate to 1/1000 of a percent.</param>
 /// <param name="Position">The position in percentage ranging from 0% to 100%. Accurate to 1/1000 of a percent.</param>
 public void AppendGradientStop(SLThemeColorIndexValues Color, double Tint, decimal Transparency, decimal Position)
 {
     this.GradientColor.AppendGradientStop(Color, Tint, Transparency, Position);
 }
Пример #37
0
 /// <summary>
 /// Set the font color with one of the theme colors, modifying the theme color with a tint value.
 /// </summary>
 /// <param name="ThemeColorIndex">The theme color to be used.</param>
 /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 public void SetFontThemeColor(SLThemeColorIndexValues ThemeColorIndex, double Tint)
 {
     this.clrFontColor.SetThemeColor(ThemeColorIndex, Tint);
     HasFontColor = (clrFontColor.Color.IsEmpty) ? false : true;
 }
Пример #38
0
 /// <summary>
 ///     Set the vertical border with a border style and a theme color, modifying the theme color with a tint value.
 /// </summary>
 /// <param name="BorderStyle">The border style. Default is none.</param>
 /// <param name="BorderColor">The theme color to be used.</param>
 /// <param name="Tint">
 ///     The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color
 ///     and positive tints lighten the theme color.
 /// </param>
 public void SetVerticalBorder(BorderStyleValues BorderStyle, SLThemeColorIndexValues BorderColor, double Tint)
 {
     VerticalBorder.BorderStyle = BorderStyle;
     VerticalBorder.SetBorderThemeColor(BorderColor, Tint);
 }
Пример #39
0
 /// <summary>
 /// Set a solid line given a color for the line and the transparency of the color.
 /// </summary>
 /// <param name="Color">The theme color to be used.</param>
 /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 /// <param name="Transparency">Transparency of the color ranging from 0% to 100%. Accurate to 1/1000 of a percent.</param>
 public void SetSolidLine(SLThemeColorIndexValues Color, double Tint, decimal Transparency)
 {
     this.UseSolidLine = true;
     this.SolidColor.SetColor(Color, Tint, Transparency);
 }
Пример #40
0
        // SLFont takes on extra duties so you don't have to learn more classes. Just like SLRstType.
        internal A.Paragraph ToParagraph()
        {
            A.Paragraph para = new A.Paragraph();
            para.ParagraphProperties = new A.ParagraphProperties();

            A.DefaultRunProperties defrunprops = new A.DefaultRunProperties();

            string sFont = string.Empty;

            if (this.FontName != null && this.FontName.Length > 0)
            {
                sFont = this.FontName;
            }

            if (this.HasFontScheme)
            {
                if (this.FontScheme == FontSchemeValues.Major)
                {
                    sFont = "+mj-lt";
                }
                else if (this.FontScheme == FontSchemeValues.Minor)
                {
                    sFont = "+mn-lt";
                }
            }

            if (this.HasFontColor)
            {
                SLA.SLColorTransform clr = new SLA.SLColorTransform(new List <System.Drawing.Color>());
                if (this.clrFontColor.Rgb != null && this.clrFontColor.Rgb.Length > 0)
                {
                    clr.SetColor(SLTool.ToColor(this.clrFontColor.Rgb), 0);

                    defrunprops.Append(new A.SolidFill()
                    {
                        RgbColorModelHex = clr.ToRgbColorModelHex()
                    });
                }
                else if (this.clrFontColor.Theme != null)
                {
                    // potential casting error? If the SLFont class was set properly, there shouldn't be errors...
                    SLThemeColorIndexValues themeindex = (SLThemeColorIndexValues)this.clrFontColor.Theme.Value;
                    if (this.clrFontColor.Tint != null)
                    {
                        clr.SetColor(themeindex, this.clrFontColor.Tint.Value, 0);
                    }
                    else
                    {
                        clr.SetColor(themeindex, 0, 0);
                    }

                    defrunprops.Append(new A.SolidFill()
                    {
                        SchemeColor = clr.ToSchemeColor()
                    });
                }
            }

            if (sFont.Length > 0)
            {
                defrunprops.Append(new A.LatinFont()
                {
                    Typeface = sFont
                });
            }

            if (this.FontSize != null)
            {
                defrunprops.FontSize = (int)(this.FontSize.Value * 100);
            }

            if (this.Bold != null)
            {
                defrunprops.Bold = this.Bold.Value;
            }

            if (this.Italic != null)
            {
                defrunprops.Italic = this.Italic.Value;
            }

            if (this.HasUnderline)
            {
                if (this.Underline == UnderlineValues.Single || this.Underline == UnderlineValues.SingleAccounting)
                {
                    defrunprops.Underline = A.TextUnderlineValues.Single;
                }
                else if (this.Underline == UnderlineValues.Double || this.Underline == UnderlineValues.DoubleAccounting)
                {
                    defrunprops.Underline = A.TextUnderlineValues.Double;
                }
            }

            if (this.Strike != null)
            {
                defrunprops.Strike = this.Strike.Value ? A.TextStrikeValues.SingleStrike : A.TextStrikeValues.NoStrike;
            }

            if (this.HasVerticalAlignment)
            {
                if (this.VerticalAlignment == VerticalAlignmentRunValues.Superscript)
                {
                    defrunprops.Baseline = 30000;
                }
                else if (this.VerticalAlignment == VerticalAlignmentRunValues.Subscript)
                {
                    defrunprops.Baseline = -25000;
                }
                else
                {
                    defrunprops.Baseline = 0;
                }
            }

            para.ParagraphProperties.Append(defrunprops);

            return(para);
        }
Пример #41
0
 /// <summary>
 /// Set the contour.
 /// </summary>
 /// <param name="Color">The theme color to be used.</param>
 /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 /// <param name="Width">Contour width, ranging from 0 pt to 2147483647 pt. However, a suggested maximum is 1584 pt. Accurate to 1/12700 of a point.</param>
 public void SetContour(SLThemeColorIndexValues Color, double Tint, decimal Width)
 {
     this.clrContourColor.SetColor(Color, Tint, 0);
     this.HasContourColor = true;
     this.ContourWidth = Width;
 }
Пример #42
0
 /// <summary>
 /// Set a solid line given a color for the line and the transparency of the color.
 /// </summary>
 /// <param name="Color">The theme color to be used.</param>
 /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 /// <param name="Transparency">Transparency of the color ranging from 0% to 100%. Accurate to 1/1000 of a percent.</param>
 public void SetSolidLine(SLThemeColorIndexValues Color, double Tint, decimal Transparency)
 {
     this.UseSolidLine = true;
     this.SolidColor.SetColor(Color, Tint, Transparency);
 }
Пример #43
0
 /// <summary>
 /// Set the extrusion.
 /// </summary>
 /// <param name="Color">The theme color to be used.</param>
 /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 /// <param name="Height">Extrusion height, ranging from 0 pt to 2147483647 pt. However, a suggested maximum is 1584 pt. Accurate to 1/12700 of a point.</param>
 public void SetExtrusion(SLThemeColorIndexValues Color, double Tint, decimal Height)
 {
     this.clrExtrusionColor.SetColor(Color, Tint, 0);
     this.HasExtrusionColor = true;
     this.ExtrusionHeight = Height;
 }
Пример #44
0
 /// <summary>
 /// Append a gradient stop given a color, the color's transparency and the position of gradient stop.
 /// </summary>
 /// <param name="Color">The theme color to be used.</param>
 /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 /// <param name="Transparency">Transparency of the color ranging from 0% to 100%. Accurate to 1/1000 of a percent.</param>
 /// <param name="Position">The position in percentage ranging from 0% to 100%. Accurate to 1/1000 of a percent.</param>
 public void AppendGradientStop(SLThemeColorIndexValues Color, double Tint, decimal Transparency, decimal Position)
 {
     this.GradientColor.AppendGradientStop(Color, Tint, Transparency, Position);
 }
Пример #45
0
 /// <summary>
 ///     Set the glow color.
 /// </summary>
 /// <param name="GlowColor">The theme color used.</param>
 /// <param name="Tint">
 ///     The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color
 ///     and positive tints lighten the theme color.
 /// </param>
 /// <param name="Transparency">Transparency of the color ranging from 0% to 100%. Accurate to 1/1000 of a percent.</param>
 /// <param name="Size">The size in points. The suggested range is 0 pt to 150 pt (both inclusive).</param>
 public void SetGlow(SLThemeColorIndexValues GlowColor, double Tint, decimal Transparency, decimal Size)
 {
     HasGlow = true;
     this.GlowColor.SetColor(GlowColor, Tint, Transparency);
     Radius = Size;
 }
Пример #46
0
 /// <summary>
 /// Set the right border with a border style and a theme color.
 /// </summary>
 /// <param name="BorderStyle">The border style. Default is none.</param>
 /// <param name="BorderColor">The theme color to be used.</param>
 public void SetRightBorder(BorderStyleValues BorderStyle, SLThemeColorIndexValues BorderColor)
 {
     this.RightBorder.BorderStyle = BorderStyle;
     this.RightBorder.SetBorderThemeColor(BorderColor);
 }
Пример #47
0
        /// <summary>
        /// Set a gradient fill given the shading style and 2 colors.
        /// </summary>
        /// <param name="ShadingStyle">The gradient shading style.</param>
        /// <param name="Color1Theme">The first color as one of the theme colors.</param>
        /// <param name="Color1Tint">The tint applied to the first theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
        /// <param name="Color2">The second color.</param>
        public void SetGradientFill(SLGradientShadingStyleValues ShadingStyle, SLThemeColorIndexValues Color1Theme, double Color1Tint, System.Drawing.Color Color2)
        {
            SLColor clr1 = new SLColor(this.listThemeColors, this.listIndexedColors);
            SLColor clr2 = new SLColor(this.listThemeColors, this.listIndexedColors);

            clr1.SetThemeColor(Color1Theme, Color1Tint);
            clr2.Rgb = string.Format("{0}{1}{2}", Color2.R.ToString("x2"), Color2.G.ToString("x2"), Color2.B.ToString("x2"));

            SetGradientFill(ShadingStyle, clr1, clr2);
        }
Пример #48
0
 /// <summary>
 /// Set the vertical border with a border style and a theme color.
 /// </summary>
 /// <param name="BorderStyle">The border style. Default is none.</param>
 /// <param name="BorderColor">The theme color to be used.</param>
 public void SetVerticalBorder(BorderStyleValues BorderStyle, SLThemeColorIndexValues BorderColor)
 {
     this.VerticalBorder.BorderStyle = BorderStyle;
     this.VerticalBorder.SetBorderThemeColor(BorderColor);
 }
Пример #49
0
 /// <summary>
 /// Set a gradient stop given a position and a color. Used in conjunction with SetCustomGradient().
 /// </summary>
 /// <param name="Position">Specifies position of the color, ranging from 0.0 to 1.0.</param>
 /// <param name="ColorTheme">The theme color to be used.</param>
 /// <param name="ColorTint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 public void AppendGradientStop(double Position, SLThemeColorIndexValues ColorTheme, double ColorTint)
 {
     SLColor clr = new SLColor(this.listThemeColors, this.listIndexedColors);
     clr.SetThemeColor(ColorTheme, ColorTint);
     GradientStop gs = new GradientStop();
     gs.Position = Position;
     gs.Color = clr.ToSpreadsheetColor();
     listGradientStops.Add(gs);
 }
Пример #50
0
 /// <summary>
 /// Set the horizontal border with a border style and a theme color, modifying the theme color with a tint value.
 /// </summary>
 /// <param name="BorderStyle">The border style. Default is none.</param>
 /// <param name="BorderColor">The theme color to be used.</param>
 /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 public void SetHorizontalBorder(BorderStyleValues BorderStyle, SLThemeColorIndexValues BorderColor, double Tint)
 {
     this.HorizontalBorder.BorderStyle = BorderStyle;
     this.HorizontalBorder.SetBorderThemeColor(BorderColor, Tint);
 }
Пример #51
0
 /// <summary>
 /// Set the background color with one of the theme colors, modifying the theme color with a tint value.
 /// </summary>
 /// <param name="ColorTheme">The theme color to be used.</param>
 /// <param name="ColorTint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 public void SetPatternBackgroundColor(SLThemeColorIndexValues ColorTheme, double ColorTint)
 {
     HasBeenAssignedValues = true;
     UsePatternFill = true;
     pfReal.SetBackgroundThemeColor(ColorTheme, ColorTint);
 }
Пример #52
0
 /// <summary>
 /// Set the color of the border with one of the theme colors, modifying the theme color with a tint value.
 /// </summary>
 /// <param name="ThemeColorIndex">The theme color to be used.</param>
 /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 public void SetBorderThemeColor(SLThemeColorIndexValues ThemeColorIndex, double Tint)
 {
     this.clrReal.SetThemeColor(ThemeColorIndex, Tint);
     HasColor = (clrReal.Color.IsEmpty) ? false : true;
 }
Пример #53
0
 /// <summary>
 /// Set the pattern type, foreground color and background color of the fill pattern.
 /// </summary>
 /// <param name="PatternType">The pattern type. Default value is None.</param>
 /// <param name="ForegroundColorTheme">The theme color to be used for the foreground.</param>
 /// <param name="ForegroundColorTint">The tint applied to the foreground theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 /// <param name="BackgroundColor">The color to be used for the background.</param>
 public void SetPattern(PatternValues PatternType, SLThemeColorIndexValues ForegroundColorTheme, double ForegroundColorTint, System.Drawing.Color BackgroundColor)
 {
     HasBeenAssignedValues = true;
     UsePatternFill = true;
     pfReal.PatternType = PatternType;
     pfReal.SetForegroundThemeColor(ForegroundColorTheme, ForegroundColorTint);
     pfReal.BackgroundColor = BackgroundColor;
 }
Пример #54
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="Color">The theme color used.</param>
        /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
        /// <param name="Transparency"></param>
        internal void SetColor(SLThemeColorIndexValues Color, double Tint, decimal Transparency)
        {
            this.IsRgbColorModelHex = false;
            switch (Color)
            {
                case SLThemeColorIndexValues.Dark1Color:
                    this.SchemeColor = A.SchemeColorValues.Dark1;
                    break;
                case SLThemeColorIndexValues.Light1Color:
                    this.SchemeColor = A.SchemeColorValues.Light1;
                    break;
                case SLThemeColorIndexValues.Dark2Color:
                    this.SchemeColor = A.SchemeColorValues.Dark2;
                    break;
                case SLThemeColorIndexValues.Light2Color:
                    this.SchemeColor = A.SchemeColorValues.Light2;
                    break;
                case SLThemeColorIndexValues.Accent1Color:
                    this.SchemeColor = A.SchemeColorValues.Accent1;
                    break;
                case SLThemeColorIndexValues.Accent2Color:
                    this.SchemeColor = A.SchemeColorValues.Accent2;
                    break;
                case SLThemeColorIndexValues.Accent3Color:
                    this.SchemeColor = A.SchemeColorValues.Accent3;
                    break;
                case SLThemeColorIndexValues.Accent4Color:
                    this.SchemeColor = A.SchemeColorValues.Accent4;
                    break;
                case SLThemeColorIndexValues.Accent5Color:
                    this.SchemeColor = A.SchemeColorValues.Accent5;
                    break;
                case SLThemeColorIndexValues.Accent6Color:
                    this.SchemeColor = A.SchemeColorValues.Accent6;
                    break;
                case SLThemeColorIndexValues.Hyperlink:
                    this.SchemeColor = A.SchemeColorValues.Hyperlink;
                    break;
                case SLThemeColorIndexValues.FollowedHyperlinkColor:
                    this.SchemeColor = A.SchemeColorValues.FollowedHyperlink;
                    break;
            }
            this.Tint = (decimal)Tint;
            this.Transparency = Transparency;

            int index = (int)Color;
            if (index >= 0 && index < this.listThemeColors.Count)
            {
                this.clrDisplayColor = System.Drawing.Color.FromArgb(255, this.listThemeColors[index]);
                if (this.Tint != 0)
                {
                    this.clrDisplayColor = SLTool.ToColor(this.clrDisplayColor, Tint);
                }
            }
        }
Пример #55
0
 /// <summary>
 /// Set a gradient fill given the shading style and 2 colors.
 /// </summary>
 /// <param name="ShadingStyle">The gradient shading style.</param>
 /// <param name="Color1Theme">The first color as one of the theme colors.</param>
 /// <param name="Color2">The second color.</param>
 public void SetGradient(SLGradientShadingStyleValues ShadingStyle, SLThemeColorIndexValues Color1Theme, System.Drawing.Color Color2)
 {
     HasBeenAssignedValues = true;
     UsePatternFill = false;
     this.gfReal.SetGradientFill(ShadingStyle, Color1Theme, Color2);
 }
Пример #56
0
 /// <summary>
 /// Sets the tab color of the sheet.
 /// </summary>
 /// <param name="TabColor">The theme color to be used.</param>
 /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 public void SetTabColor(SLThemeColorIndexValues TabColor, double Tint)
 {
     this.SheetProperties.clrTabColor.SetThemeColor(TabColor, Tint);
     this.SheetProperties.HasTabColor = (this.SheetProperties.clrTabColor.Color.IsEmpty) ? false : true;
 }
Пример #57
0
 /// <summary>
 /// Set a gradient stop given a position and a color. Used in conjunction with SetCustomGradient().
 /// </summary>
 /// <param name="Position">Specifies position of the color, ranging from 0.0 to 1.0.</param>
 /// <param name="ColorTheme">The theme color to be used.</param>
 /// <param name="ColorTint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 public void AppendGradientStop(double Position, SLThemeColorIndexValues ColorTheme, double ColorTint)
 {
     HasBeenAssignedValues = true;
     UsePatternFill = false;
     this.gfReal.AppendGradientStop(Position, ColorTheme, ColorTint);
 }
Пример #58
0
 /// <summary>
 /// Set a color using a theme color.
 /// </summary>
 /// <param name="ThemeColorIndex">The theme color to be used.</param>
 public void SetThemeColor(SLThemeColorIndexValues ThemeColorIndex)
 {
     int index = (int)ThemeColorIndex;
     if (index >= 0 && index < this.listThemeColors.Count)
     {
         this.clrDisplay = this.listThemeColors[index];
     }
     this.Auto = null;
     this.Indexed = null;
     this.Rgb = null;
     this.Theme = (uint)ThemeColorIndex;
     this.Tint = null;
 }
Пример #59
0
 /// <summary>
 /// Set the background color with a theme color.
 /// </summary>
 /// <param name="ThemeColorIndex">The theme color to be used.</param>
 /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 public void SetBackgroundThemeColor(SLThemeColorIndexValues ThemeColorIndex, double Tint)
 {
     this.clrBackgroundColor.SetThemeColor(ThemeColorIndex, Tint);
     HasBackgroundColor = (clrBackgroundColor.Color.IsEmpty) ? false : true;
 }
Пример #60
0
 /// <summary>
 /// Set a color using a theme color, modifying the theme color with a tint value.
 /// </summary>
 /// <param name="ThemeColorIndex">The theme color to be used.</param>
 /// <param name="Tint">The tint applied to the theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 public void SetThemeColor(SLThemeColorIndexValues ThemeColorIndex, double Tint)
 {
     System.Drawing.Color clrRgb = new System.Drawing.Color();
     int index = (int)ThemeColorIndex;
     if (index >= 0 && index < this.listThemeColors.Count)
     {
         clrRgb = this.listThemeColors[index];
     }
     this.Auto = null;
     this.Indexed = null;
     this.Rgb = null;
     this.Theme = (uint)ThemeColorIndex;
     this.Tint = Tint;
     this.clrDisplay = SLTool.ToColor(clrRgb, Tint);
 }