private static void TxtSearch_TextChanged(object sender, EventArgs e) { TextBox txt = (TextBox)sender; Color c = TryParseColor(txt); TextColorInfo info = new TextColorInfo() { TextBox = txt, Color = c, }; _txts[txt]?.Invoke(info); }
private void UpdateColorUI(TextColorInfo info) { Color col = info.Color; panColor.BackColor = col; panColor.ForeColor = col; txtRgb.Text = $"{col.R},{col.G},{col.B}"; var nfi = (NumberFormatInfo)CultureInfo.InvariantCulture.NumberFormat.Clone(); nfi.NumberGroupSeparator = " "; int colDiff = ColorUtils.ColorDiff(_savedColor, GetCursorColor()); if (colDiff == 0 && Cursor.Position != _savedPosition) { Debug.Log("SAME COLOR AS SAVED: " + _savedPosition); } txtDiff.Text = colDiff + ""; }