From 17d158fe15f814441bd9a553aa3d4bb1ad90c0a8 Mon Sep 17 00:00:00 2001 From: diesal Date: Mon, 11 May 2026 23:04:18 +0930 Subject: [PATCH] add hex color support add hex color support for progress bars --- ReAgent.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ReAgent.cs b/ReAgent.cs index a6b78a8..1f49485 100644 --- a/ReAgent.cs +++ b/ReAgent.cs @@ -441,13 +441,15 @@ public override void Render() Graphics.DrawBox(position, position + textSize, Color.Black.ToSharpDx()); Graphics.DrawText(text, position, ColorFromName(color).ToSharpDx()); } - } - + } + private static Color ColorFromName(string color) { + if (color.StartsWith("#")) return ColorTranslator.FromHtml(color); // allow hex based colors return Color.FromName(color); } + private void ApplyPendingSideEffects() { var applicationResults = _pendingSideEffects.Select(x => (x, ApplicationResult: x.Apply(_state))).ToList(); @@ -518,4 +520,4 @@ private bool ShouldExecute(out string state) state = "Ready"; return true; } -} \ No newline at end of file +}