mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-12 22:33:48 +00:00
Added color themes (dark & light) (#148)
This commit is contained in:
1 parent
0ad7b8d4dd
commit
e9998348c5
31 files changed
+350
-50
No files matched your search
@@ -1,3 +1,5 @@
|
||||
using AIStudio.Settings;
|
||||
|
||||
namespace AIStudio.Provider;
|
||||
|
||||
public sealed record Confidence
|
||||
@@ -20,9 +22,9 @@ public sealed record Confidence
|
||||
|
||||
public Confidence WithLevel(ConfidenceLevel level) => this with { Level = level };
|
||||
|
||||
public string StyleBorder() => $"border: 2px solid {this.Level.GetColor()}; border-radius: 6px;";
|
||||
public string StyleBorder(SettingsManager settingsManager) => $"border: 2px solid {this.Level.GetColor(settingsManager)}; border-radius: 6px;";
|
||||
|
||||
public string SetColorStyle() => $"--confidence-color: {this.Level.GetColor()};";
|
||||
public string SetColorStyle(SettingsManager settingsManager) => $"--confidence-color: {this.Level.GetColor(settingsManager)};";
|
||||
|
||||
public static readonly Confidence NONE = new()
|
||||
{
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using AIStudio.Settings;
|
||||
|
||||
namespace AIStudio.Provider;
|
||||
|
||||
public static class ConfidenceLevelExtensions
|
||||
@@ -16,19 +18,31 @@ public static class ConfidenceLevelExtensions
|
||||
_ => "Unknown confidence level",
|
||||
};
|
||||
|
||||
public static string GetColor(this ConfidenceLevel level) => level switch
|
||||
public static string GetColor(this ConfidenceLevel level, SettingsManager settingsManager) => (level, settingsManager.IsDarkMode) switch
|
||||
{
|
||||
ConfidenceLevel.NONE => "#cccccc",
|
||||
(ConfidenceLevel.NONE, _) => "#cccccc",
|
||||
|
||||
ConfidenceLevel.UNTRUSTED => "#ff0000",
|
||||
ConfidenceLevel.VERY_LOW => "#ff6600",
|
||||
ConfidenceLevel.LOW => "#ffcc00",
|
||||
ConfidenceLevel.MODERATE => "#99cc00",
|
||||
ConfidenceLevel.MEDIUM => "#86b300",
|
||||
ConfidenceLevel.HIGH => "#009933",
|
||||
(ConfidenceLevel.UNTRUSTED, false) => "#ff0000",
|
||||
(ConfidenceLevel.UNTRUSTED, true) => "#800000",
|
||||
|
||||
_ => "#cc6600",
|
||||
(ConfidenceLevel.VERY_LOW, false) => "#ff6600",
|
||||
(ConfidenceLevel.VERY_LOW, true) => "#803300",
|
||||
|
||||
(ConfidenceLevel.LOW, false) => "#ffcc00",
|
||||
(ConfidenceLevel.LOW, true) => "#806600",
|
||||
|
||||
(ConfidenceLevel.MODERATE, false) => "#99cc00",
|
||||
(ConfidenceLevel.MODERATE, true) => "#4d6600",
|
||||
|
||||
(ConfidenceLevel.MEDIUM, false) => "#86b300",
|
||||
(ConfidenceLevel.MEDIUM, true) => "#394d00",
|
||||
|
||||
(ConfidenceLevel.HIGH, false) => "#009933",
|
||||
(ConfidenceLevel.HIGH, true) => "#004d1a",
|
||||
|
||||
(_, false) => "#cc6600",
|
||||
(_, true) => "#663300",
|
||||
};
|
||||
|
||||
public static string SetColorStyle(this ConfidenceLevel level) => $"--confidence-color: {level.GetColor()};";
|
||||
public static string SetColorStyle(this ConfidenceLevel level, SettingsManager settingsManager) => $"--confidence-color: {level.GetColor(settingsManager)};";
|
||||
}
|
||||
Reference in new issue
Block a user