internal XLColor(XLThemeColor themeColor, Double themeTint) { _themeColor = themeColor; _themeTint = themeTint; _hashCode = 7 ^ _themeColor.GetHashCode() ^ _themeTint.GetHashCode(); HasValue = true; _colorType = XLColorType.Theme; }
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); }
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"); } }
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; }
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; }