From d33f30c8815ea04432b7b02594757d65c14ede2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wies=C5=82aw=20=C5=A0olt=C3=A9s?= Date: Sat, 3 Nov 2018 15:29:26 +0100 Subject: [PATCH] Update src/Avalonia.Controls.ColorBlender/HtmlColorConverter.cs --- src/Avalonia.Controls.ColorBlender/HtmlColorConverter.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Avalonia.Controls.ColorBlender/HtmlColorConverter.cs b/src/Avalonia.Controls.ColorBlender/HtmlColorConverter.cs index d758217..11f411d 100644 --- a/src/Avalonia.Controls.ColorBlender/HtmlColorConverter.cs +++ b/src/Avalonia.Controls.ColorBlender/HtmlColorConverter.cs @@ -13,12 +13,7 @@ namespace Avalonia.Controls.ColorBlender public object Convert(IList values, Type targetType, object parameter, CultureInfo culture) { - string color = "#"; - foreach (byte val in values) - { - color += val.ToString("X2"); - } - return color; + return $"#{((byte)values[0]).ToString("X2")}{((byte)values[1]).ToString("X2")}{((byte)values[2]).ToString("X2")}"; } } }