aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--module/output/general.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/module/output/general.scm b/module/output/general.scm
index e2f73991..2e0e77c6 100644
--- a/module/output/general.scm
+++ b/module/output/general.scm
@@ -2,6 +2,7 @@
)
;; Returns a color with good contrast to the given background color.
+;; https://stackoverflow.com/questions/1855884/determine-font-color-based-on-background-color/1855903#1855903
(define-public (calculate-fg-color c)
(catch #t
(lambda ()
@@ -12,9 +13,9 @@
(b (str->num c 5)))
(if (< 1/2 (/ (+ (* 0.299 r)
(* 0.587 g)
- (* 0.144 b))
+ (* 0.114 b))
#xFF))
- "#000000" "#e5e8e6")))
+ "#000000" "#FFFFFF")))
(lambda args
(format (current-error-port) "Error calculating foreground color?~%~s~%" args)
"#FF0000"