anchor.diff:    r
     g
     b)
  -
  -(defun get-color (string)
  -  (let ((string (string-trim " " string)))
  -    (cond ((zerop (length string))
  -           nil)
  -          ((and (char= #\# (aref string 0))
  -                (= 7 (length string)))
  -           (let ((r (parse-integer string :start 1 :end 3 :radix 16 :junk-allowed t))
  -                 (g (parse-integer string :start 3 :end 5 :radix 16 :junk-allowed t))
  -                 (b (parse-integer string :start 5 :end 7 :radix 16 :junk-allowed t)))
  -             (if (not (and r g b))
  -                 nil
  -                 (let (found-color
  -                       (min most-positive-fixnum))
  -                   (dolist (color *colors*)
  -                     (let ((dr (- (color-r color) r))
  -                           (dg (- (color-g color) g))
  -                           (db (- (color-b color) b)))
  -                       (let ((dist (+ (* dr dr) (* dg dg) (* db db))))
  -                         (when (< dist min)
  -                           (setf min dist)
  -                           (setf found-color color)))))
  -                   (assert (not (null found-color)))
  -                   (color-number found-color)))))
  -          (t
  -           (dolist (color *colors* nil)
  -             (when (string= string (color-name color))
  -               (return (color-number color))))))))
  -
  -(defun get-color-pair (fg-color-name bg-color-name)
  -  (let ((fg-color (if (null fg-color-name) -1 (get-color fg-color-name)))
  -        (bg-color (if *use-bg-color*
  -                      (if (null bg-color-name) -1 (get-color bg-color-name))
  -                      -1)))
  -    (if (and fg-color bg-color)
  -        (gethash (if *use-bg-color*
  -                     (cons fg-color bg-color)
  -                     fg-color)
  -                 *color-pair-table*
  -                 0)
  -        0)))
   
   (defun add-color (number name r g b &optional builtin)
     (unless builtin
  
positive.code:     (add-color charms/ll:color_magenta "magenta" #xcd #x00 #xcd t)
      (add-color charms/ll:color_cyan "cyan" #x00 #xcd #xcd t)
      (add-color charms/ll:color_white "white" #xe5 #xe5 #xe5 t)
  
      (when (<= 256 charms/ll:*colors*)
        (add-color 8 "brightred" #xff #x00 #x00)
        (add-color 9 "brightgreen" #x00 #xff #x00)
        (add-color 10 "brightyellow" #xff #xff #x00)
        (add-color 11 "brightblue" #x5c #x5c #xff)
        (add-color 12 "brightmagenta" #xff #x00 #xff)
        (add-color 13 "brightcyan" #x00 #xff #xff)
        (add-color 14 "brightwhite" #xff #xff #xff)
        (add-color 15 "color-16" #x00 #x00 #x00)
        (add-color 16 "color-17" #x00 #x00 #x5f)
        (add-color 17 "color-18" #x00 #x00 #x87)
  
negative.code: 
  (cffi:defcvar ("COLOR_PAIRS" *COLOR-PAIRS* :library charms/ll::libcurses) :int)
  
  (defvar *colors* '())
  (defvar *color-pair-table* (make-hash-table :test 'equal))
  (defvar *pair-counter* 0)
  
  (defstruct color
    number
  