        combinators.cleave
        rewrite-closures fry accessors newfx
        processing.color
-       processing.gadget math.geometry.rect ;
+       processing.gadget math.geometry.rect
+       processing.shapes ;
        
 IN: processing
 


: mouse ( -- point ) hand-loc get ;

: mouse-x mouse first  ;
: mouse-y mouse second ;

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! VAR: fill-color
! VAR: stroke-color

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

GENERIC: canonical-color-value ( obj -- color )

METHOD: canonical-color-value { number } dup dup 1 4array ;

METHOD: canonical-color-value { array }
   dup length
   {
     { 2 [ first2 >r dup dup r> 4array ] }
     { 3 [ 1 suffix ] }
     { 4 [ ] }
   }
   case ;

METHOD: canonical-color-value { rgba }
  { [ red>> ] [ green>> ] [ blue>> ] [ alpha>> ] } cleave 4array ;

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

: fill   ( value -- ) canonical-color-value >fill-color   ;
: stroke ( value -- ) canonical-color-value >stroke-color ;

: no-fill   ( -- ) 0 fill-color>   set-fourth ;
: no-stroke ( -- ) 0 stroke-color> set-fourth ;

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

