diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-08-17 18:13:58 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-08-17 18:13:58 +0200 |
commit | c1cbef6611df9c8918fee8699b5867d8a54ac810 (patch) | |
tree | 46ab04d457eda5e7c0873efe3480d5c68ef1d4c2 /module/output | |
parent | Got type files out of output. (diff) | |
download | calp-c1cbef6611df9c8918fee8699b5867d8a54ac810.tar.gz calp-c1cbef6611df9c8918fee8699b5867d8a54ac810.tar.xz |
even more.
Diffstat (limited to 'module/output')
-rw-r--r-- | module/output/common.scm | 32 | ||||
-rw-r--r-- | module/output/general.scm | 22 |
2 files changed, 0 insertions, 54 deletions
diff --git a/module/output/common.scm b/module/output/common.scm deleted file mode 100644 index 84a2f77e..00000000 --- a/module/output/common.scm +++ /dev/null @@ -1,32 +0,0 @@ -;;; Commentary: -;; Common code between all serializers. -;; (ical and xcal). Not for graphical output stuff. -;;; Code: - -(define-module (output common) - :use-module (util) - :use-module (srfi srfi-1) - :use-module (vcomponent) - ) - - -(define*-public (internal-field? symbol optional: (prefix "-")) - (string=? prefix - (string-take-to (symbol->string symbol) - (string-length prefix)))) - -(define-public (get-tz-names events) - (lset-difference - equal? (lset-union - equal? '("dummy") - (filter-map - (lambda (vline) (and=> (param vline 'TZID) car)) - (filter-map (extract* 'DTSTART) - events))) - '("dummy" "local"))) - -(define-public (downcase-symbol symb) - (-> symb - symbol->string - string-downcase - string->symbol)) diff --git a/module/output/general.scm b/module/output/general.scm deleted file mode 100644 index 2e0e77c6..00000000 --- a/module/output/general.scm +++ /dev/null @@ -1,22 +0,0 @@ -(define-module (output general) - ) - -;; 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 () - (define (str->num c n) (string->number (substring/shared c n (+ n 2)) 16)) - ;; (format (current-error-port) "COLOR = ~s~%" c) - (let ((r (str->num c 1)) - (g (str->num c 3)) - (b (str->num c 5))) - (if (< 1/2 (/ (+ (* 0.299 r) - (* 0.587 g) - (* 0.114 b)) - #xFF)) - "#000000" "#FFFFFF"))) - (lambda args - (format (current-error-port) "Error calculating foreground color?~%~s~%" args) - "#FF0000" - ))) |