anchor.diff:  ;;;;
   ;;;; 14 General Designs
   ;;;;
  +
  +(declaim (inline color-blend-function))
  +(defun color-blend-function (r1 g1 b1 o1  r2 g2 b2 o2)
  +  (let* ((o3 (+ o1 (* (- 1 o1) o2)))
  +         (r3 (/ (+ (* r1 o1) (* (- 1 o1) o2 r2)) o3))
  +         (g3 (/ (+ (* g1 o1) (* (- 1 o1) o2 g2)) o3))
  +         (b3 (/ (+ (* b1 o1) (* (- 1 o1) o2 b2)) o3)))
  +    (values
  +     r3 g3 b3 o3)))
   
   (defgeneric compose-over (design1 design2))
   (defgeneric compose-in (ink mask))
  
positive.code:     :width width
      :height height
      :design design))
  
negative.code: ;;; License along with this library; if not, write to the 
  ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
  ;;; Boston, MA  02111-1307  USA.
  
  ;;;; Some Notes
  
  ;; The design design has a pitfall:
  ;;
  ;; As drawing is specified, a design of class opacity carries no color
  ;; and thus borrows its color from  +foreground-ink+. So that
  ;;
  ;; (make-opacity v) == (compose-in +foreground-ink+ (make-opacity v))
  ;;
  ;; This implies, that an opacity is not neccessary uniform, it depends
  ;; on the selected foreground ink.
  ;;
  ;; They halfway fix this by specifing that the mask argument of
  ;; compose-in and compose-out is thought as to be drawn with
  ;; +foreground-ink+ = +background-ink+ = +black+.
  ;;
  ;; But Is (make-opacity 1) really the same as +foreground-ink+? 
  ;;     Or: Is
  ;;         (compose-in D +foreground-ink+) different from
  ;;         (compose-in D (make-opacity 1))?
  ;;
  ;; If the above equation is true, we get a funny algebra:
  ;;
  ;; (make-opacity 0) = +transparent-ink+ = +nowhere+
  ;; (make-opacity 1) = +foreground-ink+ = +everywhere+
  ;;
  ;; --GB
  
  ;;;; What we may want to have
  
  ;; It might be handy to have the equivalent of parent-relative
  ;; backgrounds. We can specify new indirect inks:
  ;;
  ;; +parent-background+
  ;; +parent-relative-background+
  ;; +parent-foreground+
  ;; +parent-relative-foreground+
  ;;
  ;; The relative one would have the same "absolute" origin as the
  ;; relevant inks of the parent.
  ;;
  ;; When they are evaluated, they look at the parent's
  ;; foreground/background ink. Though the relative variants are
  ;; expensive, when you want to scroll them ...
  ;;
  ;;
  ;; Further we really should specify some form of indirekt ink
  ;; protocol.
  ;;
  ;; --GB
  
  ;;;; Design Protocol
  
  ;;
  ;; DRAW-DESIGN already is all you need for a design protocol.
  ;;
  ;; --GB
  
  
  (in-package :CLIM-INTERNALS)
  
  