diff --git a/src/ImageSharp/PixelFormats/ColorBuilder{TPixel}.cs b/src/ImageSharp/PixelFormats/ColorBuilder{TPixel}.cs index 184928d0e..f5ebdb3fd 100644 --- a/src/ImageSharp/PixelFormats/ColorBuilder{TPixel}.cs +++ b/src/ImageSharp/PixelFormats/ColorBuilder{TPixel}.cs @@ -76,7 +76,10 @@ namespace SixLabors.ImageSharp.PixelFormats /// private static string ToRgbaHex(string hex) { - hex = hex.StartsWith("#") ? hex.Substring(1) : hex; + if (hex[0] == '#') + { + hex = hex.Substring(1); + } if (hex.Length == 8) {