|
@@ -17,33 +17,33 @@ public partial class PaletteColor : IEquatable<PaletteColor>
|
|
get => (byte)GValue;
|
|
get => (byte)GValue;
|
|
set => GValue = value;
|
|
set => GValue = value;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public byte B
|
|
public byte B
|
|
{
|
|
{
|
|
get => (byte)BValue;
|
|
get => (byte)BValue;
|
|
set => BValue = value;
|
|
set => BValue = value;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public string Hex => $"#{R:X2}{G:X2}{B:X2}";
|
|
public string Hex => $"#{R:X2}{G:X2}{B:X2}";
|
|
-
|
|
|
|
|
|
+
|
|
public PaletteColor(byte r, byte g, byte b)
|
|
public PaletteColor(byte r, byte g, byte b)
|
|
{
|
|
{
|
|
RValue = r;
|
|
RValue = r;
|
|
GValue = g;
|
|
GValue = g;
|
|
BValue = b;
|
|
BValue = b;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public PaletteColor(uint r, uint g, uint b)
|
|
public PaletteColor(uint r, uint g, uint b)
|
|
{
|
|
{
|
|
RValue = (byte)r;
|
|
RValue = (byte)r;
|
|
GValue = (byte)g;
|
|
GValue = (byte)g;
|
|
BValue = (byte)b;
|
|
BValue = (byte)b;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public PaletteColor()
|
|
public PaletteColor()
|
|
{
|
|
{
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public override string ToString()
|
|
public override string ToString()
|
|
{
|
|
{
|
|
return Hex;
|
|
return Hex;
|
|
@@ -51,6 +51,12 @@ public partial class PaletteColor : IEquatable<PaletteColor>
|
|
|
|
|
|
public static bool operator ==(PaletteColor left, PaletteColor right)
|
|
public static bool operator ==(PaletteColor left, PaletteColor right)
|
|
{
|
|
{
|
|
|
|
+ if (left is null && right is null)
|
|
|
|
+ return true;
|
|
|
|
+
|
|
|
|
+ if (left is null || right is null)
|
|
|
|
+ return false;
|
|
|
|
+
|
|
return left.R == right.R && left.G == right.G && left.B == right.B;
|
|
return left.R == right.R && left.G == right.G && left.B == right.B;
|
|
}
|
|
}
|
|
|
|
|