diff --git a/src/ImageSharp/Colors/Color.BulkOperations.cs b/src/ImageSharp/Colors/Color.BulkOperations.cs
index e67e29356..2de8222d6 100644
--- a/src/ImageSharp/Colors/Color.BulkOperations.cs
+++ b/src/ImageSharp/Colors/Color.BulkOperations.cs
@@ -10,9 +10,14 @@ namespace ImageSharp
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
- ///
- /// Conains the definition of
- ///
+ ///
+ /// Unpacked pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255.
+ /// The color components are stored in red, green, blue, and alpha order.
+ ///
+ ///
+ /// This struct is fully mutable. This is done (against the guidelines) for the sake of performance,
+ /// as it avoids the need to create new values for modification operations.
+ ///
public partial struct Color
{
///
@@ -37,15 +42,12 @@ namespace ImageSharp
/// https://github.com/dotnet/corefx/issues/15957
///
///
- internal static unsafe void ToVector4SimdAligned(
- BufferSpan sourceColors,
- BufferSpan destVectors,
- int count)
+ internal static unsafe void ToVector4SimdAligned(BufferSpan sourceColors, BufferSpan destVectors, int count)
{
if (!Vector.IsHardwareAccelerated)
{
throw new InvalidOperationException(
- "Color.BulkOperations.ToVector4SimdAligned() should not be called when Vector.IsHardwareAccelerated == false!");
+ "Color32.BulkOperations.ToVector4SimdAligned() should not be called when Vector.IsHardwareAccelerated == false!");
}
int vecSize = Vector.Count;
@@ -125,10 +127,7 @@ namespace ImageSharp
}
///
- internal override void PackFromXyzBytes(
- BufferSpan sourceBytes,
- BufferSpan destColors,
- int count)
+ internal override void PackFromXyzBytes(BufferSpan sourceBytes, BufferSpan destColors, int count)
{
ref RGB24 sourceRef = ref Unsafe.As(ref sourceBytes.DangerousGetPinnableReference());
ref Color destRef = ref destColors.DangerousGetPinnableReference();
@@ -159,10 +158,7 @@ namespace ImageSharp
}
///
- internal override unsafe void PackFromXyzwBytes(
- BufferSpan sourceBytes,
- BufferSpan destColors,
- int count)
+ internal override unsafe void PackFromXyzwBytes(BufferSpan sourceBytes, BufferSpan destColors, int count)
{
BufferSpan.Copy(sourceBytes, destColors.AsBytes(), count * sizeof(Color));
}
@@ -174,10 +170,7 @@ namespace ImageSharp
}
///
- internal override void PackFromZyxBytes(
- BufferSpan sourceBytes,
- BufferSpan destColors,
- int count)
+ internal override void PackFromZyxBytes(BufferSpan sourceBytes, BufferSpan destColors, int count)
{
ref RGB24 sourceRef = ref Unsafe.As(ref sourceBytes.DangerousGetPinnableReference());
ref Color destRef = ref destColors.DangerousGetPinnableReference();
@@ -193,10 +186,7 @@ namespace ImageSharp
}
///
- internal override void ToZyxBytes(
- BufferSpan sourceColors,
- BufferSpan destBytes,
- int count)
+ internal override void ToZyxBytes(BufferSpan sourceColors, BufferSpan destBytes, int count)
{
ref Color sourceRef = ref sourceColors.DangerousGetPinnableReference();
ref RGB24 destRef = ref Unsafe.As(ref destBytes.DangerousGetPinnableReference());
@@ -211,10 +201,7 @@ namespace ImageSharp
}
///
- internal override void PackFromZyxwBytes(
- BufferSpan sourceBytes,
- BufferSpan destColors,
- int count)
+ internal override void PackFromZyxwBytes(BufferSpan sourceBytes, BufferSpan destColors, int count)
{
ref RGBA32 sourceRef = ref Unsafe.As(ref sourceBytes.DangerousGetPinnableReference());
ref Color destRef = ref destColors.DangerousGetPinnableReference();
@@ -229,10 +216,7 @@ namespace ImageSharp
}
///
- internal override void ToZyxwBytes(
- BufferSpan sourceColors,
- BufferSpan destBytes,
- int count)
+ internal override void ToZyxwBytes(BufferSpan sourceColors, BufferSpan destBytes, int count)
{
ref Color sourceRef = ref sourceColors.DangerousGetPinnableReference();
ref RGBA32 destRef = ref Unsafe.As(ref destBytes.DangerousGetPinnableReference());
diff --git a/src/ImageSharp/Colors/ColorDefinitions.cs b/src/ImageSharp/Colors/Color.Definitions.cs
similarity index 99%
rename from src/ImageSharp/Colors/ColorDefinitions.cs
rename to src/ImageSharp/Colors/Color.Definitions.cs
index 65165289d..4bc0d486a 100644
--- a/src/ImageSharp/Colors/ColorDefinitions.cs
+++ b/src/ImageSharp/Colors/Color.Definitions.cs
@@ -1,4 +1,4 @@
-//
+//
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
//
diff --git a/src/ImageSharp/Colors/ColorTransforms.cs b/src/ImageSharp/Colors/Color.Transforms.cs
similarity index 92%
rename from src/ImageSharp/Colors/ColorTransforms.cs
rename to src/ImageSharp/Colors/Color.Transforms.cs
index f61afbf5b..31b4aa5be 100644
--- a/src/ImageSharp/Colors/ColorTransforms.cs
+++ b/src/ImageSharp/Colors/Color.Transforms.cs
@@ -1,4 +1,4 @@
-//
+//
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
//
@@ -8,7 +8,7 @@ namespace ImageSharp
using System.Numerics;
///
- /// Packed vector type containing four 8-bit unsigned normalized values ranging from 0 to 255.
+ /// Unpacked pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255.
/// The color components are stored in red, green, blue, and alpha order.
///
///
@@ -28,7 +28,7 @@ namespace ImageSharp
public static Color operator +(Color left, Color right)
{
Vector4 add = left.ToVector4() + right.ToVector4();
- return new Color(Pack(ref add));
+ return Pack(ref add);
}
///
@@ -42,7 +42,7 @@ namespace ImageSharp
public static Color operator -(Color left, Color right)
{
Vector4 sub = left.ToVector4() - right.ToVector4();
- return new Color(Pack(ref sub));
+ return Pack(ref sub);
}
///
@@ -56,7 +56,7 @@ namespace ImageSharp
public static Color Normal(Color backdrop, Color source)
{
Vector4 normal = Vector4BlendTransforms.Normal(backdrop.ToVector4(), source.ToVector4());
- return new Color(Pack(ref normal));
+ return Pack(ref normal);
}
///
@@ -76,7 +76,7 @@ namespace ImageSharp
public static Color Multiply(Color backdrop, Color source)
{
Vector4 multiply = Vector4BlendTransforms.Multiply(backdrop.ToVector4(), source.ToVector4());
- return new Color(Pack(ref multiply));
+ return Pack(ref multiply);
}
///
@@ -95,7 +95,7 @@ namespace ImageSharp
public static Color Screen(Color backdrop, Color source)
{
Vector4 subtract = Vector4BlendTransforms.Screen(backdrop.ToVector4(), source.ToVector4());
- return new Color(Pack(ref subtract));
+ return Pack(ref subtract);
}
///
@@ -110,7 +110,7 @@ namespace ImageSharp
public static Color HardLight(Color backdrop, Color source)
{
Vector4 hardlight = Vector4BlendTransforms.HardLight(backdrop.ToVector4(), source.ToVector4());
- return new Color(Pack(ref hardlight));
+ return Pack(ref hardlight);
}
///
@@ -129,7 +129,7 @@ namespace ImageSharp
public static Color Overlay(Color backdrop, Color source)
{
Vector4 overlay = Vector4BlendTransforms.Overlay(backdrop.ToVector4(), source.ToVector4());
- return new Color(Pack(ref overlay));
+ return Pack(ref overlay);
}
///
@@ -144,7 +144,7 @@ namespace ImageSharp
public static Color Darken(Color backdrop, Color source)
{
Vector4 darken = Vector4BlendTransforms.Darken(backdrop.ToVector4(), source.ToVector4());
- return new Color(Pack(ref darken));
+ return Pack(ref darken);
}
///
@@ -159,7 +159,7 @@ namespace ImageSharp
public static Color Lighten(Color backdrop, Color source)
{
Vector4 lighten = Vector4BlendTransforms.Lighten(backdrop.ToVector4(), source.ToVector4());
- return new Color(Pack(ref lighten));
+ return Pack(ref lighten);
}
///
@@ -174,7 +174,7 @@ namespace ImageSharp
public static Color SoftLight(Color backdrop, Color source)
{
Vector4 softlight = Vector4BlendTransforms.SoftLight(backdrop.ToVector4(), source.ToVector4());
- return new Color(Pack(ref softlight));
+ return Pack(ref softlight);
}
///
@@ -188,7 +188,7 @@ namespace ImageSharp
public static Color ColorDodge(Color backdrop, Color source)
{
Vector4 dodge = Vector4BlendTransforms.Dodge(backdrop.ToVector4(), source.ToVector4());
- return new Color(Pack(ref dodge));
+ return Pack(ref dodge);
}
///
@@ -202,7 +202,7 @@ namespace ImageSharp
public static Color ColorBurn(Color backdrop, Color source)
{
Vector4 burn = Vector4BlendTransforms.Burn(backdrop.ToVector4(), source.ToVector4());
- return new Color(Pack(ref burn));
+ return Pack(ref burn);
}
///
@@ -217,7 +217,7 @@ namespace ImageSharp
public static Color Difference(Color backdrop, Color source)
{
Vector4 difference = Vector4BlendTransforms.Difference(backdrop.ToVector4(), source.ToVector4());
- return new Color(Pack(ref difference));
+ return Pack(ref difference);
}
///
@@ -232,7 +232,7 @@ namespace ImageSharp
public static Color Exclusion(Color backdrop, Color source)
{
Vector4 exclusion = Vector4BlendTransforms.Exclusion(backdrop.ToVector4(), source.ToVector4());
- return new Color(Pack(ref exclusion));
+ return Pack(ref exclusion);
}
///
diff --git a/src/ImageSharp/Colors/Color.cs b/src/ImageSharp/Colors/Color.cs
index 1e1e73bab..fb2ce38ac 100644
--- a/src/ImageSharp/Colors/Color.cs
+++ b/src/ImageSharp/Colors/Color.cs
@@ -5,21 +5,45 @@
namespace ImageSharp
{
- using System;
- using System.Globalization;
using System.Numerics;
using System.Runtime.CompilerServices;
+ using System.Runtime.InteropServices;
///
- /// Packed pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255.
+ /// Unpacked pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255.
/// The color components are stored in red, green, blue, and alpha order.
///
///
/// This struct is fully mutable. This is done (against the guidelines) for the sake of performance,
/// as it avoids the need to create new values for modification operations.
///
- public partial struct Color : IPixel, IPackedVector
+ [StructLayout(LayoutKind.Explicit)]
+ public partial struct Color : IPixel
{
+ ///
+ /// Gets or sets the red component.
+ ///
+ [FieldOffset(0)]
+ public byte R;
+
+ ///
+ /// Gets or sets the green component.
+ ///
+ [FieldOffset(1)]
+ public byte G;
+
+ ///
+ /// Gets or sets the blue component.
+ ///
+ [FieldOffset(2)]
+ public byte B;
+
+ ///
+ /// Gets or sets the alpha component.
+ ///
+ [FieldOffset(3)]
+ public byte A;
+
///
/// The shift count for the red component
///
@@ -50,11 +74,6 @@ namespace ImageSharp
///
private static readonly Vector4 Half = new Vector4(0.5F);
- ///
- /// The packed value.
- ///
- private uint packedValue;
-
///
/// Initializes a new instance of the struct.
///
@@ -62,10 +81,13 @@ namespace ImageSharp
/// The green component.
/// The blue component.
/// The alpha component.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
public Color(byte r, byte g, byte b, byte a = 255)
+ : this()
{
- this.packedValue = Pack(r, g, b, a);
+ this.R = r;
+ this.G = g;
+ this.B = b;
+ this.A = a;
}
///
@@ -75,10 +97,10 @@ namespace ImageSharp
/// The green component.
/// The blue component.
/// The alpha component.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
public Color(float r, float g, float b, float a = 1)
+ : this()
{
- this.packedValue = Pack(r, g, b, a);
+ this = Pack(r, g, b, a);
}
///
@@ -87,10 +109,10 @@ namespace ImageSharp
///
/// The vector containing the components for the packed vector.
///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
public Color(Vector3 vector)
+ : this()
{
- this.packedValue = Pack(ref vector);
+ this = Pack(ref vector);
}
///
@@ -99,108 +121,10 @@ namespace ImageSharp
///
/// The vector containing the components for the packed vector.
///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
public Color(Vector4 vector)
+ : this()
{
- this.packedValue = Pack(ref vector);
- }
-
- ///
- /// Initializes a new instance of the struct.
- ///
- ///
- /// The packed value.
- ///
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public Color(uint packed)
- {
- this.packedValue = packed;
- }
-
- ///
- /// Gets or sets the red component.
- ///
- public byte R
- {
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- get
- {
- return (byte)(this.packedValue >> RedShift);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- set
- {
- this.packedValue = this.packedValue & 0xFFFFFF00 | (uint)value << RedShift;
- }
- }
-
- ///
- /// Gets or sets the green component.
- ///
- public byte G
- {
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- get
- {
- return (byte)(this.packedValue >> GreenShift);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- set
- {
- this.packedValue = this.packedValue & 0xFFFF00FF | (uint)value << GreenShift;
- }
- }
-
- ///
- /// Gets or sets the blue component.
- ///
- public byte B
- {
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- get
- {
- return (byte)(this.packedValue >> BlueShift);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- set
- {
- this.packedValue = this.packedValue & 0xFF00FFFF | (uint)value << BlueShift;
- }
- }
-
- ///
- /// Gets or sets the alpha component.
- ///
- public byte A
- {
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- get
- {
- return (byte)(this.packedValue >> AlphaShift);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- set
- {
- this.packedValue = this.packedValue & 0x00FFFFFF | (uint)value << AlphaShift;
- }
- }
-
- ///
- public uint PackedValue
- {
- get
- {
- return this.packedValue;
- }
-
- set
- {
- this.packedValue = value;
- }
+ this = Pack(ref vector);
}
///
@@ -218,7 +142,10 @@ namespace ImageSharp
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(Color left, Color right)
{
- return left.packedValue == right.packedValue;
+ return left.R == right.R
+ && left.G == right.G
+ && left.B == right.B
+ && left.A == right.A;
}
///
@@ -232,7 +159,10 @@ namespace ImageSharp
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(Color left, Color right)
{
- return left.packedValue != right.packedValue;
+ return left.R != right.R
+ && left.G != right.G
+ && left.B != right.B
+ && left.A != right.A;
}
///
@@ -251,13 +181,16 @@ namespace ImageSharp
}
///
- public BulkPixelOperations CreateBulkOperations() => new Color.BulkOperations();
+ public BulkPixelOperations CreateBulkOperations() => new BulkOperations();
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void PackFromBytes(byte x, byte y, byte z, byte w)
{
- this.packedValue = Pack(x, y, z, w);
+ this.R = x;
+ this.G = y;
+ this.B = z;
+ this.A = w;
}
///
@@ -312,7 +245,7 @@ namespace ImageSharp
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void PackFromVector4(Vector4 vector)
{
- this.packedValue = Pack(ref vector);
+ this = Pack(ref vector);
}
///
@@ -332,7 +265,10 @@ namespace ImageSharp
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(Color other)
{
- return this.packedValue == other.packedValue;
+ return this.R == other.R
+ && this.G == other.G
+ && this.B == other.B
+ && this.A == other.A;
}
///
@@ -347,33 +283,52 @@ namespace ImageSharp
///
public override int GetHashCode()
{
- return this.packedValue.GetHashCode();
+ unchecked
+ {
+ int hashCode = this.R.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.G.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.B.GetHashCode();
+ hashCode = (hashCode * 397) ^ this.A.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ ///
+ /// Packs the four floats into a .
+ ///
+ /// The x-component
+ /// The y-component
+ /// The z-component
+ /// The w-component
+ /// The
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ private static uint Pack(byte x, byte y, byte z, byte w)
+ {
+ return (uint)(x << RedShift | y << GreenShift | z << BlueShift | w << AlphaShift);
}
///
/// Packs a into a uint.
///
/// The vector containing the values to pack.
- /// The containing the packed values.
+ /// The
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- private static uint Pack(ref Vector4 vector)
+ private static Color Pack(ref Vector4 vector)
{
vector *= MaxBytes;
vector += Half;
vector = Vector4.Clamp(vector, Vector4.Zero, MaxBytes);
- return (uint)(((byte)vector.X << RedShift)
- | ((byte)vector.Y << GreenShift)
- | ((byte)vector.Z << BlueShift)
- | (byte)vector.W << AlphaShift);
+
+ return new Color((byte)vector.X, (byte)vector.Y, (byte)vector.Z, (byte)vector.W);
}
///
/// Packs a into a uint.
///
/// The vector containing the values to pack.
- /// The containing the packed values.
+ /// The
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- private static uint Pack(ref Vector3 vector)
+ private static Color Pack(ref Vector3 vector)
{
Vector4 value = new Vector4(vector, 1);
return Pack(ref value);
@@ -386,26 +341,12 @@ namespace ImageSharp
/// The y-component
/// The z-component
/// The w-component
- /// The
+ /// The
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- private static uint Pack(float x, float y, float z, float w)
+ private static Color Pack(float x, float y, float z, float w)
{
Vector4 value = new Vector4(x, y, z, w);
return Pack(ref value);
}
-
- ///
- /// Packs the four floats into a .
- ///
- /// The x-component
- /// The y-component
- /// The z-component
- /// The w-component
- /// The
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- private static uint Pack(byte x, byte y, byte z, byte w)
- {
- return (uint)(x << RedShift | y << GreenShift | z << BlueShift | w << AlphaShift);
- }
}
}
\ No newline at end of file
diff --git a/src/ImageSharp/Colors/ColorVector.BulkOperations.cs b/src/ImageSharp/Colors/ColorVector.BulkOperations.cs
new file mode 100644
index 000000000..ab32313c0
--- /dev/null
+++ b/src/ImageSharp/Colors/ColorVector.BulkOperations.cs
@@ -0,0 +1,27 @@
+namespace ImageSharp
+{
+ using System.Numerics;
+
+ ///
+ /// Unpacked pixel type containing four 16-bit unsigned normalized values typically ranging from 0 to 1.
+ /// The color components are stored in red, green, blue, and alpha order.
+ ///
+ ///
+ /// This struct is fully mutable. This is done (against the guidelines) for the sake of performance,
+ /// as it avoids the need to create new values for modification operations.
+ ///
+ public partial struct ColorVector
+ {
+ ///
+ /// implementation optimized for .
+ ///
+ internal class BulkOperations : BulkPixelOperations
+ {
+ ///
+ internal override unsafe void ToVector4(BufferSpan sourceColors, BufferSpan destVectors, int count)
+ {
+ BufferSpan.Copy(sourceColors.AsBytes(), destVectors.AsBytes(), count * sizeof(Vector4));
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ImageSharp/Colors/ColorVector.Definitions.cs b/src/ImageSharp/Colors/ColorVector.Definitions.cs
new file mode 100644
index 000000000..955c0b9db
--- /dev/null
+++ b/src/ImageSharp/Colors/ColorVector.Definitions.cs
@@ -0,0 +1,728 @@
+//
+// Copyright (c) James Jackson-South and contributors.
+// Licensed under the Apache License, Version 2.0.
+//
+
+namespace ImageSharp
+{
+ ///
+ /// Unpacked pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255.
+ /// The color components are stored in red, green, blue, and alpha order.
+ ///
+ ///
+ /// This struct is fully mutable. This is done (against the guidelines) for the sake of performance,
+ /// as it avoids the need to create new values for modification operations.
+ ///
+ public partial struct ColorVector
+ {
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F0F8FF.
+ ///
+ public static readonly ColorVector AliceBlue = NamedColors.AliceBlue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FAEBD7.
+ ///
+ public static readonly ColorVector AntiqueWhite = NamedColors.AntiqueWhite;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #00FFFF.
+ ///
+ public static readonly ColorVector Aqua = NamedColors.Aqua;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #7FFFD4.
+ ///
+ public static readonly ColorVector Aquamarine = NamedColors.Aquamarine;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F0FFFF.
+ ///
+ public static readonly ColorVector Azure = NamedColors.Azure;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F5F5DC.
+ ///
+ public static readonly ColorVector Beige = NamedColors.Beige;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFE4C4.
+ ///
+ public static readonly ColorVector Bisque = NamedColors.Bisque;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #000000.
+ ///
+ public static readonly ColorVector Black = NamedColors.Black;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFEBCD.
+ ///
+ public static readonly ColorVector BlanchedAlmond = NamedColors.BlanchedAlmond;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #0000FF.
+ ///
+ public static readonly ColorVector Blue = NamedColors.Blue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #8A2BE2.
+ ///
+ public static readonly ColorVector BlueViolet = NamedColors.BlueViolet;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #A52A2A.
+ ///
+ public static readonly ColorVector Brown = NamedColors.Brown;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #DEB887.
+ ///
+ public static readonly ColorVector BurlyWood = NamedColors.BurlyWood;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #5F9EA0.
+ ///
+ public static readonly ColorVector CadetBlue = NamedColors.CadetBlue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #7FFF00.
+ ///
+ public static readonly ColorVector Chartreuse = NamedColors.Chartreuse;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #D2691E.
+ ///
+ public static readonly ColorVector Chocolate = NamedColors.Chocolate;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FF7F50.
+ ///
+ public static readonly ColorVector Coral = NamedColors.Coral;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #6495ED.
+ ///
+ public static readonly ColorVector CornflowerBlue = NamedColors.CornflowerBlue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFF8DC.
+ ///
+ public static readonly ColorVector Cornsilk = NamedColors.Cornsilk;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #DC143C.
+ ///
+ public static readonly ColorVector Crimson = NamedColors.Crimson;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #00FFFF.
+ ///
+ public static readonly ColorVector Cyan = NamedColors.Cyan;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #00008B.
+ ///
+ public static readonly ColorVector DarkBlue = NamedColors.DarkBlue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #008B8B.
+ ///
+ public static readonly ColorVector DarkCyan = NamedColors.DarkCyan;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #B8860B.
+ ///
+ public static readonly ColorVector DarkGoldenrod = NamedColors.DarkGoldenrod;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #A9A9A9.
+ ///
+ public static readonly ColorVector DarkGray = NamedColors.DarkGray;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #006400.
+ ///
+ public static readonly ColorVector DarkGreen = NamedColors.DarkGreen;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #BDB76B.
+ ///
+ public static readonly ColorVector DarkKhaki = NamedColors.DarkKhaki;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #8B008B.
+ ///
+ public static readonly ColorVector DarkMagenta = NamedColors.DarkMagenta;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #556B2F.
+ ///
+ public static readonly ColorVector DarkOliveGreen = NamedColors.DarkOliveGreen;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FF8C00.
+ ///
+ public static readonly ColorVector DarkOrange = NamedColors.DarkOrange;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #9932CC.
+ ///
+ public static readonly ColorVector DarkOrchid = NamedColors.DarkOrchid;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #8B0000.
+ ///
+ public static readonly ColorVector DarkRed = NamedColors.DarkRed;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #E9967A.
+ ///
+ public static readonly ColorVector DarkSalmon = NamedColors.DarkSalmon;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #8FBC8B.
+ ///
+ public static readonly ColorVector DarkSeaGreen = NamedColors.DarkSeaGreen;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #483D8B.
+ ///
+ public static readonly ColorVector DarkSlateBlue = NamedColors.DarkSlateBlue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #2F4F4F.
+ ///
+ public static readonly ColorVector DarkSlateGray = NamedColors.DarkSlateGray;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #00CED1.
+ ///
+ public static readonly ColorVector DarkTurquoise = NamedColors.DarkTurquoise;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #9400D3.
+ ///
+ public static readonly ColorVector DarkViolet = NamedColors.DarkViolet;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FF1493.
+ ///
+ public static readonly ColorVector DeepPink = NamedColors.DeepPink;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #00BFFF.
+ ///
+ public static readonly ColorVector DeepSkyBlue = NamedColors.DeepSkyBlue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #696969.
+ ///
+ public static readonly ColorVector DimGray = NamedColors.DimGray;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #1E90FF.
+ ///
+ public static readonly ColorVector DodgerBlue = NamedColors.DodgerBlue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #B22222.
+ ///
+ public static readonly ColorVector Firebrick = NamedColors.Firebrick;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFFAF0.
+ ///
+ public static readonly ColorVector FloralWhite = NamedColors.FloralWhite;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #228B22.
+ ///
+ public static readonly ColorVector ForestGreen = NamedColors.ForestGreen;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FF00FF.
+ ///
+ public static readonly ColorVector Fuchsia = NamedColors.Fuchsia;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #DCDCDC.
+ ///
+ public static readonly ColorVector Gainsboro = NamedColors.Gainsboro;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F8F8FF.
+ ///
+ public static readonly ColorVector GhostWhite = NamedColors.GhostWhite;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFD700.
+ ///
+ public static readonly ColorVector Gold = NamedColors.Gold;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #DAA520.
+ ///
+ public static readonly ColorVector Goldenrod = NamedColors.Goldenrod;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #808080.
+ ///
+ public static readonly ColorVector Gray = NamedColors.Gray;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #008000.
+ ///
+ public static readonly ColorVector Green = NamedColors.Green;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #ADFF2F.
+ ///
+ public static readonly ColorVector GreenYellow = NamedColors.GreenYellow;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F0FFF0.
+ ///
+ public static readonly ColorVector Honeydew = NamedColors.Honeydew;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FF69B4.
+ ///
+ public static readonly ColorVector HotPink = NamedColors.HotPink;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #CD5C5C.
+ ///
+ public static readonly ColorVector IndianRed = NamedColors.IndianRed;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #4B0082.
+ ///
+ public static readonly ColorVector Indigo = NamedColors.Indigo;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFFFF0.
+ ///
+ public static readonly ColorVector Ivory = NamedColors.Ivory;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F0E68C.
+ ///
+ public static readonly ColorVector Khaki = NamedColors.Khaki;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #E6E6FA.
+ ///
+ public static readonly ColorVector Lavender = NamedColors.Lavender;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFF0F5.
+ ///
+ public static readonly ColorVector LavenderBlush = NamedColors.LavenderBlush;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #7CFC00.
+ ///
+ public static readonly ColorVector LawnGreen = NamedColors.LawnGreen;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFFACD.
+ ///
+ public static readonly ColorVector LemonChiffon = NamedColors.LemonChiffon;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #ADD8E6.
+ ///
+ public static readonly ColorVector LightBlue = NamedColors.LightBlue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F08080.
+ ///
+ public static readonly ColorVector LightCoral = NamedColors.LightCoral;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #E0FFFF.
+ ///
+ public static readonly ColorVector LightCyan = NamedColors.LightCyan;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FAFAD2.
+ ///
+ public static readonly ColorVector LightGoldenrodYellow = NamedColors.LightGoldenrodYellow;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #D3D3D3.
+ ///
+ public static readonly ColorVector LightGray = NamedColors.LightGray;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #90EE90.
+ ///
+ public static readonly ColorVector LightGreen = NamedColors.LightGreen;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFB6C1.
+ ///
+ public static readonly ColorVector LightPink = NamedColors.LightPink;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFA07A.
+ ///
+ public static readonly ColorVector LightSalmon = NamedColors.LightSalmon;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #20B2AA.
+ ///
+ public static readonly ColorVector LightSeaGreen = NamedColors.LightSeaGreen;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #87CEFA.
+ ///
+ public static readonly ColorVector LightSkyBlue = NamedColors.LightSkyBlue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #778899.
+ ///
+ public static readonly ColorVector LightSlateGray = NamedColors.LightSlateGray;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #B0C4DE.
+ ///
+ public static readonly ColorVector LightSteelBlue = NamedColors.LightSteelBlue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFFFE0.
+ ///
+ public static readonly ColorVector LightYellow = NamedColors.LightYellow;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #00FF00.
+ ///
+ public static readonly ColorVector Lime = NamedColors.Lime;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #32CD32.
+ ///
+ public static readonly ColorVector LimeGreen = NamedColors.LimeGreen;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FAF0E6.
+ ///
+ public static readonly ColorVector Linen = NamedColors.Linen;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FF00FF.
+ ///
+ public static readonly ColorVector Magenta = NamedColors.Magenta;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #800000.
+ ///
+ public static readonly ColorVector Maroon = NamedColors.Maroon;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #66CDAA.
+ ///
+ public static readonly ColorVector MediumAquamarine = NamedColors.MediumAquamarine;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #0000CD.
+ ///
+ public static readonly ColorVector MediumBlue = NamedColors.MediumBlue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #BA55D3.
+ ///
+ public static readonly ColorVector MediumOrchid = NamedColors.MediumOrchid;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #9370DB.
+ ///
+ public static readonly ColorVector MediumPurple = NamedColors.MediumPurple;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #3CB371.
+ ///
+ public static readonly ColorVector MediumSeaGreen = NamedColors.MediumSeaGreen;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #7B68EE.
+ ///
+ public static readonly ColorVector MediumSlateBlue = NamedColors.MediumSlateBlue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #00FA9A.
+ ///
+ public static readonly ColorVector MediumSpringGreen = NamedColors.MediumSpringGreen;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #48D1CC.
+ ///
+ public static readonly ColorVector MediumTurquoise = NamedColors.MediumTurquoise;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #C71585.
+ ///
+ public static readonly ColorVector MediumVioletRed = NamedColors.MediumVioletRed;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #191970.
+ ///
+ public static readonly ColorVector MidnightBlue = NamedColors.MidnightBlue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F5FFFA.
+ ///
+ public static readonly ColorVector MintCream = NamedColors.MintCream;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFE4E1.
+ ///
+ public static readonly ColorVector MistyRose = NamedColors.MistyRose;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFE4B5.
+ ///
+ public static readonly ColorVector Moccasin = NamedColors.Moccasin;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFDEAD.
+ ///
+ public static readonly ColorVector NavajoWhite = NamedColors.NavajoWhite;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #000080.
+ ///
+ public static readonly ColorVector Navy = NamedColors.Navy;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FDF5E6.
+ ///
+ public static readonly ColorVector OldLace = NamedColors.OldLace;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #808000.
+ ///
+ public static readonly ColorVector Olive = NamedColors.Olive;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #6B8E23.
+ ///
+ public static readonly ColorVector OliveDrab = NamedColors.OliveDrab;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFA500.
+ ///
+ public static readonly ColorVector Orange = NamedColors.Orange;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FF4500.
+ ///
+ public static readonly ColorVector OrangeRed = NamedColors.OrangeRed;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #DA70D6.
+ ///
+ public static readonly ColorVector Orchid = NamedColors.Orchid;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #EEE8AA.
+ ///
+ public static readonly ColorVector PaleGoldenrod = NamedColors.PaleGoldenrod;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #98FB98.
+ ///
+ public static readonly ColorVector PaleGreen = NamedColors.PaleGreen;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #AFEEEE.
+ ///
+ public static readonly ColorVector PaleTurquoise = NamedColors.PaleTurquoise;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #DB7093.
+ ///
+ public static readonly ColorVector PaleVioletRed = NamedColors.PaleVioletRed;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFEFD5.
+ ///
+ public static readonly ColorVector PapayaWhip = NamedColors.PapayaWhip;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFDAB9.
+ ///
+ public static readonly ColorVector PeachPuff = NamedColors.PeachPuff;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #CD853F.
+ ///
+ public static readonly ColorVector Peru = NamedColors.Peru;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFC0CB.
+ ///
+ public static readonly ColorVector Pink = NamedColors.Pink;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #DDA0DD.
+ ///
+ public static readonly ColorVector Plum = NamedColors.Plum;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #B0E0E6.
+ ///
+ public static readonly ColorVector PowderBlue = NamedColors.PowderBlue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #800080.
+ ///
+ public static readonly ColorVector Purple = NamedColors.Purple;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #663399.
+ ///
+ public static readonly ColorVector RebeccaPurple = NamedColors.RebeccaPurple;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FF0000.
+ ///
+ public static readonly ColorVector Red = NamedColors.Red;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #BC8F8F.
+ ///
+ public static readonly ColorVector RosyBrown = NamedColors.RosyBrown;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #4169E1.
+ ///
+ public static readonly ColorVector RoyalBlue = NamedColors.RoyalBlue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #8B4513.
+ ///
+ public static readonly ColorVector SaddleBrown = NamedColors.SaddleBrown;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FA8072.
+ ///
+ public static readonly ColorVector Salmon = NamedColors.Salmon;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F4A460.
+ ///
+ public static readonly ColorVector SandyBrown = NamedColors.SandyBrown;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #2E8B57.
+ ///
+ public static readonly ColorVector SeaGreen = NamedColors.SeaGreen;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFF5EE.
+ ///
+ public static readonly ColorVector SeaShell = NamedColors.SeaShell;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #A0522D.
+ ///
+ public static readonly ColorVector Sienna = NamedColors.Sienna;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #C0C0C0.
+ ///
+ public static readonly ColorVector Silver = NamedColors.Silver;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #87CEEB.
+ ///
+ public static readonly ColorVector SkyBlue = NamedColors.SkyBlue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #6A5ACD.
+ ///
+ public static readonly ColorVector SlateBlue = NamedColors.SlateBlue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #708090.
+ ///
+ public static readonly ColorVector SlateGray = NamedColors.SlateGray;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFFAFA.
+ ///
+ public static readonly ColorVector Snow = NamedColors.Snow;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #00FF7F.
+ ///
+ public static readonly ColorVector SpringGreen = NamedColors.SpringGreen;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #4682B4.
+ ///
+ public static readonly ColorVector SteelBlue = NamedColors.SteelBlue;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #D2B48C.
+ ///
+ public static readonly ColorVector Tan = NamedColors.Tan;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #008080.
+ ///
+ public static readonly ColorVector Teal = NamedColors.Teal;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #D8BFD8.
+ ///
+ public static readonly ColorVector Thistle = NamedColors.Thistle;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FF6347.
+ ///
+ public static readonly ColorVector Tomato = NamedColors.Tomato;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFFFFF.
+ ///
+ public static readonly ColorVector Transparent = NamedColors.Transparent;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #40E0D0.
+ ///
+ public static readonly ColorVector Turquoise = NamedColors.Turquoise;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #EE82EE.
+ ///
+ public static readonly ColorVector Violet = NamedColors.Violet;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F5DEB3.
+ ///
+ public static readonly ColorVector Wheat = NamedColors.Wheat;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFFFFF.
+ ///
+ public static readonly ColorVector White = NamedColors.White;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #F5F5F5.
+ ///
+ public static readonly ColorVector WhiteSmoke = NamedColors.WhiteSmoke;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #FFFF00.
+ ///
+ public static readonly ColorVector Yellow = NamedColors.Yellow;
+
+ ///
+ /// Represents a matching the W3C definition that has an hex value of #9ACD32.
+ ///
+ public static readonly ColorVector YellowGreen = NamedColors.YellowGreen;
+ }
+}
\ No newline at end of file
diff --git a/src/ImageSharp/Colors/ColorVector.Transforms.cs b/src/ImageSharp/Colors/ColorVector.Transforms.cs
new file mode 100644
index 000000000..e9666a351
--- /dev/null
+++ b/src/ImageSharp/Colors/ColorVector.Transforms.cs
@@ -0,0 +1,253 @@
+//
+// Copyright (c) James Jackson-South and contributors.
+// Licensed under the Apache License, Version 2.0.
+//
+
+namespace ImageSharp
+{
+ using System.Numerics;
+
+ ///
+ /// Unpacked pixel type containing four 16-bit unsigned normalized values typically ranging from 0 to 1.
+ /// The color components are stored in red, green, blue, and alpha order.
+ ///
+ ///
+ /// This struct is fully mutable. This is done (against the guidelines) for the sake of performance,
+ /// as it avoids the need to create new values for modification operations.
+ ///
+ public partial struct ColorVector
+ {
+ ///
+ /// Adds the second color to the first.
+ ///
+ /// The first source color.
+ /// The second source color.
+ ///
+ /// The .
+ ///
+ public static ColorVector operator +(ColorVector left, ColorVector right)
+ {
+ return new ColorVector(left.backingVector + right.backingVector);
+ }
+
+ ///
+ /// Subtracts the second color from the first.
+ ///
+ /// The first source color.
+ /// The second source color.
+ ///
+ /// The .
+ ///
+ public static ColorVector operator -(ColorVector left, ColorVector right)
+ {
+ return new ColorVector(left.backingVector - right.backingVector);
+ }
+
+ ///
+ /// The blending formula simply selects the source color.
+ ///
+ /// The backdrop color.
+ /// The source color.
+ ///
+ /// The .
+ ///
+ public static ColorVector Normal(ColorVector backdrop, ColorVector source)
+ {
+ Vector4 normal = Vector4BlendTransforms.Normal(backdrop.backingVector, source.backingVector);
+ return new ColorVector(normal);
+ }
+
+ ///
+ /// Blends two colors by multiplication.
+ ///
+ /// The source color is multiplied by the destination color and replaces the destination.
+ /// The resultant color is always at least as dark as either the source or destination color.
+ /// Multiplying any color with black results in black. Multiplying any color with white preserves the
+ /// original color.
+ ///
+ ///
+ /// The backdrop color.
+ /// The source color.
+ ///
+ /// The .
+ ///
+ public static ColorVector Multiply(ColorVector backdrop, ColorVector source)
+ {
+ Vector4 multiply = Vector4BlendTransforms.Multiply(backdrop.backingVector, source.backingVector);
+ return new ColorVector(multiply);
+ }
+
+ ///
+ /// Multiplies the complements of the backdrop and source color values, then complements the result.
+ ///
+ /// The result color is always at least as light as either of the two constituent colors. Screening any
+ /// color with white produces white; screening with black leaves the original color unchanged.
+ /// The effect is similar to projecting multiple photographic slides simultaneously onto a single screen.
+ ///
+ ///
+ /// The backdrop color.
+ /// The source color.
+ ///
+ /// The .
+ ///
+ public static ColorVector Screen(ColorVector backdrop, ColorVector source)
+ {
+ Vector4 subtract = Vector4BlendTransforms.Screen(backdrop.backingVector, source.backingVector);
+ return new ColorVector(subtract);
+ }
+
+ ///
+ /// Multiplies or screens the colors, depending on the source color value. The effect is similar to
+ /// shining a harsh spotlight on the backdrop.
+ ///
+ /// The backdrop color.
+ /// The source color.
+ ///
+ /// The .
+ ///
+ public static ColorVector HardLight(ColorVector backdrop, ColorVector source)
+ {
+ Vector4 hardlight = Vector4BlendTransforms.HardLight(backdrop.backingVector, source.backingVector);
+ return new ColorVector(hardlight);
+ }
+
+ ///
+ /// Multiplies or screens the colors, depending on the backdrop color value.
+ ///
+ /// Source colors overlay the backdrop while preserving its highlights and shadows.
+ /// The backdrop color is not replaced but is mixed with the source color to reflect the lightness or darkness
+ /// of the backdrop.
+ ///
+ ///
+ /// The backdrop color.
+ /// The source color.
+ ///
+ /// The .
+ ///
+ public static ColorVector Overlay(ColorVector backdrop, ColorVector source)
+ {
+ Vector4 overlay = Vector4BlendTransforms.Overlay(backdrop.backingVector, source.backingVector);
+ return new ColorVector(overlay);
+ }
+
+ ///
+ /// Selects the darker of the backdrop and source colors.
+ /// The backdrop is replaced with the source where the source is darker; otherwise, it is left unchanged.
+ ///
+ /// The backdrop color.
+ /// The source color.
+ ///
+ /// The .
+ ///
+ public static ColorVector Darken(ColorVector backdrop, ColorVector source)
+ {
+ Vector4 darken = Vector4BlendTransforms.Darken(backdrop.backingVector, source.backingVector);
+ return new ColorVector(darken);
+ }
+
+ ///
+ /// Selects the lighter of the backdrop and source colors.
+ /// The backdrop is replaced with the source where the source is lighter; otherwise, it is left unchanged.
+ ///
+ /// The backdrop color.
+ /// The source color.
+ ///
+ /// The .
+ ///
+ public static ColorVector Lighten(ColorVector backdrop, ColorVector source)
+ {
+ Vector4 lighten = Vector4BlendTransforms.Lighten(backdrop.backingVector, source.backingVector);
+ return new ColorVector(lighten);
+ }
+
+ ///
+ /// Darkens or lightens the colors, depending on the source color value. The effect is similar to shining
+ /// a diffused spotlight on the backdrop.
+ ///
+ /// The backdrop color.
+ /// The source color.
+ ///
+ /// The .
+ ///
+ public static ColorVector SoftLight(ColorVector backdrop, ColorVector source)
+ {
+ Vector4 softlight = Vector4BlendTransforms.SoftLight(backdrop.backingVector, source.backingVector);
+ return new ColorVector(softlight);
+ }
+
+ ///
+ /// Brightens the backdrop color to reflect the source color. Painting with black produces no changes.
+ ///
+ /// The backdrop color.
+ /// The source color.
+ ///
+ /// The .
+ ///
+ public static ColorVector ColorDodge(ColorVector backdrop, ColorVector source)
+ {
+ Vector4 dodge = Vector4BlendTransforms.Dodge(backdrop.backingVector, source.backingVector);
+ return new ColorVector(dodge);
+ }
+
+ ///
+ /// Darkens the backdrop color to reflect the source color. Painting with white produces no change.
+ ///
+ /// The backdrop color.
+ /// The source color.
+ ///
+ /// The .
+ ///
+ public static ColorVector ColorBurn(ColorVector backdrop, ColorVector source)
+ {
+ Vector4 burn = Vector4BlendTransforms.Burn(backdrop.backingVector, source.backingVector);
+ return new ColorVector(burn);
+ }
+
+ ///
+ /// Subtracts the darker of the two constituent colors from the lighter color.
+ /// Painting with white inverts the backdrop color; painting with black produces no change.
+ ///
+ /// The backdrop color.
+ /// The source color.
+ ///
+ /// The .
+ ///
+ public static ColorVector Difference(ColorVector backdrop, ColorVector source)
+ {
+ Vector4 difference = Vector4BlendTransforms.Difference(backdrop.backingVector, source.backingVector);
+ return new ColorVector(difference);
+ }
+
+ ///
+ /// Produces an effect similar to that of the mode but lower in contrast. Painting with white
+ /// inverts the backdrop color; painting with black produces no change
+ ///
+ /// The backdrop color.
+ /// The source color.
+ ///
+ /// The .
+ ///
+ public static ColorVector Exclusion(ColorVector backdrop, ColorVector source)
+ {
+ Vector4 exclusion = Vector4BlendTransforms.Exclusion(backdrop.backingVector, source.backingVector);
+ return new ColorVector(exclusion);
+ }
+
+ ///
+ /// Linearly interpolates from one color to another based on the given weighting.
+ ///
+ /// The first color value.
+ /// The second color value.
+ ///
+ /// A value between 0 and 1 indicating the weight of the second source vector.
+ /// At amount = 0, "from" is returned, at amount = 1, "to" is returned.
+ ///
+ ///
+ /// The
+ ///
+ public static ColorVector Lerp(ColorVector from, ColorVector to, float amount)
+ {
+ return new ColorVector(Vector4.Lerp(from.backingVector, to.backingVector, amount));
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ImageSharp/Colors/ColorVector.cs b/src/ImageSharp/Colors/ColorVector.cs
new file mode 100644
index 000000000..354553982
--- /dev/null
+++ b/src/ImageSharp/Colors/ColorVector.cs
@@ -0,0 +1,316 @@
+//
+// Copyright (c) James Jackson-South and contributors.
+// Licensed under the Apache License, Version 2.0.
+//
+
+namespace ImageSharp
+{
+ using System.Numerics;
+ using System.Runtime.CompilerServices;
+
+ ///
+ /// Unpacked pixel type containing four 16-bit unsigned normalized values typically ranging from 0 to 1.
+ /// The color components are stored in red, green, blue, and alpha order.
+ ///
+ ///
+ /// This struct is fully mutable. This is done (against the guidelines) for the sake of performance,
+ /// as it avoids the need to create new values for modification operations.
+ ///
+ public partial struct ColorVector : IPixel
+ {
+ ///
+ /// The maximum byte value.
+ ///
+ private static readonly Vector4 MaxBytes = new Vector4(255);
+
+ ///
+ /// The half vector value.
+ ///
+ private static readonly Vector4 Half = new Vector4(0.5F);
+
+ ///
+ /// The backing vector for SIMD support.
+ ///
+ private Vector4 backingVector;
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The red component.
+ /// The green component.
+ /// The blue component.
+ /// The alpha component.
+ public ColorVector(byte r, byte g, byte b, byte a = 255)
+ : this()
+ {
+ this.backingVector = new Vector4(r, g, b, a) / MaxBytes;
+ }
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The red component.
+ /// The green component.
+ /// The blue component.
+ /// The alpha component.
+ public ColorVector(float r, float g, float b, float a = 1)
+ : this()
+ {
+ this.backingVector = new Vector4(r, g, b, a);
+ }
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ ///
+ /// The vector containing the components for the packed vector.
+ ///
+ public ColorVector(Vector3 vector)
+ : this()
+ {
+ this.backingVector = new Vector4(vector, 1);
+ }
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ ///
+ /// The vector containing the components for the packed vector.
+ ///
+ public ColorVector(Vector4 vector)
+ : this()
+ {
+ this.backingVector = vector;
+ }
+
+ ///
+ /// Gets or sets the red component.
+ ///
+ public float R
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ get
+ {
+ return this.backingVector.X;
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ set
+ {
+ this.backingVector.X = value;
+ }
+ }
+
+ ///
+ /// Gets or sets the green component.
+ ///
+ public float G
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ get
+ {
+ return this.backingVector.Y;
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ set
+ {
+ this.backingVector.Y = value;
+ }
+ }
+
+ ///
+ /// Gets or sets the blue component.
+ ///
+ public float B
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ get
+ {
+ return this.backingVector.Z;
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ set
+ {
+ this.backingVector.Z = value;
+ }
+ }
+
+ ///
+ /// Gets or sets the alpha component.
+ ///
+ public float A
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ get
+ {
+ return this.backingVector.W;
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ set
+ {
+ this.backingVector.W = value;
+ }
+ }
+
+ ///
+ /// Compares two objects for equality.
+ ///
+ ///
+ /// The on the left side of the operand.
+ ///
+ ///
+ /// The on the right side of the operand.
+ ///
+ ///
+ /// True if the parameter is equal to the parameter; otherwise, false.
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool operator ==(ColorVector left, ColorVector right)
+ {
+ return left.backingVector == right.backingVector;
+ }
+
+ ///
+ /// Compares two objects for equality.
+ ///
+ /// The on the left side of the operand.
+ /// The on the right side of the operand.
+ ///
+ /// True if the parameter is not equal to the parameter; otherwise, false.
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool operator !=(ColorVector left, ColorVector right)
+ {
+ return left.backingVector != right.backingVector;
+ }
+
+ ///
+ /// Creates a new instance of the struct.
+ ///
+ ///
+ /// The hexadecimal representation of the combined color components arranged
+ /// in rgb, rgba, rrggbb, or rrggbbaa format to match web syntax.
+ ///
+ ///
+ /// The .
+ ///
+ public static ColorVector FromHex(string hex)
+ {
+ return ColorBuilder.FromHex(hex);
+ }
+
+ ///
+ public BulkPixelOperations CreateBulkOperations() => new ColorVector.BulkOperations();
+
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public void PackFromBytes(byte x, byte y, byte z, byte w)
+ {
+ this.backingVector = new Vector4(x, y, z, w) / MaxBytes;
+ }
+
+ ///
+ /// Converts the value of this instance to a hexadecimal string.
+ ///
+ /// A hexadecimal string representation of the value.
+ public string ToHex()
+ {
+ // Hex is RRGGBBAA
+ Vector4 vector = this.backingVector * MaxBytes;
+ vector += Half;
+ uint hexOrder = (uint)((byte)vector.W | (byte)vector.Z << 8 | (byte)vector.Y << 16 | (byte)vector.X << 24);
+ return hexOrder.ToString("X8");
+ }
+
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public void ToXyzBytes(byte[] bytes, int startIndex)
+ {
+ Vector4 vector = Vector4.Clamp(this.backingVector, Vector4.Zero, Vector4.One) * MaxBytes;
+ vector += Half;
+ bytes[startIndex] = (byte)vector.X;
+ bytes[startIndex + 1] = (byte)vector.Y;
+ bytes[startIndex + 2] = (byte)vector.Z;
+ }
+
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public void ToXyzwBytes(byte[] bytes, int startIndex)
+ {
+ Vector4 vector = Vector4.Clamp(this.backingVector, Vector4.Zero, Vector4.One) * MaxBytes;
+ vector += Half;
+ bytes[startIndex] = (byte)vector.X;
+ bytes[startIndex + 1] = (byte)vector.Y;
+ bytes[startIndex + 2] = (byte)vector.Z;
+ bytes[startIndex + 3] = (byte)vector.W;
+ }
+
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public void ToZyxBytes(byte[] bytes, int startIndex)
+ {
+ Vector4 vector = Vector4.Clamp(this.backingVector, Vector4.Zero, Vector4.One) * MaxBytes;
+ vector += Half;
+ bytes[startIndex] = (byte)vector.Z;
+ bytes[startIndex + 1] = (byte)vector.Y;
+ bytes[startIndex + 2] = (byte)vector.X;
+ }
+
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public void ToZyxwBytes(byte[] bytes, int startIndex)
+ {
+ Vector4 vector = Vector4.Clamp(this.backingVector, Vector4.Zero, Vector4.One) * MaxBytes;
+ vector += Half;
+ bytes[startIndex] = (byte)vector.Z;
+ bytes[startIndex + 1] = (byte)vector.Y;
+ bytes[startIndex + 2] = (byte)vector.X;
+ bytes[startIndex + 3] = (byte)vector.W;
+ }
+
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public void PackFromVector4(Vector4 vector)
+ {
+ this.backingVector = vector;
+ }
+
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public Vector4 ToVector4()
+ {
+ return this.backingVector;
+ }
+
+ ///
+ public override bool Equals(object obj)
+ {
+ return (obj is ColorVector) && this.Equals((ColorVector)obj);
+ }
+
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public bool Equals(ColorVector other)
+ {
+ return this.backingVector == other.backingVector;
+ }
+
+ ///
+ /// Gets a string representation of the packed vector.
+ ///
+ /// A string representation of the packed vector.
+ public override string ToString()
+ {
+ return this.ToVector4().ToString();
+ }
+
+ ///
+ public override int GetHashCode()
+ {
+ return this.backingVector.GetHashCode();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ImageSharp/Colors/ColorspaceTransforms.cs b/src/ImageSharp/Colors/ColorspaceTransforms.cs
index 74f5cb717..cbf40724e 100644
--- a/src/ImageSharp/Colors/ColorspaceTransforms.cs
+++ b/src/ImageSharp/Colors/ColorspaceTransforms.cs
@@ -10,7 +10,7 @@ namespace ImageSharp
using Colors.Spaces;
///
- /// Packed vector type containing four 8-bit unsigned normalized values ranging from 0 to 255.
+ /// Unpacked pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255.
/// The color components are stored in red, green, blue, and alpha order.
///
///
diff --git a/src/ImageSharp/Colors/NamedColors{TColor}.cs b/src/ImageSharp/Colors/NamedColors{TColor}.cs
index bcad4dd40..f8080195d 100644
--- a/src/ImageSharp/Colors/NamedColors{TColor}.cs
+++ b/src/ImageSharp/Colors/NamedColors{TColor}.cs
@@ -8,719 +8,719 @@ namespace ImageSharp
using System;
///
- /// A set of named colors mapped to the provided Color space.
+ /// A set of named colors mapped to the provided color space.
///
/// The type of the color.
public static class NamedColors
where TColor : struct, IPixel
{
///
- /// Represents a matching the W3C definition that has an hex value of #F0F8FF.
+ /// Represents a matching the W3C definition that has an hex value of #F0F8FF.
///
public static readonly TColor AliceBlue = ColorBuilder.FromRGBA(240, 248, 255, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #FAEBD7.
+ /// Represents a matching the W3C definition that has an hex value of #FAEBD7.
///
public static readonly TColor AntiqueWhite = ColorBuilder.FromRGBA(250, 235, 215, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #00FFFF.
+ /// Represents a matching the W3C definition that has an hex value of #00FFFF.
///
public static readonly TColor Aqua = ColorBuilder.FromRGBA(0, 255, 255, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #7FFFD4.
+ /// Represents a matching the W3C definition that has an hex value of #7FFFD4.
///
public static readonly TColor Aquamarine = ColorBuilder.FromRGBA(127, 255, 212, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #F0FFFF.
+ /// Represents a matching the W3C definition that has an hex value of #F0FFFF.
///
public static readonly TColor Azure = ColorBuilder.FromRGBA(240, 255, 255, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #F5F5DC.
+ /// Represents a matching the W3C definition that has an hex value of #F5F5DC.
///
public static readonly TColor Beige = ColorBuilder.FromRGBA(245, 245, 220, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #FFE4C4.
+ /// Represents a matching the W3C definition that has an hex value of #FFE4C4.
///
public static readonly TColor Bisque = ColorBuilder.FromRGBA(255, 228, 196, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #000000.
+ /// Represents a matching the W3C definition that has an hex value of #000000.
///
public static readonly TColor Black = ColorBuilder.FromRGBA(0, 0, 0, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #FFEBCD.
+ /// Represents a matching the W3C definition that has an hex value of #FFEBCD.
///
public static readonly TColor BlanchedAlmond = ColorBuilder.FromRGBA(255, 235, 205, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #0000FF.
+ /// Represents a matching the W3C definition that has an hex value of #0000FF.
///
public static readonly TColor Blue = ColorBuilder.FromRGBA(0, 0, 255, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #8A2BE2.
+ /// Represents a matching the W3C definition that has an hex value of #8A2BE2.
///
public static readonly TColor BlueViolet = ColorBuilder.FromRGBA(138, 43, 226, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #A52A2A.
+ /// Represents a matching the W3C definition that has an hex value of #A52A2A.
///
public static readonly TColor Brown = ColorBuilder.FromRGBA(165, 42, 42, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #DEB887.
+ /// Represents a matching the W3C definition that has an hex value of #DEB887.
///
public static readonly TColor BurlyWood = ColorBuilder.FromRGBA(222, 184, 135, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #5F9EA0.
+ /// Represents a matching the W3C definition that has an hex value of #5F9EA0.
///
public static readonly TColor CadetBlue = ColorBuilder.FromRGBA(95, 158, 160, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #7FFF00.
+ /// Represents a matching the W3C definition that has an hex value of #7FFF00.
///
public static readonly TColor Chartreuse = ColorBuilder.FromRGBA(127, 255, 0, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #D2691E.
+ /// Represents a matching the W3C definition that has an hex value of #D2691E.
///
public static readonly TColor Chocolate = ColorBuilder.FromRGBA(210, 105, 30, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #FF7F50.
+ /// Represents a matching the W3C definition that has an hex value of #FF7F50.
///
public static readonly TColor Coral = ColorBuilder.FromRGBA(255, 127, 80, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #6495ED.
+ /// Represents a matching the W3C definition that has an hex value of #6495ED.
///
public static readonly TColor CornflowerBlue = ColorBuilder.FromRGBA(100, 149, 237, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #FFF8DC.
+ /// Represents a matching the W3C definition that has an hex value of #FFF8DC.
///
public static readonly TColor Cornsilk = ColorBuilder.FromRGBA(255, 248, 220, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #DC143C.
+ /// Represents a matching the W3C definition that has an hex value of #DC143C.
///
public static readonly TColor Crimson = ColorBuilder.FromRGBA(220, 20, 60, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #00FFFF.
+ /// Represents a matching the W3C definition that has an hex value of #00FFFF.
///
public static readonly TColor Cyan = ColorBuilder.FromRGBA(0, 255, 255, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #00008B.
+ /// Represents a matching the W3C definition that has an hex value of #00008B.
///
public static readonly TColor DarkBlue = ColorBuilder.FromRGBA(0, 0, 139, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #008B8B.
+ /// Represents a matching the W3C definition that has an hex value of #008B8B.
///
public static readonly TColor DarkCyan = ColorBuilder.FromRGBA(0, 139, 139, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #B8860B.
+ /// Represents a matching the W3C definition that has an hex value of #B8860B.
///
public static readonly TColor DarkGoldenrod = ColorBuilder.FromRGBA(184, 134, 11, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #A9A9A9.
+ /// Represents a matching the W3C definition that has an hex value of #A9A9A9.
///
public static readonly TColor DarkGray = ColorBuilder.FromRGBA(169, 169, 169, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #006400.
+ /// Represents a matching the W3C definition that has an hex value of #006400.
///
public static readonly TColor DarkGreen = ColorBuilder.FromRGBA(0, 100, 0, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #BDB76B.
+ /// Represents a matching the W3C definition that has an hex value of #BDB76B.
///
public static readonly TColor DarkKhaki = ColorBuilder.FromRGBA(189, 183, 107, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #8B008B.
+ /// Represents a matching the W3C definition that has an hex value of #8B008B.
///
public static readonly TColor DarkMagenta = ColorBuilder.FromRGBA(139, 0, 139, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #556B2F.
+ /// Represents a matching the W3C definition that has an hex value of #556B2F.
///
public static readonly TColor DarkOliveGreen = ColorBuilder.FromRGBA(85, 107, 47, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #FF8C00.
+ /// Represents a matching the W3C definition that has an hex value of #FF8C00.
///
public static readonly TColor DarkOrange = ColorBuilder.FromRGBA(255, 140, 0, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #9932CC.
+ /// Represents a matching the W3C definition that has an hex value of #9932CC.
///
public static readonly TColor DarkOrchid = ColorBuilder.FromRGBA(153, 50, 204, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #8B0000.
+ /// Represents a matching the W3C definition that has an hex value of #8B0000.
///
public static readonly TColor DarkRed = ColorBuilder.FromRGBA(139, 0, 0, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #E9967A.
+ /// Represents a matching the W3C definition that has an hex value of #E9967A.
///
public static readonly TColor DarkSalmon = ColorBuilder.FromRGBA(233, 150, 122, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #8FBC8B.
+ /// Represents a matching the W3C definition that has an hex value of #8FBC8B.
///
public static readonly TColor DarkSeaGreen = ColorBuilder.FromRGBA(143, 188, 139, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #483D8B.
+ /// Represents a matching the W3C definition that has an hex value of #483D8B.
///
public static readonly TColor DarkSlateBlue = ColorBuilder.FromRGBA(72, 61, 139, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #2F4F4F.
+ /// Represents a matching the W3C definition that has an hex value of #2F4F4F.
///
public static readonly TColor DarkSlateGray = ColorBuilder.FromRGBA(47, 79, 79, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #00CED1.
+ /// Represents a matching the W3C definition that has an hex value of #00CED1.
///
public static readonly TColor DarkTurquoise = ColorBuilder.FromRGBA(0, 206, 209, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #9400D3.
+ /// Represents a matching the W3C definition that has an hex value of #9400D3.
///
public static readonly TColor DarkViolet = ColorBuilder.FromRGBA(148, 0, 211, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #FF1493.
+ /// Represents a matching the W3C definition that has an hex value of #FF1493.
///
public static readonly TColor DeepPink = ColorBuilder.FromRGBA(255, 20, 147, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #00BFFF.
+ /// Represents a matching the W3C definition that has an hex value of #00BFFF.
///
public static readonly TColor DeepSkyBlue = ColorBuilder.FromRGBA(0, 191, 255, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #696969.
+ /// Represents a matching the W3C definition that has an hex value of #696969.
///
public static readonly TColor DimGray = ColorBuilder.FromRGBA(105, 105, 105, 255);
///
- /// Represents a