From 2e5110fdf23aa23420a43fc7ff1bfee057ec5d8b Mon Sep 17 00:00:00 2001 From: Jason Nelson Date: Wed, 9 May 2018 16:44:45 -0700 Subject: [PATCH] Simplfiy ToRgbaHex --- src/ImageSharp/PixelFormats/ColorBuilder{TPixel}.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) {