diff --git a/ImageSharp.sln.DotSettings b/ImageSharp.sln.DotSettings
index 5268172429..ece3dddb3c 100644
--- a/ImageSharp.sln.DotSettings
+++ b/ImageSharp.sln.DotSettings
@@ -388,5 +388,6 @@
True
True
True
+ True
True
\ No newline at end of file
diff --git a/src/ImageSharp/Advanced/AotCompilerTools.cs b/src/ImageSharp/Advanced/AotCompilerTools.cs
index eb6991e6a1..82df7304e5 100644
--- a/src/ImageSharp/Advanced/AotCompilerTools.cs
+++ b/src/ImageSharp/Advanced/AotCompilerTools.cs
@@ -104,7 +104,7 @@ private static void AotCompileOctreeQuantizer()
private static void AotCompileWuQuantizer()
where TPixel : struct, IPixel
{
- var test = new WuFrameQuantizer(new WuQuantizer(false));
+ var test = new WuFrameQuantizer(Configuration.Default.MemoryAllocator, new WuQuantizer(false));
test.QuantizeFrame(new ImageFrame(Configuration.Default, 1, 1));
test.AotGetPalette();
}
diff --git a/src/ImageSharp/Color/Color.Conversions.cs b/src/ImageSharp/Color/Color.Conversions.cs
new file mode 100644
index 0000000000..a524b9db1b
--- /dev/null
+++ b/src/ImageSharp/Color/Color.Conversions.cs
@@ -0,0 +1,83 @@
+// Copyright (c) Six Labors and contributors.
+// Licensed under the Apache License, Version 2.0.
+
+using System.Numerics;
+using System.Runtime.CompilerServices;
+
+using SixLabors.ImageSharp.PixelFormats;
+
+namespace SixLabors.ImageSharp
+{
+ ///
+ /// Contains constructors and implicit conversion methods.
+ ///
+ public readonly partial struct Color
+ {
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The containing the color information.
+ [MethodImpl(InliningOptions.ShortMethod)]
+ public Color(Rgba64 pixel) => this.data = pixel;
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The containing the color information.
+ [MethodImpl(InliningOptions.ShortMethod)]
+ public Color(Rgba32 pixel) => this.data = new Rgba64(pixel);
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The containing the color information.
+ [MethodImpl(InliningOptions.ShortMethod)]
+ public Color(Argb32 pixel) => this.data = new Rgba64(pixel);
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The containing the color information.
+ [MethodImpl(InliningOptions.ShortMethod)]
+ public Color(Bgra32 pixel) => this.data = new Rgba64(pixel);
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The containing the color information.
+ [MethodImpl(InliningOptions.ShortMethod)]
+ public Color(Rgb24 pixel) => this.data = new Rgba64(pixel);
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The containing the color information.
+ [MethodImpl(InliningOptions.ShortMethod)]
+ public Color(Bgr24 pixel) => this.data = new Rgba64(pixel);
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The containing the color information.
+ [MethodImpl(InliningOptions.ShortMethod)]
+ public Color(Vector4 vector) => this.data = new Rgba64(vector);
+
+ [MethodImpl(InliningOptions.ShortMethod)]
+ internal Rgba64 ToRgba64() => this.data;
+
+ [MethodImpl(InliningOptions.ShortMethod)]
+ internal Rgba32 ToRgba32() => this.data.ToRgba32();
+
+ [MethodImpl(InliningOptions.ShortMethod)]
+ internal Bgra32 ToBgra32() => this.data.ToBgra32();
+
+ [MethodImpl(InliningOptions.ShortMethod)]
+ internal Argb32 ToArgb32() => this.data.ToArgb32();
+
+ [MethodImpl(InliningOptions.ShortMethod)]
+ internal Rgb24 ToRgb24() => this.data.ToRgb24();
+
+ [MethodImpl(InliningOptions.ShortMethod)]
+ internal Bgr24 ToBgr24() => this.data.ToBgr24();
+ }
+}
\ No newline at end of file
diff --git a/src/ImageSharp/Color/Color.NamedColors.cs b/src/ImageSharp/Color/Color.NamedColors.cs
new file mode 100644
index 0000000000..8811516c1c
--- /dev/null
+++ b/src/ImageSharp/Color/Color.NamedColors.cs
@@ -0,0 +1,721 @@
+// Copyright (c) Six Labors and contributors.
+// Licensed under the Apache License, Version 2.0.
+
+namespace SixLabors.ImageSharp
+{
+ ///
+ /// Contains static named color values.
+ ///
+ public readonly partial struct Color
+ {
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F0F8FF.
+ ///
+ public static readonly Color AliceBlue = FromRgba(240, 248, 255, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FAEBD7.
+ ///
+ public static readonly Color AntiqueWhite = FromRgba(250, 235, 215, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #00FFFF.
+ ///
+ public static readonly Color Aqua = FromRgba(0, 255, 255, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #7FFFD4.
+ ///
+ public static readonly Color Aquamarine = FromRgba(127, 255, 212, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F0FFFF.
+ ///
+ public static readonly Color Azure = FromRgba(240, 255, 255, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F5F5DC.
+ ///
+ public static readonly Color Beige = FromRgba(245, 245, 220, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFE4C4.
+ ///
+ public static readonly Color Bisque = FromRgba(255, 228, 196, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #000000.
+ ///
+ public static readonly Color Black = FromRgba(0, 0, 0, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFEBCD.
+ ///
+ public static readonly Color BlanchedAlmond = FromRgba(255, 235, 205, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #0000FF.
+ ///
+ public static readonly Color Blue = FromRgba(0, 0, 255, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #8A2BE2.
+ ///
+ public static readonly Color BlueViolet = FromRgba(138, 43, 226, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #A52A2A.
+ ///
+ public static readonly Color Brown = FromRgba(165, 42, 42, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #DEB887.
+ ///
+ public static readonly Color BurlyWood = FromRgba(222, 184, 135, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #5F9EA0.
+ ///
+ public static readonly Color CadetBlue = FromRgba(95, 158, 160, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #7FFF00.
+ ///
+ public static readonly Color Chartreuse = FromRgba(127, 255, 0, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #D2691E.
+ ///
+ public static readonly Color Chocolate = FromRgba(210, 105, 30, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FF7F50.
+ ///
+ public static readonly Color Coral = FromRgba(255, 127, 80, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #6495ED.
+ ///
+ public static readonly Color CornflowerBlue = FromRgba(100, 149, 237, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFF8DC.
+ ///
+ public static readonly Color Cornsilk = FromRgba(255, 248, 220, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #DC143C.
+ ///
+ public static readonly Color Crimson = FromRgba(220, 20, 60, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #00FFFF.
+ ///
+ public static readonly Color Cyan = FromRgba(0, 255, 255, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #00008B.
+ ///
+ public static readonly Color DarkBlue = FromRgba(0, 0, 139, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #008B8B.
+ ///
+ public static readonly Color DarkCyan = FromRgba(0, 139, 139, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #B8860B.
+ ///
+ public static readonly Color DarkGoldenrod = FromRgba(184, 134, 11, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #A9A9A9.
+ ///
+ public static readonly Color DarkGray = FromRgba(169, 169, 169, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #006400.
+ ///
+ public static readonly Color DarkGreen = FromRgba(0, 100, 0, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #BDB76B.
+ ///
+ public static readonly Color DarkKhaki = FromRgba(189, 183, 107, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #8B008B.
+ ///
+ public static readonly Color DarkMagenta = FromRgba(139, 0, 139, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #556B2F.
+ ///
+ public static readonly Color DarkOliveGreen = FromRgba(85, 107, 47, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FF8C00.
+ ///
+ public static readonly Color DarkOrange = FromRgba(255, 140, 0, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #9932CC.
+ ///
+ public static readonly Color DarkOrchid = FromRgba(153, 50, 204, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #8B0000.
+ ///
+ public static readonly Color DarkRed = FromRgba(139, 0, 0, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #E9967A.
+ ///
+ public static readonly Color DarkSalmon = FromRgba(233, 150, 122, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #8FBC8B.
+ ///
+ public static readonly Color DarkSeaGreen = FromRgba(143, 188, 139, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #483D8B.
+ ///
+ public static readonly Color DarkSlateBlue = FromRgba(72, 61, 139, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #2F4F4F.
+ ///
+ public static readonly Color DarkSlateGray = FromRgba(47, 79, 79, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #00CED1.
+ ///
+ public static readonly Color DarkTurquoise = FromRgba(0, 206, 209, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #9400D3.
+ ///
+ public static readonly Color DarkViolet = FromRgba(148, 0, 211, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FF1493.
+ ///
+ public static readonly Color DeepPink = FromRgba(255, 20, 147, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #00BFFF.
+ ///
+ public static readonly Color DeepSkyBlue = FromRgba(0, 191, 255, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #696969.
+ ///
+ public static readonly Color DimGray = FromRgba(105, 105, 105, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #1E90FF.
+ ///
+ public static readonly Color DodgerBlue = FromRgba(30, 144, 255, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #B22222.
+ ///
+ public static readonly Color Firebrick = FromRgba(178, 34, 34, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFFAF0.
+ ///
+ public static readonly Color FloralWhite = FromRgba(255, 250, 240, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #228B22.
+ ///
+ public static readonly Color ForestGreen = FromRgba(34, 139, 34, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FF00FF.
+ ///
+ public static readonly Color Fuchsia = FromRgba(255, 0, 255, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #DCDCDC.
+ ///
+ public static readonly Color Gainsboro = FromRgba(220, 220, 220, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F8F8FF.
+ ///
+ public static readonly Color GhostWhite = FromRgba(248, 248, 255, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFD700.
+ ///
+ public static readonly Color Gold = FromRgba(255, 215, 0, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #DAA520.
+ ///
+ public static readonly Color Goldenrod = FromRgba(218, 165, 32, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #808080.
+ ///
+ public static readonly Color Gray = FromRgba(128, 128, 128, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #008000.
+ ///
+ public static readonly Color Green = FromRgba(0, 128, 0, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #ADFF2F.
+ ///
+ public static readonly Color GreenYellow = FromRgba(173, 255, 47, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F0FFF0.
+ ///
+ public static readonly Color Honeydew = FromRgba(240, 255, 240, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FF69B4.
+ ///
+ public static readonly Color HotPink = FromRgba(255, 105, 180, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #CD5C5C.
+ ///
+ public static readonly Color IndianRed = FromRgba(205, 92, 92, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #4B0082.
+ ///
+ public static readonly Color Indigo = FromRgba(75, 0, 130, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFFFF0.
+ ///
+ public static readonly Color Ivory = FromRgba(255, 255, 240, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F0E68C.
+ ///
+ public static readonly Color Khaki = FromRgba(240, 230, 140, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #E6E6FA.
+ ///
+ public static readonly Color Lavender = FromRgba(230, 230, 250, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFF0F5.
+ ///
+ public static readonly Color LavenderBlush = FromRgba(255, 240, 245, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #7CFC00.
+ ///
+ public static readonly Color LawnGreen = FromRgba(124, 252, 0, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFFACD.
+ ///
+ public static readonly Color LemonChiffon = FromRgba(255, 250, 205, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #ADD8E6.
+ ///
+ public static readonly Color LightBlue = FromRgba(173, 216, 230, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F08080.
+ ///
+ public static readonly Color LightCoral = FromRgba(240, 128, 128, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #E0FFFF.
+ ///
+ public static readonly Color LightCyan = FromRgba(224, 255, 255, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FAFAD2.
+ ///
+ public static readonly Color LightGoldenrodYellow = FromRgba(250, 250, 210, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #D3D3D3.
+ ///
+ public static readonly Color LightGray = FromRgba(211, 211, 211, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #90EE90.
+ ///
+ public static readonly Color LightGreen = FromRgba(144, 238, 144, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFB6C1.
+ ///
+ public static readonly Color LightPink = FromRgba(255, 182, 193, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFA07A.
+ ///
+ public static readonly Color LightSalmon = FromRgba(255, 160, 122, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #20B2AA.
+ ///
+ public static readonly Color LightSeaGreen = FromRgba(32, 178, 170, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #87CEFA.
+ ///
+ public static readonly Color LightSkyBlue = FromRgba(135, 206, 250, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #778899.
+ ///
+ public static readonly Color LightSlateGray = FromRgba(119, 136, 153, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #B0C4DE.
+ ///
+ public static readonly Color LightSteelBlue = FromRgba(176, 196, 222, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFFFE0.
+ ///
+ public static readonly Color LightYellow = FromRgba(255, 255, 224, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #00FF00.
+ ///
+ public static readonly Color Lime = FromRgba(0, 255, 0, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #32CD32.
+ ///
+ public static readonly Color LimeGreen = FromRgba(50, 205, 50, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FAF0E6.
+ ///
+ public static readonly Color Linen = FromRgba(250, 240, 230, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FF00FF.
+ ///
+ public static readonly Color Magenta = FromRgba(255, 0, 255, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #800000.
+ ///
+ public static readonly Color Maroon = FromRgba(128, 0, 0, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #66CDAA.
+ ///
+ public static readonly Color MediumAquamarine = FromRgba(102, 205, 170, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #0000CD.
+ ///
+ public static readonly Color MediumBlue = FromRgba(0, 0, 205, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #BA55D3.
+ ///
+ public static readonly Color MediumOrchid = FromRgba(186, 85, 211, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #9370DB.
+ ///
+ public static readonly Color MediumPurple = FromRgba(147, 112, 219, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #3CB371.
+ ///
+ public static readonly Color MediumSeaGreen = FromRgba(60, 179, 113, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #7B68EE.
+ ///
+ public static readonly Color MediumSlateBlue = FromRgba(123, 104, 238, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #00FA9A.
+ ///
+ public static readonly Color MediumSpringGreen = FromRgba(0, 250, 154, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #48D1CC.
+ ///
+ public static readonly Color MediumTurquoise = FromRgba(72, 209, 204, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #C71585.
+ ///
+ public static readonly Color MediumVioletRed = FromRgba(199, 21, 133, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #191970.
+ ///
+ public static readonly Color MidnightBlue = FromRgba(25, 25, 112, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F5FFFA.
+ ///
+ public static readonly Color MintCream = FromRgba(245, 255, 250, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFE4E1.
+ ///
+ public static readonly Color MistyRose = FromRgba(255, 228, 225, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFE4B5.
+ ///
+ public static readonly Color Moccasin = FromRgba(255, 228, 181, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFDEAD.
+ ///
+ public static readonly Color NavajoWhite = FromRgba(255, 222, 173, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #000080.
+ ///
+ public static readonly Color Navy = FromRgba(0, 0, 128, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FDF5E6.
+ ///
+ public static readonly Color OldLace = FromRgba(253, 245, 230, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #808000.
+ ///
+ public static readonly Color Olive = FromRgba(128, 128, 0, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #6B8E23.
+ ///
+ public static readonly Color OliveDrab = FromRgba(107, 142, 35, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFA500.
+ ///
+ public static readonly Color Orange = FromRgba(255, 165, 0, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FF4500.
+ ///
+ public static readonly Color OrangeRed = FromRgba(255, 69, 0, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #DA70D6.
+ ///
+ public static readonly Color Orchid = FromRgba(218, 112, 214, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #EEE8AA.
+ ///
+ public static readonly Color PaleGoldenrod = FromRgba(238, 232, 170, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #98FB98.
+ ///
+ public static readonly Color PaleGreen = FromRgba(152, 251, 152, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #AFEEEE.
+ ///
+ public static readonly Color PaleTurquoise = FromRgba(175, 238, 238, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #DB7093.
+ ///
+ public static readonly Color PaleVioletRed = FromRgba(219, 112, 147, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFEFD5.
+ ///
+ public static readonly Color PapayaWhip = FromRgba(255, 239, 213, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFDAB9.
+ ///
+ public static readonly Color PeachPuff = FromRgba(255, 218, 185, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #CD853F.
+ ///
+ public static readonly Color Peru = FromRgba(205, 133, 63, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFC0CB.
+ ///
+ public static readonly Color Pink = FromRgba(255, 192, 203, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #DDA0DD.
+ ///
+ public static readonly Color Plum = FromRgba(221, 160, 221, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #B0E0E6.
+ ///
+ public static readonly Color PowderBlue = FromRgba(176, 224, 230, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #800080.
+ ///
+ public static readonly Color Purple = FromRgba(128, 0, 128, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #663399.
+ ///
+ public static readonly Color RebeccaPurple = FromRgba(102, 51, 153, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FF0000.
+ ///
+ public static readonly Color Red = FromRgba(255, 0, 0, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #BC8F8F.
+ ///
+ public static readonly Color RosyBrown = FromRgba(188, 143, 143, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #4169E1.
+ ///
+ public static readonly Color RoyalBlue = FromRgba(65, 105, 225, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #8B4513.
+ ///
+ public static readonly Color SaddleBrown = FromRgba(139, 69, 19, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FA8072.
+ ///
+ public static readonly Color Salmon = FromRgba(250, 128, 114, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F4A460.
+ ///
+ public static readonly Color SandyBrown = FromRgba(244, 164, 96, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #2E8B57.
+ ///
+ public static readonly Color SeaGreen = FromRgba(46, 139, 87, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFF5EE.
+ ///
+ public static readonly Color SeaShell = FromRgba(255, 245, 238, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #A0522D.
+ ///
+ public static readonly Color Sienna = FromRgba(160, 82, 45, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #C0C0C0.
+ ///
+ public static readonly Color Silver = FromRgba(192, 192, 192, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #87CEEB.
+ ///
+ public static readonly Color SkyBlue = FromRgba(135, 206, 235, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #6A5ACD.
+ ///
+ public static readonly Color SlateBlue = FromRgba(106, 90, 205, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #708090.
+ ///
+ public static readonly Color SlateGray = FromRgba(112, 128, 144, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFFAFA.
+ ///
+ public static readonly Color Snow = FromRgba(255, 250, 250, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #00FF7F.
+ ///
+ public static readonly Color SpringGreen = FromRgba(0, 255, 127, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #4682B4.
+ ///
+ public static readonly Color SteelBlue = FromRgba(70, 130, 180, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #D2B48C.
+ ///
+ public static readonly Color Tan = FromRgba(210, 180, 140, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #008080.
+ ///
+ public static readonly Color Teal = FromRgba(0, 128, 128, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #D8BFD8.
+ ///
+ public static readonly Color Thistle = FromRgba(216, 191, 216, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FF6347.
+ ///
+ public static readonly Color Tomato = FromRgba(255, 99, 71, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFFFFF.
+ ///
+ public static readonly Color Transparent = FromRgba(255, 255, 255, 0);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #40E0D0.
+ ///
+ public static readonly Color Turquoise = FromRgba(64, 224, 208, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #EE82EE.
+ ///
+ public static readonly Color Violet = FromRgba(238, 130, 238, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F5DEB3.
+ ///
+ public static readonly Color Wheat = FromRgba(245, 222, 179, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFFFFF.
+ ///
+ public static readonly Color White = FromRgba(255, 255, 255, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F5F5F5.
+ ///
+ public static readonly Color WhiteSmoke = FromRgba(245, 245, 245, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFFF00.
+ ///
+ public static readonly Color Yellow = FromRgba(255, 255, 0, 255);
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #9ACD32.
+ ///
+ public static readonly Color YellowGreen = FromRgba(154, 205, 50, 255);
+ }
+}
\ No newline at end of file
diff --git a/src/ImageSharp/Color/Color.WebSafePalette.cs b/src/ImageSharp/Color/Color.WebSafePalette.cs
new file mode 100644
index 0000000000..8e5fb2a55b
--- /dev/null
+++ b/src/ImageSharp/Color/Color.WebSafePalette.cs
@@ -0,0 +1,166 @@
+// Copyright (c) Six Labors and contributors.
+// Licensed under the Apache License, Version 2.0.
+
+using System;
+
+namespace SixLabors.ImageSharp
+{
+ ///
+ /// Contains the definition of .
+ ///
+ public partial struct Color
+ {
+ private static readonly Lazy WebSafePaletteLazy = new Lazy(CreateWebSafePalette, true);
+
+ ///
+ /// Gets a collection of named, web safe colors as defined in the CSS Color Module Level 4.
+ ///
+ public static ReadOnlyMemory WebSafePalette => WebSafePaletteLazy.Value;
+
+ private static Color[] CreateWebSafePalette() => new[]
+ {
+ AliceBlue,
+ AntiqueWhite,
+ Aqua,
+ Aquamarine,
+ Azure,
+ Beige,
+ Bisque,
+ Black,
+ BlanchedAlmond,
+ Blue,
+ BlueViolet,
+ Brown,
+ BurlyWood,
+ CadetBlue,
+ Chartreuse,
+ Chocolate,
+ Coral,
+ CornflowerBlue,
+ Cornsilk,
+ Crimson,
+ Cyan,
+ DarkBlue,
+ DarkCyan,
+ DarkGoldenrod,
+ DarkGray,
+ DarkGreen,
+ DarkKhaki,
+ DarkMagenta,
+ DarkOliveGreen,
+ DarkOrange,
+ DarkOrchid,
+ DarkRed,
+ DarkSalmon,
+ DarkSeaGreen,
+ DarkSlateBlue,
+ DarkSlateGray,
+ DarkTurquoise,
+ DarkViolet,
+ DeepPink,
+ DeepSkyBlue,
+ DimGray,
+ DodgerBlue,
+ Firebrick,
+ FloralWhite,
+ ForestGreen,
+ Fuchsia,
+ Gainsboro,
+ GhostWhite,
+ Gold,
+ Goldenrod,
+ Gray,
+ Green,
+ GreenYellow,
+ Honeydew,
+ HotPink,
+ IndianRed,
+ Indigo,
+ Ivory,
+ Khaki,
+ Lavender,
+ LavenderBlush,
+ LawnGreen,
+ LemonChiffon,
+ LightBlue,
+ LightCoral,
+ LightCyan,
+ LightGoldenrodYellow,
+ LightGray,
+ LightGreen,
+ LightPink,
+ LightSalmon,
+ LightSeaGreen,
+ LightSkyBlue,
+ LightSlateGray,
+ LightSteelBlue,
+ LightYellow,
+ Lime,
+ LimeGreen,
+ Linen,
+ Magenta,
+ Maroon,
+ MediumAquamarine,
+ MediumBlue,
+ MediumOrchid,
+ MediumPurple,
+ MediumSeaGreen,
+ MediumSlateBlue,
+ MediumSpringGreen,
+ MediumTurquoise,
+ MediumVioletRed,
+ MidnightBlue,
+ MintCream,
+ MistyRose,
+ Moccasin,
+ NavajoWhite,
+ Navy,
+ OldLace,
+ Olive,
+ OliveDrab,
+ Orange,
+ OrangeRed,
+ Orchid,
+ PaleGoldenrod,
+ PaleGreen,
+ PaleTurquoise,
+ PaleVioletRed,
+ PapayaWhip,
+ PeachPuff,
+ Peru,
+ Pink,
+ Plum,
+ PowderBlue,
+ Purple,
+ RebeccaPurple,
+ Red,
+ RosyBrown,
+ RoyalBlue,
+ SaddleBrown,
+ Salmon,
+ SandyBrown,
+ SeaGreen,
+ SeaShell,
+ Sienna,
+ Silver,
+ SkyBlue,
+ SlateBlue,
+ SlateGray,
+ Snow,
+ SpringGreen,
+ SteelBlue,
+ Tan,
+ Teal,
+ Thistle,
+ Tomato,
+ Transparent,
+ Turquoise,
+ Violet,
+ Wheat,
+ White,
+ WhiteSmoke,
+ Yellow,
+ YellowGreen
+ };
+ }
+}
\ No newline at end of file
diff --git a/src/ImageSharp/Color/Color.WernerPalette.cs b/src/ImageSharp/Color/Color.WernerPalette.cs
new file mode 100644
index 0000000000..768fe065cd
--- /dev/null
+++ b/src/ImageSharp/Color/Color.WernerPalette.cs
@@ -0,0 +1,135 @@
+// Copyright (c) Six Labors and contributors.
+// Licensed under the Apache License, Version 2.0.
+
+using System;
+
+namespace SixLabors.ImageSharp
+{
+ ///
+ /// Contains the definition of .
+ ///
+ public partial struct Color
+ {
+ private static readonly Lazy WernerPaletteLazy = new Lazy(CreateWernerPalette, true);
+
+ ///
+ /// Gets a collection of colors as defined in the original second edition of Werner’s Nomenclature of Colours 1821.
+ /// The hex codes were collected and defined by Nicholas Rougeux .
+ ///
+ public static ReadOnlyMemory WernerPalette => WernerPaletteLazy.Value;
+
+ private static Color[] CreateWernerPalette() => new[]
+ {
+ FromHex("#f1e9cd"),
+ FromHex("#f2e7cf"),
+ FromHex("#ece6d0"),
+ FromHex("#f2eacc"),
+ FromHex("#f3e9ca"),
+ FromHex("#f2ebcd"),
+ FromHex("#e6e1c9"),
+ FromHex("#e2ddc6"),
+ FromHex("#cbc8b7"),
+ FromHex("#bfbbb0"),
+ FromHex("#bebeb3"),
+ FromHex("#b7b5ac"),
+ FromHex("#bab191"),
+ FromHex("#9c9d9a"),
+ FromHex("#8a8d84"),
+ FromHex("#5b5c61"),
+ FromHex("#555152"),
+ FromHex("#413f44"),
+ FromHex("#454445"),
+ FromHex("#423937"),
+ FromHex("#433635"),
+ FromHex("#252024"),
+ FromHex("#241f20"),
+ FromHex("#281f3f"),
+ FromHex("#1c1949"),
+ FromHex("#4f638d"),
+ FromHex("#383867"),
+ FromHex("#5c6b8f"),
+ FromHex("#657abb"),
+ FromHex("#6f88af"),
+ FromHex("#7994b5"),
+ FromHex("#6fb5a8"),
+ FromHex("#719ba2"),
+ FromHex("#8aa1a6"),
+ FromHex("#d0d5d3"),
+ FromHex("#8590ae"),
+ FromHex("#3a2f52"),
+ FromHex("#39334a"),
+ FromHex("#6c6d94"),
+ FromHex("#584c77"),
+ FromHex("#533552"),
+ FromHex("#463759"),
+ FromHex("#bfbac0"),
+ FromHex("#77747f"),
+ FromHex("#4a475c"),
+ FromHex("#b8bfaf"),
+ FromHex("#b2b599"),
+ FromHex("#979c84"),
+ FromHex("#5d6161"),
+ FromHex("#61ac86"),
+ FromHex("#a4b6a7"),
+ FromHex("#adba98"),
+ FromHex("#93b778"),
+ FromHex("#7d8c55"),
+ FromHex("#33431e"),
+ FromHex("#7c8635"),
+ FromHex("#8e9849"),
+ FromHex("#c2c190"),
+ FromHex("#67765b"),
+ FromHex("#ab924b"),
+ FromHex("#c8c76f"),
+ FromHex("#ccc050"),
+ FromHex("#ebdd99"),
+ FromHex("#ab9649"),
+ FromHex("#dbc364"),
+ FromHex("#e6d058"),
+ FromHex("#ead665"),
+ FromHex("#d09b2c"),
+ FromHex("#a36629"),
+ FromHex("#a77d35"),
+ FromHex("#f0d696"),
+ FromHex("#d7c485"),
+ FromHex("#f1d28c"),
+ FromHex("#efcc83"),
+ FromHex("#f3daa7"),
+ FromHex("#dfa837"),
+ FromHex("#ebbc71"),
+ FromHex("#d17c3f"),
+ FromHex("#92462f"),
+ FromHex("#be7249"),
+ FromHex("#bb603c"),
+ FromHex("#c76b4a"),
+ FromHex("#a75536"),
+ FromHex("#b63e36"),
+ FromHex("#b5493a"),
+ FromHex("#cd6d57"),
+ FromHex("#711518"),
+ FromHex("#e9c49d"),
+ FromHex("#eedac3"),
+ FromHex("#eecfbf"),
+ FromHex("#ce536b"),
+ FromHex("#b74a70"),
+ FromHex("#b7757c"),
+ FromHex("#612741"),
+ FromHex("#7a4848"),
+ FromHex("#3f3033"),
+ FromHex("#8d746f"),
+ FromHex("#4d3635"),
+ FromHex("#6e3b31"),
+ FromHex("#864735"),
+ FromHex("#553d3a"),
+ FromHex("#613936"),
+ FromHex("#7a4b3a"),
+ FromHex("#946943"),
+ FromHex("#c39e6d"),
+ FromHex("#513e32"),
+ FromHex("#8b7859"),
+ FromHex("#9b856b"),
+ FromHex("#766051"),
+ FromHex("#453b32")
+ };
+ }
+}
\ No newline at end of file
diff --git a/src/ImageSharp/Color/Color.cs b/src/ImageSharp/Color/Color.cs
new file mode 100644
index 0000000000..e4640ff632
--- /dev/null
+++ b/src/ImageSharp/Color/Color.cs
@@ -0,0 +1,218 @@
+// Copyright (c) Six Labors and contributors.
+// Licensed under the Apache License, Version 2.0.
+
+using System;
+using System.Buffers.Binary;
+using System.Globalization;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+using SixLabors.ImageSharp.PixelFormats;
+
+namespace SixLabors.ImageSharp
+{
+ ///
+ /// Represents a color value that is convertible to any type.
+ ///
+ ///
+ /// The internal representation and layout of this structure is hidden by intention.
+ /// It's not serializable, and it should not be considered as part of a contract.
+ /// Unlike System.Drawing.Color, has to be converted to a specific pixel value
+ /// to query the color components.
+ ///
+ public readonly partial struct Color : IEquatable
+ {
+ private readonly Rgba64 data;
+
+ [MethodImpl(InliningOptions.ShortMethod)]
+ private Color(byte r, byte g, byte b, byte a)
+ {
+ this.data = new Rgba64(
+ ImageMaths.UpscaleFrom8BitTo16Bit(r),
+ ImageMaths.UpscaleFrom8BitTo16Bit(g),
+ ImageMaths.UpscaleFrom8BitTo16Bit(b),
+ ImageMaths.UpscaleFrom8BitTo16Bit(a));
+ }
+
+ [MethodImpl(InliningOptions.ShortMethod)]
+ private Color(byte r, byte g, byte b)
+ {
+ this.data = new Rgba64(
+ ImageMaths.UpscaleFrom8BitTo16Bit(r),
+ ImageMaths.UpscaleFrom8BitTo16Bit(g),
+ ImageMaths.UpscaleFrom8BitTo16Bit(b),
+ ushort.MaxValue);
+ }
+
+ ///
+ /// Checks whether two structures are equal.
+ ///
+ /// The left hand operand.
+ /// The right hand operand.
+ ///
+ /// True if the parameter is equal to the parameter;
+ /// otherwise, false.
+ ///
+ [MethodImpl(InliningOptions.ShortMethod)]
+ public static bool operator ==(Color left, Color right)
+ {
+ return left.Equals(right);
+ }
+
+ ///
+ /// Checks whether two structures are equal.
+ ///
+ /// The left hand operand.
+ /// The right hand operand.
+ ///
+ /// True if the parameter is not equal to the parameter;
+ /// otherwise, false.
+ ///
+ [MethodImpl(InliningOptions.ShortMethod)]
+ public static bool operator !=(Color left, Color right)
+ {
+ return !left.Equals(right);
+ }
+
+ ///
+ /// Creates a from RGBA bytes.
+ ///
+ /// The red component (0-255).
+ /// The green component (0-255).
+ /// The blue component (0-255).
+ /// The alpha component (0-255).
+ /// The .
+ [MethodImpl(InliningOptions.ShortMethod)]
+ public static Color FromRgba(byte r, byte g, byte b, byte a) => new Color(r, g, b, a);
+
+ ///
+ /// Creates a from RGB bytes.
+ ///
+ /// The red component (0-255).
+ /// The green component (0-255).
+ /// The blue component (0-255).
+ /// The .
+ [MethodImpl(InliningOptions.ShortMethod)]
+ public static Color FromRgb(byte r, byte g, byte b) => new Color(r, g, b);
+
+ ///
+ /// Creates a new instance from the string representing a color in hexadecimal form.
+ ///
+ ///
+ /// The hexadecimal representation of the combined color components arranged
+ /// in rgb, rgba, rrggbb, or rrggbbaa format to match web syntax.
+ ///
+ /// Returns a that represents the color defined by the provided RGBA hex string.
+ public static Color FromHex(string hex)
+ {
+ Guard.NotNullOrWhiteSpace(hex, nameof(hex));
+
+ hex = ToRgbaHex(hex);
+
+ if (hex is null || !uint.TryParse(hex, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out uint packedValue))
+ {
+ throw new ArgumentException("Hexadecimal string is not in the correct format.", nameof(hex));
+ }
+
+ var rgba = new Rgba32(BinaryPrimitives.ReverseEndianness(packedValue));
+ return new Color(rgba);
+ }
+
+ ///
+ /// Gets the hexadecimal representation of the color instance in rrggbbaa form.
+ ///
+ /// A hexadecimal string representation of the value.
+ [MethodImpl(InliningOptions.ShortMethod)]
+ public string ToHex() => this.data.ToRgba32().ToHex();
+
+ ///
+ public override string ToString() => this.ToHex();
+
+ ///
+ /// Converts the color instance to an
+ /// implementation defined by .
+ ///
+ /// The pixel type to convert to.
+ /// The pixel value.
+ [MethodImpl(InliningOptions.ShortMethod)]
+ public TPixel ToPixel()
+ where TPixel : struct, IPixel
+ {
+ TPixel pixel = default;
+ pixel.FromRgba64(this.data);
+ return pixel;
+ }
+
+ ///
+ [MethodImpl(InliningOptions.ShortMethod)]
+ public bool Equals(Color other)
+ {
+ return this.data.PackedValue == other.data.PackedValue;
+ }
+
+ ///
+ public override bool Equals(object obj)
+ {
+ return obj is Color other && this.Equals(other);
+ }
+
+ ///
+ [MethodImpl(InliningOptions.ShortMethod)]
+ public override int GetHashCode()
+ {
+ return this.data.PackedValue.GetHashCode();
+ }
+
+ ///
+ /// Bulk convert a span of to a span of a specified pixel type.
+ ///
+ [MethodImpl(InliningOptions.ShortMethod)]
+ internal static void ToPixel(
+ Configuration configuration,
+ ReadOnlySpan source,
+ Span destination)
+ where TPixel : struct, IPixel
+ {
+ ReadOnlySpan rgba64Span = MemoryMarshal.Cast(source);
+ PixelOperations.Instance.FromRgba64(Configuration.Default, rgba64Span, destination);
+ }
+
+ ///
+ /// Converts the specified hex value to an rrggbbaa hex value.
+ ///
+ /// The hex value to convert.
+ ///
+ /// A rrggbbaa hex value.
+ ///
+ private static string ToRgbaHex(string hex)
+ {
+ if (hex[0] == '#')
+ {
+ hex = hex.Substring(1);
+ }
+
+ if (hex.Length == 8)
+ {
+ return hex;
+ }
+
+ if (hex.Length == 6)
+ {
+ return hex + "FF";
+ }
+
+ if (hex.Length < 3 || hex.Length > 4)
+ {
+ return null;
+ }
+
+ char r = hex[0];
+ char g = hex[1];
+ char b = hex[2];
+ char a = hex.Length == 3 ? 'F' : hex[3];
+
+ return new string(new[] { r, r, g, g, b, b, a, a });
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs b/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs
index 90ea673d3e..edde7dc893 100644
--- a/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs
+++ b/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs
@@ -306,12 +306,15 @@ private void Write8Bit(Stream stream, ImageFrame image)
where TPixel : struct, IPixel
{
using (IMemoryOwner colorPaletteBuffer = this.memoryAllocator.AllocateManagedByteBuffer(ColorPaletteSize8Bit, AllocationOptions.Clean))
- using (QuantizedFrame quantized = this.quantizer.CreateFrameQuantizer(this.configuration, 256).QuantizeFrame(image))
+ using (IQuantizedFrame quantized = this.quantizer.CreateFrameQuantizer(this.configuration, 256).QuantizeFrame(image))
{
Span colorPalette = colorPaletteBuffer.GetSpan();
int idx = 0;
var color = default(Rgba32);
- foreach (TPixel quantizedColor in quantized.Palette)
+ ReadOnlySpan paletteSpan = quantized.Palette.Span;
+
+ // TODO: Use bulk conversion here for better perf
+ foreach (TPixel quantizedColor in paletteSpan)
{
quantizedColor.ToRgba32(ref color);
colorPalette[idx] = color.B;
@@ -327,7 +330,7 @@ private void Write8Bit(Stream stream, ImageFrame image)
for (int y = image.Height - 1; y >= 0; y--)
{
- Span pixelSpan = quantized.GetRowSpan(y);
+ ReadOnlySpan pixelSpan = quantized.GetRowSpan(y);
stream.Write(pixelSpan);
for (int i = 0; i < this.padding; i++)
diff --git a/src/ImageSharp/Formats/Gif/GifEncoderCore.cs b/src/ImageSharp/Formats/Gif/GifEncoderCore.cs
index 12a515cca7..36e27866e9 100644
--- a/src/ImageSharp/Formats/Gif/GifEncoderCore.cs
+++ b/src/ImageSharp/Formats/Gif/GifEncoderCore.cs
@@ -95,7 +95,7 @@ public void Encode(Image image, Stream stream)
bool useGlobalTable = this.colorTableMode == GifColorTableMode.Global;
// Quantize the image returning a palette.
- QuantizedFrame quantized = null;
+ IQuantizedFrame quantized = null;
using (IFrameQuantizer frameQuantizer = this.quantizer.CreateFrameQuantizer(image.GetConfiguration()))
{
quantized = frameQuantizer.QuantizeFrame(image.Frames.RootFrame);
@@ -141,11 +141,9 @@ public void Encode(Image image, Stream stream)
stream.WriteByte(GifConstants.EndIntroducer);
}
- private void EncodeGlobal(Image image, QuantizedFrame quantized, int transparencyIndex, Stream stream)
+ private void EncodeGlobal(Image image, IQuantizedFrame quantized, int transparencyIndex, Stream stream)
where TPixel : struct, IPixel
{
- var palleteQuantizer = new PaletteQuantizer(quantized.Palette, this.quantizer.Diffuser);
-
for (int i = 0; i < image.Frames.Count; i++)
{
ImageFrame frame = image.Frames[i];
@@ -160,16 +158,19 @@ private void EncodeGlobal(Image image, QuantizedFrame qu
}
else
{
- using (IFrameQuantizer palleteFrameQuantizer = palleteQuantizer.CreateFrameQuantizer(image.GetConfiguration()))
- using (QuantizedFrame paletteQuantized = palleteFrameQuantizer.QuantizeFrame(frame))
+ using (IFrameQuantizer palleteFrameQuantizer =
+ new PaletteFrameQuantizer(this.quantizer.Diffuser, quantized.Palette))
{
- this.WriteImageData(paletteQuantized, stream);
+ using (IQuantizedFrame paletteQuantized = palleteFrameQuantizer.QuantizeFrame(frame))
+ {
+ this.WriteImageData(paletteQuantized, stream);
+ }
}
}
}
}
- private void EncodeLocal(Image image, QuantizedFrame quantized, Stream stream)
+ private void EncodeLocal(Image image, IQuantizedFrame quantized, Stream stream)
where TPixel : struct, IPixel
{
ImageFrame previousFrame = null;
@@ -221,7 +222,7 @@ private void EncodeLocal(Image image, QuantizedFrame qua
///
/// The .
///
- private int GetTransparentIndex(QuantizedFrame quantized)
+ private int GetTransparentIndex(IQuantizedFrame quantized)
where TPixel : struct, IPixel
{
// Transparent pixels are much more likely to be found at the end of a palette
@@ -232,7 +233,7 @@ private int GetTransparentIndex(QuantizedFrame quantized)
{
Span rgbaSpan = rgbaBuffer.GetSpan();
ref Rgba32 paletteRef = ref MemoryMarshal.GetReference(rgbaSpan);
- PixelOperations.Instance.ToRgba32(this.configuration, quantized.Palette, rgbaSpan);
+ PixelOperations.Instance.ToRgba32(this.configuration, quantized.Palette.Span, rgbaSpan);
for (int i = quantized.Palette.Length - 1; i >= 0; i--)
{
@@ -424,7 +425,7 @@ private void WriteImageDescriptor(ImageFrame image, bool hasColo
/// The pixel format.
/// The to encode.
/// The stream to write to.
- private void WriteColorTable(QuantizedFrame image, Stream stream)
+ private void WriteColorTable(IQuantizedFrame image, Stream stream)
where TPixel : struct, IPixel
{
// The maximum number of colors for the bit depth
@@ -435,7 +436,7 @@ private void WriteColorTable(QuantizedFrame image, Stream stream
{
PixelOperations.Instance.ToRgb24Bytes(
this.configuration,
- image.Palette.AsSpan(),
+ image.Palette.Span,
colorTable.GetSpan(),
pixelCount);
stream.Write(colorTable.Array, 0, colorTableLength);
@@ -446,9 +447,9 @@ private void WriteColorTable(QuantizedFrame image, Stream stream
/// Writes the image pixel data to the stream.
///
/// The pixel format.
- /// The containing indexed pixels.
+ /// The containing indexed pixels.
/// The stream to write to.
- private void WriteImageData(QuantizedFrame image, Stream stream)
+ private void WriteImageData(IQuantizedFrame image, Stream stream)
where TPixel : struct, IPixel
{
using (var encoder = new LzwEncoder(this.memoryAllocator, (byte)this.bitDepth))
diff --git a/src/ImageSharp/Formats/Gif/LzwEncoder.cs b/src/ImageSharp/Formats/Gif/LzwEncoder.cs
index 2d32fd23aa..b4c80a3da1 100644
--- a/src/ImageSharp/Formats/Gif/LzwEncoder.cs
+++ b/src/ImageSharp/Formats/Gif/LzwEncoder.cs
@@ -180,7 +180,7 @@ public LzwEncoder(MemoryAllocator memoryAllocator, int colorDepth)
///
/// The span of indexed pixels.
/// The stream to write to.
- public void Encode(Span indexedPixels, Stream stream)
+ public void Encode(ReadOnlySpan indexedPixels, Stream stream)
{
// Write "initial code size" byte
stream.WriteByte((byte)this.initialCodeSize);
@@ -251,7 +251,7 @@ private void ResetCodeTable()
/// The span of indexed pixels.
/// The initial bits.
/// The stream to write to.
- private void Compress(Span indexedPixels, int intialBits, Stream stream)
+ private void Compress(ReadOnlySpan indexedPixels, int intialBits, Stream stream)
{
int fcode;
int c;
@@ -375,7 +375,7 @@ private void FlushPacket(Stream outStream)
/// The
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- private int NextPixel(Span indexedPixels)
+ private int NextPixel(ReadOnlySpan indexedPixels)
{
return indexedPixels[this.position++] & 0xFF;
}
diff --git a/src/ImageSharp/Formats/Png/PngEncoderCore.cs b/src/ImageSharp/Formats/Png/PngEncoderCore.cs
index 7415b07532..cbc35f3c3e 100644
--- a/src/ImageSharp/Formats/Png/PngEncoderCore.cs
+++ b/src/ImageSharp/Formats/Png/PngEncoderCore.cs
@@ -227,7 +227,7 @@ public void Encode(Image image, Stream stream)
stream.Write(PngConstants.HeaderBytes, 0, PngConstants.HeaderBytes.Length);
- QuantizedFrame quantized = null;
+ IQuantizedFrame quantized = null;
if (this.pngColorType == PngColorType.Palette)
{
byte bits = (byte)this.pngBitDepth;
@@ -511,7 +511,7 @@ private void CollectTPixelBytes(ReadOnlySpan rowSpan)
/// The quantized pixels. Can be null.
/// The row.
/// The
- private IManagedByteBuffer EncodePixelRow(ReadOnlySpan rowSpan, QuantizedFrame quantized, int row)
+ private IManagedByteBuffer EncodePixelRow(ReadOnlySpan rowSpan, IQuantizedFrame quantized, int row)
where TPixel : struct, IPixel
{
switch (this.pngColorType)
@@ -662,11 +662,11 @@ private void WriteHeaderChunk(Stream stream, in PngHeader header)
/// The pixel format.
/// The containing image data.
/// The quantized frame.
- private void WritePaletteChunk(Stream stream, QuantizedFrame quantized)
+ private void WritePaletteChunk(Stream stream, IQuantizedFrame quantized)
where TPixel : struct, IPixel
{
// Grab the palette and write it to the stream.
- TPixel[] palette = quantized.Palette;
+ ReadOnlySpan palette = quantized.Palette.Span;
int paletteLength = Math.Min(palette.Length, 256);
int colorTableLength = paletteLength * 3;
bool anyAlpha = false;
@@ -676,7 +676,7 @@ private void WritePaletteChunk(Stream stream, QuantizedFrame qua
{
ref byte colorTableRef = ref MemoryMarshal.GetReference(colorTable.GetSpan());
ref byte alphaTableRef = ref MemoryMarshal.GetReference(alphaTable.GetSpan());
- Span quantizedSpan = quantized.GetPixelSpan();
+ ReadOnlySpan quantizedSpan = quantized.GetPixelSpan();
Rgba32 rgba = default;
@@ -808,7 +808,7 @@ private void WriteTransparencyChunk(Stream stream, PngMetadata pngMetadata)
/// The image.
/// The quantized pixel data. Can be null.
/// The stream.
- private void WriteDataChunks(ImageFrame pixels, QuantizedFrame quantized, Stream stream)
+ private void WriteDataChunks(ImageFrame pixels, IQuantizedFrame quantized, Stream stream)
where TPixel : struct, IPixel
{
this.bytesPerScanline = this.CalculateScanlineLength(this.width);
diff --git a/src/ImageSharp/ImageSharp.csproj.DotSettings b/src/ImageSharp/ImageSharp.csproj.DotSettings
index e446893e94..018ca75cdf 100644
--- a/src/ImageSharp/ImageSharp.csproj.DotSettings
+++ b/src/ImageSharp/ImageSharp.csproj.DotSettings
@@ -1,4 +1,5 @@
+ True
True
True
True
@@ -6,6 +7,7 @@
True
True
True
+ True
True
True
True
\ No newline at end of file
diff --git a/src/ImageSharp/PixelFormats/ColorBuilder{TPixel}.cs b/src/ImageSharp/PixelFormats/ColorBuilder{TPixel}.cs
index 2572b32933..c1fb13e4da 100644
--- a/src/ImageSharp/PixelFormats/ColorBuilder{TPixel}.cs
+++ b/src/ImageSharp/PixelFormats/ColorBuilder{TPixel}.cs
@@ -47,7 +47,7 @@ public static TPixel FromHex(string hex)
/// The green intensity.
/// The blue intensity.
/// Returns a that represents the color defined by the provided RGB values with 100% opacity.
- public static TPixel FromRGB(byte red, byte green, byte blue) => FromRGBA(red, green, blue, 255);
+ public static TPixel FromRgb(byte red, byte green, byte blue) => FromRgba(red, green, blue, 255);
///
/// Creates a new representation from standard RGBA bytes.
@@ -57,7 +57,7 @@ public static TPixel FromHex(string hex)
/// The blue intensity.
/// The alpha intensity.
/// Returns a that represents the color defined by the provided RGBA values.
- public static TPixel FromRGBA(byte red, byte green, byte blue, byte alpha)
+ public static TPixel FromRgba(byte red, byte green, byte blue, byte alpha)
{
TPixel color = default;
color.FromRgba32(new Rgba32(red, green, blue, alpha));
diff --git a/src/ImageSharp/PixelFormats/NamedColors{TPixel}.cs b/src/ImageSharp/PixelFormats/NamedColors{TPixel}.cs
index 7e093de042..2138e2e2f7 100644
--- a/src/ImageSharp/PixelFormats/NamedColors{TPixel}.cs
+++ b/src/ImageSharp/PixelFormats/NamedColors{TPixel}.cs
@@ -22,712 +22,712 @@ public static class NamedColors
///
/// Represents a matching the W3C definition that has an hex value of #F0F8FF.
///
- public static readonly TPixel AliceBlue = ColorBuilder.FromRGBA(240, 248, 255, 255);
+ public static readonly TPixel AliceBlue = ColorBuilder.FromRgba(240, 248, 255, 255);
///
/// Represents a matching the W3C definition that has an hex value of #FAEBD7.
///
- public static readonly TPixel AntiqueWhite = ColorBuilder.FromRGBA(250, 235, 215, 255);
+ public static readonly TPixel AntiqueWhite = ColorBuilder.FromRgba(250, 235, 215, 255);
///
/// Represents a matching the W3C definition that has an hex value of #00FFFF.
///
- public static readonly TPixel Aqua = ColorBuilder.FromRGBA(0, 255, 255, 255);
+ public static readonly TPixel Aqua = ColorBuilder.FromRgba(0, 255, 255, 255);
///
/// Represents a matching the W3C definition that has an hex value of #7FFFD4.
///
- public static readonly TPixel Aquamarine = ColorBuilder.FromRGBA(127, 255, 212, 255);
+ public static readonly TPixel Aquamarine = ColorBuilder.FromRgba(127, 255, 212, 255);
///
/// Represents a matching the W3C definition that has an hex value of #F0FFFF.
///
- public static readonly TPixel Azure = ColorBuilder.FromRGBA(240, 255, 255, 255);
+ public static readonly TPixel Azure = ColorBuilder.FromRgba(240, 255, 255, 255);
///
/// Represents a matching the W3C definition that has an hex value of #F5F5DC.
///
- public static readonly TPixel Beige = ColorBuilder.FromRGBA(245, 245, 220, 255);
+ public static readonly TPixel Beige = ColorBuilder.FromRgba(245, 245, 220, 255);
///
/// Represents a matching the W3C definition that has an hex value of #FFE4C4.
///
- public static readonly TPixel Bisque = ColorBuilder.FromRGBA(255, 228, 196, 255);
+ public static readonly TPixel Bisque = ColorBuilder.FromRgba(255, 228, 196, 255);
///
/// Represents a matching the W3C definition that has an hex value of #000000.
///
- public static readonly TPixel Black = ColorBuilder.FromRGBA(0, 0, 0, 255);
+ public static readonly TPixel Black = ColorBuilder.FromRgba(0, 0, 0, 255);
///
/// Represents a matching the W3C definition that has an hex value of #FFEBCD.
///
- public static readonly TPixel BlanchedAlmond = ColorBuilder.FromRGBA(255, 235, 205, 255);
+ public static readonly TPixel BlanchedAlmond = ColorBuilder.FromRgba(255, 235, 205, 255);
///
/// Represents a matching the W3C definition that has an hex value of #0000FF.
///
- public static readonly TPixel Blue = ColorBuilder.FromRGBA(0, 0, 255, 255);
+ public static readonly TPixel Blue = ColorBuilder.FromRgba(0, 0, 255, 255);
///
/// Represents a matching the W3C definition that has an hex value of #8A2BE2.
///
- public static readonly TPixel BlueViolet = ColorBuilder.FromRGBA(138, 43, 226, 255);
+ public static readonly TPixel BlueViolet = ColorBuilder.FromRgba(138, 43, 226, 255);
///
/// Represents a matching the W3C definition that has an hex value of #A52A2A.
///
- public static readonly TPixel Brown = ColorBuilder.FromRGBA(165, 42, 42, 255);
+ public static readonly TPixel Brown = ColorBuilder.FromRgba(165, 42, 42, 255);
///
/// Represents a matching the W3C definition that has an hex value of #DEB887.
///
- public static readonly TPixel BurlyWood = ColorBuilder.FromRGBA(222, 184, 135, 255);
+ public static readonly TPixel BurlyWood = ColorBuilder.FromRgba(222, 184, 135, 255);
///
/// Represents a matching the W3C definition that has an hex value of #5F9EA0.
///
- public static readonly TPixel CadetBlue = ColorBuilder.FromRGBA(95, 158, 160, 255);
+ public static readonly TPixel CadetBlue = ColorBuilder.FromRgba(95, 158, 160, 255);
///
/// Represents a matching the W3C definition that has an hex value of #7FFF00.
///
- public static readonly TPixel Chartreuse = ColorBuilder.FromRGBA(127, 255, 0, 255);
+ public static readonly TPixel Chartreuse = ColorBuilder.FromRgba(127, 255, 0, 255);
///
/// Represents a matching the W3C definition that has an hex value of #D2691E.
///
- public static readonly TPixel Chocolate = ColorBuilder.FromRGBA(210, 105, 30, 255);
+ public static readonly TPixel Chocolate = ColorBuilder.FromRgba(210, 105, 30, 255);
///
/// Represents a matching the W3C definition that has an hex value of #FF7F50.
///
- public static readonly TPixel Coral = ColorBuilder.FromRGBA(255, 127, 80, 255);
+ public static readonly TPixel Coral = ColorBuilder.FromRgba(255, 127, 80, 255);
///
/// Represents a matching the W3C definition that has an hex value of #6495ED.
///
- public static readonly TPixel CornflowerBlue = ColorBuilder.FromRGBA(100, 149, 237, 255);
+ public static readonly TPixel CornflowerBlue = ColorBuilder.FromRgba(100, 149, 237, 255);
///
/// Represents a matching the W3C definition that has an hex value of #FFF8DC.
///
- public static readonly TPixel Cornsilk = ColorBuilder.FromRGBA(255, 248, 220, 255);
+ public static readonly TPixel Cornsilk = ColorBuilder.FromRgba(255, 248, 220, 255);
///
/// Represents a matching the W3C definition that has an hex value of #DC143C.
///
- public static readonly TPixel Crimson = ColorBuilder.FromRGBA(220, 20, 60, 255);
+ public static readonly TPixel Crimson = ColorBuilder.FromRgba(220, 20, 60, 255);
///
/// Represents a matching the W3C definition that has an hex value of #00FFFF.
///
- public static readonly TPixel Cyan = ColorBuilder.FromRGBA(0, 255, 255, 255);
+ public static readonly TPixel Cyan = ColorBuilder.FromRgba(0, 255, 255, 255);
///
/// Represents a matching the W3C definition that has an hex value of #00008B.
///
- public static readonly TPixel DarkBlue = ColorBuilder.FromRGBA(0, 0, 139, 255);
+ public static readonly TPixel DarkBlue = ColorBuilder.FromRgba(0, 0, 139, 255);
///
/// Represents a matching the W3C definition that has an hex value of #008B8B.
///
- public static readonly TPixel DarkCyan = ColorBuilder.FromRGBA(0, 139, 139, 255);
+ public static readonly TPixel DarkCyan = ColorBuilder.FromRgba(0, 139, 139, 255);
///
/// Represents a matching the W3C definition that has an hex value of #B8860B.
///
- public static readonly TPixel DarkGoldenrod = ColorBuilder.FromRGBA(184, 134, 11, 255);
+ public static readonly TPixel DarkGoldenrod = ColorBuilder.FromRgba(184, 134, 11, 255);
///
/// Represents a matching the W3C definition that has an hex value of #A9A9A9.
///
- public static readonly TPixel DarkGray = ColorBuilder.FromRGBA(169, 169, 169, 255);
+ public static readonly TPixel DarkGray = ColorBuilder.FromRgba(169, 169, 169, 255);
///
/// Represents a matching the W3C definition that has an hex value of #006400.
///
- public static readonly TPixel DarkGreen = ColorBuilder.FromRGBA(0, 100, 0, 255);
+ public static readonly TPixel DarkGreen = ColorBuilder.FromRgba(0, 100, 0, 255);
///
/// Represents a matching the W3C definition that has an hex value of #BDB76B.
///
- public static readonly TPixel DarkKhaki = ColorBuilder.FromRGBA(189, 183, 107, 255);
+ public static readonly TPixel DarkKhaki = ColorBuilder.FromRgba(189, 183, 107, 255);
///
/// Represents a matching the W3C definition that has an hex value of #8B008B.
///
- public static readonly TPixel DarkMagenta = ColorBuilder.FromRGBA(139, 0, 139, 255);
+ public static readonly TPixel DarkMagenta = ColorBuilder.FromRgba(139, 0, 139, 255);
///
/// Represents a matching the W3C definition that has an hex value of #556B2F.
///
- public static readonly TPixel DarkOliveGreen = ColorBuilder.FromRGBA(85, 107, 47, 255);
+ public static readonly TPixel DarkOliveGreen = ColorBuilder.FromRgba(85, 107, 47, 255);
///
/// Represents a matching the W3C definition that has an hex value of #FF8C00.
///
- public static readonly TPixel DarkOrange = ColorBuilder.FromRGBA(255, 140, 0, 255);
+ public static readonly TPixel DarkOrange = ColorBuilder.FromRgba(255, 140, 0, 255);
///
/// Represents a matching the W3C definition that has an hex value of #9932CC.
///
- public static readonly TPixel DarkOrchid = ColorBuilder.FromRGBA(153, 50, 204, 255);
+ public static readonly TPixel DarkOrchid = ColorBuilder.FromRgba(153, 50, 204, 255);
///
/// Represents a matching the W3C definition that has an hex value of #8B0000.
///
- public static readonly TPixel DarkRed = ColorBuilder.FromRGBA(139, 0, 0, 255);
+ public static readonly TPixel DarkRed = ColorBuilder.FromRgba(139, 0, 0, 255);
///
/// Represents a matching the W3C definition that has an hex value of #E9967A.
///
- public static readonly TPixel DarkSalmon = ColorBuilder.FromRGBA(233, 150, 122, 255);
+ public static readonly TPixel DarkSalmon = ColorBuilder.FromRgba(233, 150, 122, 255);
///
/// Represents a matching the W3C definition that has an hex value of #8FBC8B.
///
- public static readonly TPixel DarkSeaGreen = ColorBuilder.FromRGBA(143, 188, 139, 255);
+ public static readonly TPixel DarkSeaGreen = ColorBuilder.FromRgba(143, 188, 139, 255);
///
/// Represents a matching the W3C definition that has an hex value of #483D8B.
///
- public static readonly TPixel DarkSlateBlue = ColorBuilder.FromRGBA(72, 61, 139, 255);
+ public static readonly TPixel DarkSlateBlue = ColorBuilder.FromRgba(72, 61, 139, 255);
///
/// Represents a matching the W3C definition that has an hex value of #2F4F4F.
///
- public static readonly TPixel DarkSlateGray = ColorBuilder.FromRGBA(47, 79, 79, 255);
+ public static readonly TPixel DarkSlateGray = ColorBuilder.FromRgba(47, 79, 79, 255);
///
/// Represents a matching the W3C definition that has an hex value of #00CED1.
///
- public static readonly TPixel DarkTurquoise = ColorBuilder.FromRGBA(0, 206, 209, 255);
+ public static readonly TPixel DarkTurquoise = ColorBuilder.FromRgba(0, 206, 209, 255);
///
/// Represents a matching the W3C definition that has an hex value of #9400D3.
///
- public static readonly TPixel DarkViolet = ColorBuilder.FromRGBA(148, 0, 211, 255);
+ public static readonly TPixel DarkViolet = ColorBuilder.FromRgba(148, 0, 211, 255);
///
/// Represents a matching the W3C definition that has an hex value of #FF1493.
///
- public static readonly TPixel DeepPink = ColorBuilder.FromRGBA(255, 20, 147, 255);
+ public static readonly TPixel DeepPink = ColorBuilder.FromRgba(255, 20, 147, 255);
///
/// Represents a matching the W3C definition that has an hex value of #00BFFF.
///
- public static readonly TPixel DeepSkyBlue = ColorBuilder.FromRGBA(0, 191, 255, 255);
+ public static readonly TPixel DeepSkyBlue = ColorBuilder.FromRgba(0, 191, 255, 255);
///
/// Represents a matching the W3C definition that has an hex value of #696969.
///
- public static readonly TPixel DimGray = ColorBuilder.FromRGBA(105, 105, 105, 255);
+ public static readonly TPixel DimGray = ColorBuilder.FromRgba(105, 105, 105, 255);
///
/// Represents a matching the W3C definition that has an hex value of #1E90FF.
///
- public static readonly TPixel DodgerBlue = ColorBuilder.FromRGBA(30, 144, 255, 255);
+ public static readonly TPixel DodgerBlue = ColorBuilder.FromRgba(30, 144, 255, 255);
///
/// Represents a matching the W3C definition that has an hex value of #B22222.
///
- public static readonly TPixel Firebrick = ColorBuilder.FromRGBA(178, 34, 34, 255);
+ public static readonly TPixel Firebrick = ColorBuilder.FromRgba(178, 34, 34, 255);
///
/// Represents a matching the W3C definition that has an hex value of #FFFAF0.
///
- public static readonly TPixel FloralWhite = ColorBuilder.FromRGBA(255, 250, 240, 255);
+ public static readonly TPixel FloralWhite = ColorBuilder.FromRgba(255, 250, 240, 255);
///
/// Represents a matching the W3C definition that has an hex value of #228B22.
///
- public static readonly TPixel ForestGreen = ColorBuilder.FromRGBA(34, 139, 34, 255);
+ public static readonly TPixel ForestGreen = ColorBuilder.FromRgba(34, 139, 34, 255);
///
/// Represents a matching the W3C definition that has an hex value of #FF00FF.
///
- public static readonly TPixel Fuchsia = ColorBuilder.FromRGBA(255, 0, 255, 255);
+ public static readonly TPixel Fuchsia = ColorBuilder.FromRgba(255, 0, 255, 255);
///
/// Represents a matching the W3C definition that has an hex value of #DCDCDC.
///
- public static readonly TPixel Gainsboro = ColorBuilder.FromRGBA(220, 220, 220, 255);
+ public static readonly TPixel Gainsboro = ColorBuilder.FromRgba(220, 220, 220, 255);
///
/// Represents a matching the W3C definition that has an hex value of #F8F8FF.
///
- public static readonly TPixel GhostWhite = ColorBuilder.FromRGBA(248, 248, 255, 255);
+ public static readonly TPixel GhostWhite = ColorBuilder.FromRgba(248, 248, 255, 255);
///
/// Represents a matching the W3C definition that has an hex value of #FFD700.
///
- public static readonly TPixel Gold = ColorBuilder.FromRGBA(255, 215, 0, 255);
+ public static readonly TPixel Gold = ColorBuilder.FromRgba(255, 215, 0, 255);
///
/// Represents a matching the W3C definition that has an hex value of #DAA520.
///
- public static readonly TPixel Goldenrod = ColorBuilder.FromRGBA(218, 165, 32, 255);
+ public static readonly TPixel Goldenrod = ColorBuilder.FromRgba(218, 165, 32, 255);
///
/// Represents a matching the W3C definition that has an hex value of #808080.
///
- public static readonly TPixel Gray = ColorBuilder.FromRGBA(128, 128, 128, 255);
+ public static readonly TPixel Gray = ColorBuilder.FromRgba(128, 128, 128, 255);
///
/// Represents a matching the W3C definition that has an hex value of #008000.
///
- public static readonly TPixel Green = ColorBuilder.FromRGBA(0, 128, 0, 255);
+ public static readonly TPixel Green = ColorBuilder.FromRgba(0, 128, 0, 255);
///
/// Represents a matching the W3C definition that has an hex value of #ADFF2F.
///
- public static readonly TPixel GreenYellow = ColorBuilder.FromRGBA(173, 255, 47, 255);
+ public static readonly TPixel GreenYellow = ColorBuilder.FromRgba(173, 255, 47, 255);
///
/// Represents a matching the W3C definition that has an hex value of #F0FFF0.
///
- public static readonly TPixel Honeydew = ColorBuilder.FromRGBA(240, 255, 240, 255);
+ public static readonly TPixel Honeydew = ColorBuilder.FromRgba(240, 255, 240, 255);
///
/// Represents a matching the W3C definition that has an hex value of #FF69B4.
///
- public static readonly TPixel HotPink = ColorBuilder.FromRGBA(255, 105, 180, 255);
+ public static readonly TPixel HotPink = ColorBuilder.FromRgba(255, 105, 180, 255);
///
/// Represents a matching the W3C definition that has an hex value of #CD5C5C.
///
- public static readonly TPixel IndianRed = ColorBuilder.FromRGBA(205, 92, 92, 255);
+ public static readonly TPixel IndianRed = ColorBuilder.FromRgba(205, 92, 92, 255);
///
/// Represents a matching the W3C definition that has an hex value of #4B0082.
///
- public static readonly TPixel Indigo = ColorBuilder.FromRGBA(75, 0, 130, 255);
+ public static readonly TPixel Indigo = ColorBuilder.FromRgba(75, 0, 130, 255);
///
/// Represents a matching the W3C definition that has an hex value of #FFFFF0.
///
- public static readonly TPixel Ivory = ColorBuilder.FromRGBA(255, 255, 240, 255);
+ public static readonly TPixel Ivory = ColorBuilder.FromRgba(255, 255, 240, 255);
///
/// Represents a