Esempio n. 1
0
        private TExcelColor(TColorType aColorType, TAutomaticColor aAutomatic, long aRGB, TThemeColor aTheme, int aIndex, double aTint, bool AllowBiff8Indexed)
        {
            FColorType = aColorType;
            FTint      = aTint < -1 ? -1 : aTint > 1 ? 1 : aTint;

            //if (aColorType == TColorType.Automatic && (!Enum.IsDefined(typeof(TAutomaticColor), aAutomatic) || aAutomatic == TAutomaticColor.None))
            //    FlxMessages.ThrowException(FlxErr.ErrInvalidColorEnum, "Automatic");
            FAutomaticType = aAutomatic;

            FRGB = aRGB & 0xFFFFFFFF;

            if (aColorType == TColorType.Theme && (!Enum.IsDefined(typeof(TThemeColor), aTheme) || aTheme == TThemeColor.None))
            {
                FlxMessages.ThrowException(FlxErr.ErrInvalidColorEnum, "Theme");
            }
            FTheme = aTheme;

            if (!AllowBiff8Indexed && aColorType == TColorType.Indexed && (aIndex < 1 || aIndex > 56))
            {
                FColorType     = TColorType.Automatic;
                FAutomaticType = TAutomaticColor.None; //we won't raise an exception here, to avoid issues with old code.
                FIndex         = -9;
                return;
            }
            FIndex = aIndex;
        }
Esempio n. 2
0
 public TDrawingColor GetColorTheme(TThemeColor themeIndex)
 {
     return(ColorUtil.Empty);
 }
Esempio n. 3
0
 /// <summary>
 /// Returns a color class with an specified theme color and tint.
 /// </summary>
 /// <param name="themeColor">Theme color index.</param>
 /// <param name="tint">Tint for the color.
 /// <para></para>If you try to set a value less than -1 it will be stored as -1, and values bigger than 1 as 1. No exceptions will be raised.
 /// </param>
 /// <returns></returns>
 public static TExcelColor FromTheme(TThemeColor themeColor, double tint)
 {
     return(new TExcelColor(TColorType.Theme, TAutomaticColor.None, -1, themeColor, -9, tint));
 }
Esempio n. 4
0
 private TExcelColor(TColorType aColorType, TAutomaticColor aAutomatic, long aRGB, TThemeColor aTheme, int aIndex, double aTint)
     : this(aColorType, aAutomatic, aRGB, aTheme, aIndex, aTint, false)
 {
 }