mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-16 04:53:48 +00:00
Allow TextInfoLines to color its content
This commit is contained in:
4 files changed
+42
No files matched your search
@@ -0,0 +1,11 @@
|
||||
namespace AIStudio.Tools;
|
||||
|
||||
public enum TextColor
|
||||
{
|
||||
DEFAULT,
|
||||
|
||||
WARN,
|
||||
ERROR,
|
||||
SUCCESS,
|
||||
INFO,
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using AIStudio.Settings;
|
||||
|
||||
namespace AIStudio.Tools;
|
||||
|
||||
public static class TextColorExtensions
|
||||
{
|
||||
public static string GetHTMLColor(this TextColor color, SettingsManager settingsManager) => color switch
|
||||
{
|
||||
TextColor.DEFAULT => string.Empty,
|
||||
|
||||
TextColor.ERROR => settingsManager.IsDarkMode ? "#ff6c6c" : "#ff0000",
|
||||
TextColor.WARN => settingsManager.IsDarkMode ? "#c7a009" : "#c7c000",
|
||||
TextColor.SUCCESS => settingsManager.IsDarkMode ? "#08b342" : "#009933",
|
||||
TextColor.INFO => settingsManager.IsDarkMode ? "#5279b8" : "#2d67c4",
|
||||
|
||||
_ => string.Empty,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user