From dd6135123cbd6ee72a2a55f5c52dfb6353f4f53a Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Tue, 6 Mar 2012 10:51:10 -0500 Subject: [PATCH] continuing to try making grem's clipart example work --- tests/clipart-test/clipart.rkt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/clipart-test/clipart.rkt b/tests/clipart-test/clipart.rkt index c677d37..5ddcae0 100644 --- a/tests/clipart-test/clipart.rkt +++ b/tests/clipart-test/clipart.rkt @@ -116,6 +116,18 @@ ;(define CDOG (overlay (clipart/url DOGURL) BG)) ;D +(define colors (image->color-list DOG)) +(displayln (length colors)) +(andmap color? colors) +(define vec (list->vector colors)) +(vector-length vec) +(let loop ([i 0]) + (when (< i (vector-length vec)) + (unless (color? (vector-ref vec i)) + (error 'something-went-wrong)) + (loop (add1 i)))) + + (define (repeat num thunk) (if (equal? num 0) (thunk)