summaryrefslogtreecommitdiff
path: root/internal/client/ui/colors
diff options
context:
space:
mode:
Diffstat (limited to 'internal/client/ui/colors')
-rw-r--r--internal/client/ui/colors/colors.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/internal/client/ui/colors/colors.go b/internal/client/ui/colors/colors.go
index 2c11f72..845018c 100644
--- a/internal/client/ui/colors/colors.go
+++ b/internal/client/ui/colors/colors.go
@@ -156,6 +156,7 @@ func Save() {
func Restore() {
Load(colors)
+ isDarkened = false
}
func Load(colors []lipgloss.Color) {
@@ -255,15 +256,25 @@ func ToHexRGB(r, g, b uint8) string {
return fmt.Sprintf("#%02X%02X%02X", r, g, b)
}
+var isDarkened = false
+
+const DarkeningFactor = 0.5
+
func Darken() {
Save()
colors := Get()
for i, color := range colors {
- colors[i] = DarkenColor(color, 0.5)
+ colors[i] = DarkenColor(color, DarkeningFactor)
}
Load(colors)
+
+ isDarkened = true
+}
+
+func IsDarkened() bool {
+ return isDarkened
}
func DarkenColor(color lipgloss.Color, factor float64) lipgloss.Color {