/// <summary> /// Ersetzt die Vorkommen von Wert 1 in Wert 2, funtioniert nur, wenn ein gutes Equal existiert /// </summary> /// <typeparam name="T"></typeparam> /// <param name="colors"></param> /// <param name="color1"></param> /// <param name="color2"></param> /// <returns></returns> public static ObservableCollection <Color> Replace(this ObservableCollection <Color> colors, Color color1, Color color2) { var ret = new ObservableCollection <Color>(); foreach (var color in colors) { var hexColor = color.ToHexColor(); var value = color1.ToHexColor(); ret.Add(hexColor.Equals(value) ? color2 : color); } return(ret); }