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 +}