Browse Source

Fixes cond logic

master
sloum 5 months ago
parent
commit
88b5c5d9e1
  1. 11
      main.slo

11
main.slo

@ -104,18 +104,19 @@
(cond ; vet the fg input a little bit
((and (list? fg) (equal? (length fg) 2) (number? (car fg))) (set! fg (abs (floor (car fg)))))
((and (number? fg) (or (ansi-between fg 29 38) (ansi-between fg 89 98))) (set! fg (abs (floor fg))))
((else) (set! fg #f)))
(else (set! fg #f)))
(cond ; vet the bg input a little bit
((and (list? bg) (equal? (length bg) 2) (number? (car (cdr bg)))) (set! bg (abs (floor (car (cdr bg))))))
((and (number? bg) (or (ansi-between bg 39 48) (ansi-between fg 99 108))) (set! bg (abs (floor bg))))
((else) (set! fg #f)))
((and (number? bg) (or (ansi-between bg 39 48) (ansi-between bg 99 108))) (set! bg (abs (floor bg))))
(else (set! bg #f)))
; Set and return output
(cond
((and fg bg)
(begin (write fg out) (write ";" out) (write bg out) (write "m" out) (read-all out)))
((fg)
(fg
(begin (write fg out) (write "m" out) (read-all out)))
((bg)
(bg
(begin (write bg out) (write "m" out) (read-all out))))))
(define ansi-256-color-fg (lambda (val)

Loading…
Cancel
Save