In trying to set the color of a text box in my WPF application I did

Why do I get that error ?
And how to rectify it ?
It's telling you right in the error. The Background property is of type System.Windows.Media.Brush, not System.Windows.Media.Color, so you can't assign a Color to it.
Pass a Brush into your method instead of a Color, and assign that to the Background property.
public void addToStackPanel(string argBuiltAlarm, Brush brush)
{
...
TextBox textBox = new TextBox { Background = brush };
...