From ef561b87d840e0097ab91af250c7acd78df8f6cc Mon Sep 17 00:00:00 2001 From: DazedAnon Date: Fri, 17 Jul 2026 18:06:43 -0500 Subject: [PATCH] Refactor HUD color management to utilize HudTheme constants. - Replace hardcoded color values with HudTheme references across files - Update ActivityProse, Chronicle, ChronicleHud, and others for consistency - Increment version to 0.28.25 in mod.json --- IdleSpectator/ActivityProse.cs | 7 ++-- IdleSpectator/Chronicle.cs | 3 +- IdleSpectator/ChronicleHud.cs | 60 +++++++++++++++---------------- IdleSpectator/DossierAvatar.cs | 4 +-- IdleSpectator/GraveCountBadges.cs | 4 +-- IdleSpectator/HudCanvas.cs | 10 ++++-- IdleSpectator/HudTheme.cs | 47 ++++++++++++++++++++++++ IdleSpectator/WatchCaption.cs | 30 ++++++++-------- IdleSpectator/mod.json | 2 +- 9 files changed, 109 insertions(+), 58 deletions(-) create mode 100644 IdleSpectator/HudTheme.cs diff --git a/IdleSpectator/ActivityProse.cs b/IdleSpectator/ActivityProse.cs index 30e8bb2..79ebc3c 100644 --- a/IdleSpectator/ActivityProse.cs +++ b/IdleSpectator/ActivityProse.cs @@ -7,10 +7,9 @@ namespace IdleSpectator; public static class ActivityProse { /// - /// Bright lemon for person names - must read clearly on dark dossier chrome and - /// against orange reason text (#F2B861). + /// Vanilla tip name-value purple - reads on dark dossier chrome and orange reason text. /// - public const string NameColorHex = "#FFE566"; + public const string NameColorHex = HudTheme.NameColorHex; public static string ColorName(string name) { @@ -23,7 +22,7 @@ public static class ActivityProse } /// - /// Wrap known person names in gold for orange reason beats (rest inherits ReasonColor). + /// Wrap known person names in purple for orange reason beats (rest inherits ReasonColor). /// Longer names first so partial overlaps do not corrupt replacements. /// public static string ColorizePersonNames(string plain, params string[] names) diff --git a/IdleSpectator/Chronicle.cs b/IdleSpectator/Chronicle.cs index 0c2b9fe..fc748bd 100644 --- a/IdleSpectator/Chronicle.cs +++ b/IdleSpectator/Chronicle.cs @@ -115,8 +115,7 @@ public sealed class ChronicleEntry return body ?? ""; } - const string color = "#A8B4C8"; - string stamped = "[" + DateLabel + "]"; + string stamped = "[" + DateLabel + "]"; if (string.IsNullOrEmpty(body)) { return stamped; diff --git a/IdleSpectator/ChronicleHud.cs b/IdleSpectator/ChronicleHud.cs index 6ce846b..8149582 100644 --- a/IdleSpectator/ChronicleHud.cs +++ b/IdleSpectator/ChronicleHud.cs @@ -248,7 +248,7 @@ public static class ChronicleHud Image bg = _root.GetComponent(); bg.raycastTarget = true; - HudCanvas.StylePanel(bg, _root.transform, new Color(0.07f, 0.08f, 0.1f, 0.92f)); + HudCanvas.StylePanel(bg, _root.transform); CanvasGroup group = _root.GetComponent(); group.blocksRaycasts = true; @@ -262,7 +262,7 @@ public static class ChronicleHud hotRt.sizeDelta = new Vector2(16f, 12f); hotRt.anchoredPosition = new Vector2(-6f, -5f); _hotkeyText.alignment = TextAnchor.MiddleRight; - _hotkeyText.color = new Color(0.5f, 0.53f, 0.58f, 0.95f); + _hotkeyText.color = HudTheme.Muted; _hotkeyText.raycastTarget = false; _titleIcon = HudCanvas.MakeIcon(_root.transform, "TitleIcon", TitleIconSize); @@ -281,7 +281,7 @@ public static class ChronicleHud titleRt.offsetMin = new Vector2(24f, -TitleBandH); titleRt.offsetMax = new Vector2(-22f, -2f); _titleText.alignment = TextAnchor.MiddleLeft; - _titleText.color = new Color(0.9f, 0.91f, 0.93f, 1f); + _titleText.color = HudTheme.Name; _titleText.fontStyle = FontStyle.Bold; _titleText.raycastTarget = false; _titleText.horizontalOverflow = HorizontalWrapMode.Overflow; @@ -297,7 +297,7 @@ public static class ChronicleHud _deleteGraveLabel = _deleteGraveBtn.transform.Find("Label")?.GetComponent(); if (_deleteGraveLabel != null) { - _deleteGraveLabel.color = new Color(0.92f, 0.62f, 0.58f, 1f); + _deleteGraveLabel.color = HudTheme.Danger; } PlaceTitleTool(_deleteGraveBtn, -22f, 34f); @@ -338,7 +338,7 @@ public static class ChronicleHud GameObject go = new GameObject(name, typeof(RectTransform), typeof(Image), typeof(Button)); go.transform.SetParent(parent, false); Image bg = go.GetComponent(); - bg.color = new Color(0.1f, 0.11f, 0.13f, 0.35f); + bg.color = HudTheme.TabIdleFill; bg.raycastTarget = true; Button button = go.GetComponent