diff --git a/src/ImageSharp/ImageFrameCollection.cs b/src/ImageSharp/ImageFrameCollection.cs index 1c00d9e63..f2e35812b 100644 --- a/src/ImageSharp/ImageFrameCollection.cs +++ b/src/ImageSharp/ImageFrameCollection.cs @@ -23,14 +23,7 @@ namespace SixLabors.ImageSharp this.parent = parent; // Frames are already cloned within the caller - if (parent.ClearColor.HasValue) - { - this.frames.Add(new ImageFrame(parent.GetConfiguration(), width, height, parent.ClearColor.Value)); - } - else - { - this.frames.Add(new ImageFrame(parent.GetConfiguration().MemoryManager, width, height)); - } + this.frames.Add(new ImageFrame(parent.GetConfiguration(), width, height, parent.ClearColor)); } internal ImageFrameCollection(Image parent, IEnumerable> frames) @@ -150,16 +143,7 @@ namespace SixLabors.ImageSharp /// public ImageFrame CreateFrame() { - ImageFrame frame; - if (this.parent.ClearColor.HasValue) - { - frame = new ImageFrame(this.parent.GetConfiguration(), this.RootFrame.Width, this.RootFrame.Height, this.parent.ClearColor.Value); - } - else - { - frame = new ImageFrame(this.parent.GetConfiguration().MemoryManager, this.RootFrame.Width, this.RootFrame.Height); - } - + ImageFrame frame = new ImageFrame(this.parent.GetConfiguration(), this.RootFrame.Width, this.RootFrame.Height, this.parent.ClearColor); this.frames.Add(frame); return frame; } diff --git a/src/ImageSharp/Image{TPixel}.cs b/src/ImageSharp/Image{TPixel}.cs index 2aa503844..599116414 100644 --- a/src/ImageSharp/Image{TPixel}.cs +++ b/src/ImageSharp/Image{TPixel}.cs @@ -22,7 +22,7 @@ namespace SixLabors.ImageSharp { private readonly Configuration configuration; private readonly ImageFrameCollection frames; - private readonly TPixel? clearColor; + private readonly TPixel clearColor; /// /// Initializes a new instance of the class @@ -142,7 +142,7 @@ namespace SixLabors.ImageSharp /// /// Gets the clear color to initialize the image frame pixels with. /// - internal TPixel? ClearColor => this.clearColor; + internal TPixel ClearColor => this.clearColor; /// /// Gets the root frame.