If i understand you correctly you want to get the name of the color in your Rectangle.Fill
Property as string (the way you would type it in xaml)?
I have found a solution for this here
in your code it should look like this:
SolidColorBrush brush = (SolidColorBrush)a.Fill;
Color c = brush.Color;
var colorname = (from p in typeof(System.Drawing.Color).GetProperties()
where p.PropertyType.Equals(typeof(System.Drawing.Color))
let value = (System.Drawing.Color)p.GetValue(null, null)
where value.R == c.R &&
value.G == c.G &&
value.B == c.B &&
value.A == c.A
select p.Name).DefaultIfEmpty("unknown").First();
For my Rectangle <Rectangle Name="a" Fill="Aqua"></Rectangle>
the String will return "Aqua".