/// <summary> /// Add stint /// </summary> /// <param name="color">Color of stint</param> /// <param name="textColor"></param> /// <param name="percent">Lowest percent of stint</param> /// <returns>True if added, else false</returns> public void AddStint(Color color, Color textColor, int percent) { var t = new ColorStintData() { Color = color, Percent = percent, TextColor = textColor }; Stints.Add(t); Stints.Sort(); }
private ColorStintData GetColorStintByPercent(int percent) { if (percent >= Stints[0].Percent) { return(Stints[0]); } for (int i = 1; i < Stints.Count; ++i) { if (Stints[i - 1].Percent > percent && percent >= Stints[i].Percent) { return(Stints[i]); } } return(Stints.Last()); }
public void RemoveStint(int index) { Stints.RemoveAt(index); Stints.Sort(); }
public void ChangeStintByIndex(int index, Color color) { Stints[index].Color = color; Stints.Sort(); }
public void ChangeStintByIndex(int index, int percent) { Stints[index].Percent = percent; Stints.Sort(); }