diff --git a/src/Debug/EcsDebugUtility.cs b/src/Debug/EcsDebugUtility.cs index fc3e0b3..4744906 100644 --- a/src/Debug/EcsDebugUtility.cs +++ b/src/Debug/EcsDebugUtility.cs @@ -306,6 +306,7 @@ namespace DCFApixels.DragonECS public interface ITypeMeta { + Type Type { get; } string Name { get; } MetaColor Color { get; } MetaDescription Description { get; } @@ -512,6 +513,10 @@ namespace DCFApixels.DragonECS private class DebuggerProxy : ITypeMeta { private readonly TypeMeta _meta; + public Type Type + { + get { return _meta.Type; } + } public string Name { get { return _meta.Name; } @@ -570,7 +575,7 @@ namespace DCFApixels.DragonECS #region GetColor private static MetaColor AutoColor(Type type) { - return new MetaColor(type.Name).Desaturate(0.48f) / 1.18f; + return new MetaColor(type.Name).UpContrast();//.Desaturate(0.48f) / 1.18f; } public static (MetaColor, bool) GetColor(Type type) { diff --git a/src/Debug/MetaAttributes/MetaColorAttribute.cs b/src/Debug/MetaAttributes/MetaColorAttribute.cs index d82e8a7..537c8b9 100644 --- a/src/Debug/MetaAttributes/MetaColorAttribute.cs +++ b/src/Debug/MetaAttributes/MetaColorAttribute.cs @@ -70,7 +70,7 @@ namespace DCFApixels.DragonECS } [StructLayout(LayoutKind.Explicit, Pack = 1, Size = 4)] - public readonly struct MetaColor : IMetaColor + public readonly struct MetaColor : IMetaColor, IEquatable { #region Consts public static readonly MetaColor BlackColor = new MetaColor(Black); @@ -246,6 +246,9 @@ namespace DCFApixels.DragonECS #endregion #region Operators + public static bool operator ==(MetaColor a, MetaColor b) { return a.colorCode == b.colorCode; } + public static bool operator !=(MetaColor a, MetaColor b) { return a.colorCode != b.colorCode; } + public static MetaColor operator /(MetaColor a, float b) { return new MetaColor( @@ -337,5 +340,8 @@ namespace DCFApixels.DragonECS #endregion public override string ToString() { return $"({r}, {g}, {b})"; } + public bool Equals(MetaColor other) { return colorCode == other.colorCode; } + public override bool Equals(object obj) { return obj is MetaColor other && Equals(other); } + public override int GetHashCode() { return colorCode; } } } \ No newline at end of file