internal XLColor(XLThemeColor themeColor, Double themeTint)
 {
     _themeColor = themeColor;
     _themeTint = themeTint;
     _hashCode = 7 ^ _themeColor.GetHashCode() ^ _themeTint.GetHashCode();
     HasValue = true;
     _colorType = XLColorType.Theme;
 }
Esempio n. 2
0
 private XLColor(XLThemeColor themeColor)
 {
     _themeColor = themeColor;
     _themeTint = 0;
     _hashCode = 7 ^ _themeColor.GetHashCode() ^ _themeTint.GetHashCode();
     HasValue = true;
     _colorType = XLColorType.Theme;
 }
 public static XLColor FromTheme(XLThemeColor themeColor, Double themeTint)
 {
     return new XLColor(themeColor, themeTint);
 }
 public static XLColor FromTheme(XLThemeColor themeColor)
 {
     return new XLColor(themeColor);
 }
Esempio n. 5
0
 internal XLColor GetXLColor(XLThemeColor themeColor)
 {
     switch (themeColor)
     {
         case XLThemeColor.Text1:
             return Theme.Text1;
         case XLThemeColor.Background1:
             return Theme.Background1;
         case XLThemeColor.Text2:
             return Theme.Text2;
         case XLThemeColor.Background2:
             return Theme.Background2;
         case XLThemeColor.Accent1:
             return Theme.Accent1;
         case XLThemeColor.Accent2:
             return Theme.Accent2;
         case XLThemeColor.Accent3:
             return Theme.Accent3;
         case XLThemeColor.Accent4:
             return Theme.Accent4;
         case XLThemeColor.Accent5:
             return Theme.Accent5;
         case XLThemeColor.Accent6:
             return Theme.Accent6;
         default:
             throw new ArgumentException("Invalid theme color");
     }
 }
Esempio n. 6
0
        public static XLColor FromTheme(XLThemeColor themeColor, Double themeTint)
        {
            XLColor ret;
            lock (ByThemeTintLock)
            {
                Dictionary<Double, XLColor> themeTints;
                if (ByThemeTint.TryGetValue(themeColor, out themeTints))
                {
                    if (!themeTints.TryGetValue(themeTint, out ret))
                    {
                        ret = new XLColor(themeColor, themeTint);
                        themeTints.Add(themeTint, ret);
                    }
                }
                else
                {
                    themeTints = new Dictionary<double, XLColor>();
                    ret = new XLColor(themeColor, themeTint);
                    themeTints.Add(themeTint, ret);

                    ByThemeTint.Add(themeColor, themeTints);
                }
            }
            return ret;
        }
Esempio n. 7
0
 public static XLColor FromTheme(XLThemeColor themeColor)
 {
     XLColor ret;
     lock (ByThemeLock)
     {
         if (!ByTheme.TryGetValue(themeColor, out ret))
         {
             ret = new XLColor(themeColor);
             ByTheme.Add(themeColor, ret);
         }
     }
     return ret;
 }