internal DotIndexedColor(DotColorScheme scheme, int index) { if (scheme.IsIndexed == false) { throw new InvalidOperationException("Color scheme is not indexed"); } Scheme = scheme; Index = index; }
public DotColorScheme this[int colorsNum] { get { if (colorsNum < MinColors || colorsNum > MaxColors) { throw new ArgumentOutOfRangeException(nameof(colorsNum)); } var schemeName = Value + colorsNum; DotColorScheme scheme; if (SchemeCache.TryGetValue(schemeName, out scheme)) { return(scheme); } scheme = new DotColorScheme(schemeName, colorsNum); SchemeCache.Add(schemeName, scheme); return(scheme); } }