Skip to content

Commit 412880e

Browse files
halgabpegasus-lynx
authored andcommitted
fix Media.Color
1 parent ab58897 commit 412880e

File tree

1 file changed

+8
-4
lines changed
  • src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media

1 file changed

+8
-4
lines changed

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Color.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ string IFormattable.ToString(string format, IFormatProvider provider)
256256
}
257257

258258
/// <summary>
259-
/// Creates a string representation of this object based on the format string
260-
/// and IFormatProvider passed in.
259+
/// Creates a string representation of this object based on the format string
260+
/// and IFormatProvider passed in.
261261
/// If the provider is null, the CurrentCulture is used.
262262
/// See the documentation for IFormattable for more information.
263263
/// </summary>
@@ -294,10 +294,14 @@ internal string ConvertToString(string format, IFormatProvider provider)
294294
String uriString = safeUnescapedUri.GetComponents(UriComponents.SerializationInfoString, UriFormat.UriEscaped);
295295

296296
var sb = new StringBuilder();
297-
sb.Append(provider, $"{Parsers.s_ContextColor}{uriString}{scRgbColor.a:R}");
297+
sb.Append(provider, $"{Parsers.s_ContextColor}{uriString} {scRgbColor.a:R}{separator}");
298298
for (int i= 0; i< nativeColorValue.Length; ++i )
299299
{
300-
sb.Append(provider, $"{separator}{nativeColorValue[i]:R}");
300+
sb.Append(provider, $"{nativeColorValue[i]:R}");
301+
if (i< nativeColorValue.GetLength(0)-1 )
302+
{
303+
sb.Append(provider, $"{separator}");
304+
}
301305
}
302306
return sb.ToString();
303307
}

0 commit comments

Comments
 (0)