From 4d0e55fb1d90300db5236d4e3b4f6c585f898b9d Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 10 Dec 2023 23:53:44 +0530 Subject: dragon color change --- sketches/05/dragon.rkt | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'sketches/05') diff --git a/sketches/05/dragon.rkt b/sketches/05/dragon.rkt index 9cca295..25dd1c3 100644 --- a/sketches/05/dragon.rkt +++ b/sketches/05/dragon.rkt @@ -1,12 +1,21 @@ #lang sketching (define (setup) - (size 200 200) - (frame-rate 1) - (loop)) + (size 1920 1080) + (fullscreen) + (smoothing 'smoothed) + (no-cursor) + ;; (frame-rate 1) + ;; (loop) + (no-loop) + ) +;; Config (define iterations 14) -(define init-segment 400) +(define init-segment 900) + +;; State +(define current-iteration 19) (define Line cons) (define ->0 car) @@ -43,18 +52,20 @@ (dragon-curve (->0 lines) 1 (- iteration 1)) (dragon-curve (->1 lines) -1 (- iteration 1)))))) -(define current-iteration 0) (define (draw) - (background 150) + (background 21 18 31) + (stroke-weight 1) + (stroke-cap 'round) + (stroke-join 'round) + (stroke 50 39 99) (let* [ - (p1 (Point (- (/ width 2) (/ init-segment 2)) (/ height 2))) + (p1 (Point (- (/ width 2) (/ init-segment 2.38)) (- (/ height 2) (/ init-segment 6) ) )) (l1 (Line p1 (Point (+ (->x p1) init-segment) (->y p1)))) - (lines (dragon-curve l1 1 current-iteration)) ] - (stroke-weight 2) - (stroke 0 0 0) - (for-each draw/line lines) - (if (= current-iteration iterations) - (no-loop) - (set! current-iteration (+ current-iteration 1))))) + (for-each draw/line (dragon-curve l1 1 current-iteration))) + + ;; (if (= current-iteration iterations) + ;; (no-loop) + ;; (set! current-iteration (+ current-iteration 1))) + ) -- cgit v1.3.1