private void ColorChanged() { ColorAdapter existingColor = ColorSourceList .FirstOrDefault( caSource => caSource.A == _alphaValue && caSource.B == BlueValue && caSource.G == GreenValue && caSource.R == RedValue); ColorName = existingColor != null ? existingColor.Name : String.Empty; Color col = Color.FromArgb(AlphaValue, RedValue, GreenValue, BlueValue); string colName = GetColorName(col); var cc = new ColorAdapter(col, colName != string.Empty ? colName : ColorName); CurrentColor = cc; }
private void ExecuteAddColor(object obj) { CurrentColor.Name = ColorName; ColorSourceList.Add(CurrentColor); }