Browse Source

Simplfiy ToRgbaHex

af/merge-core
Jason Nelson 8 years ago
parent
commit
2e5110fdf2
  1. 5
      src/ImageSharp/PixelFormats/ColorBuilder{TPixel}.cs

5
src/ImageSharp/PixelFormats/ColorBuilder{TPixel}.cs

@ -76,7 +76,10 @@ namespace SixLabors.ImageSharp.PixelFormats
/// </returns> /// </returns>
private static string ToRgbaHex(string hex) private static string ToRgbaHex(string hex)
{ {
hex = hex.StartsWith("#") ? hex.Substring(1) : hex; if (hex[0] == '#')
{
hex = hex.Substring(1);
}
if (hex.Length == 8) if (hex.Length == 8)
{ {

Loading…
Cancel
Save