Thursday, September 27, 2007

Vecto rules!

:)
Another instant hit from Xach is Vecto. All pure lisp all the time. Here is some fun that I've had with it.



(defpackage #:smiley (:use #:cl #:vecto)) 
  (in-package #:smiley) 
  (with-canvas (:width 200 :height 200) (scale 2 2) (set-rgb-stroke 0 0 0) (set-line-width .5) (set-rgb-fill 1 1 0) (centered-circle-path 50 50 50) (fill-and-stroke) (set-rgb-fill 0 0 0) (centered-ellipse-path 35 70 10 15) (centered-ellipse-path 65 70 10 15) (fill-path) (move-to 30 35) (quadratic-to 50 10 70 35) (quadratic-to 50 15 30 35) (fill-and-stroke) (move-to 25 34) (quadratic-to 30 35 30 40) (move-to 75 34) (quadratic-to 70 35 70 40) 
  (stroke)
  (save-png (merge-pathnames "tmp/smiley.png" (user-homedir-pathname))))

No comments: