Browse Source

Fix tests

af/octree-no-pixelmap
James Jackson-South 6 years ago
parent
commit
b646cb1402
  1. 2
      src/ImageSharp/Color/Color.cs
  2. 2
      src/ImageSharp/PixelFormats/PixelImplementations/Rgba32.cs

2
src/ImageSharp/Color/Color.cs

@ -152,6 +152,8 @@ namespace SixLabors.ImageSharp
/// </returns> /// </returns>
public static Color Parse(string input) public static Color Parse(string input)
{ {
Guard.NotNull(input, nameof(input));
if (!TryParse(input, out Color color)) if (!TryParse(input, out Color color))
{ {
throw new ArgumentException("Input string is not in the correct format.", nameof(input)); throw new ArgumentException("Input string is not in the correct format.", nameof(input));

2
src/ImageSharp/PixelFormats/PixelImplementations/Rgba32.cs

@ -243,6 +243,8 @@ namespace SixLabors.ImageSharp.PixelFormats
[MethodImpl(InliningOptions.ShortMethod)] [MethodImpl(InliningOptions.ShortMethod)]
public static Rgba32 ParseHex(string hex) public static Rgba32 ParseHex(string hex)
{ {
Guard.NotNull(hex, nameof(hex));
if (!TryParseHex(hex, out Rgba32 rgba)) if (!TryParseHex(hex, out Rgba32 rgba))
{ {
throw new ArgumentException("Hexadecimal string is not in the correct format.", nameof(hex)); throw new ArgumentException("Hexadecimal string is not in the correct format.", nameof(hex));

Loading…
Cancel
Save