Crete a value converter returning a color by the given group header key. Bind the Rectangle Fill and TextBlock Foreground properties to "Key" and use the converter. There will be something like:
<DataTemplate x:Key="GroupHeaderTemplate">
<Border Background="Transparent" Margin="0,0,0,10">
<StackPanel Background="Transparent" HorizontalAlignment="Stretch">
<TextBlock Text="{Binding Key}" Foreground="{Binding Key, Converter={StaticResource MY_FOREGROUND_CONVERTER}}" FontSize="48" FontFamily="{StaticResource PhoneFontFamilySemiLight}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
<Rectangle Fill="{Binding Key, Converter={StaticResource MY_FILL_CONVERTER}}" Height="3"/>
</StackPanel>
</Border>
</DataTemplate>