Suppose you had a label object named Label1 and you'd like to change its background color to hex color (something like #00000;)
So here's the code:
BrushConverter bc = new BrushConverter();
Brush brush = (Brush)bc.ConvertFrom("#00000");
Brush brush = (Brush)bc.ConvertFrom("#00000");
// Change the background. I guess it'd work well on other object type like canvas or textbox
Label1.Background = brush;
Label1.Background = brush;
Good luck!