diff options
author | siddharth ravikumar <s@ricketyspace.net> | 2022-06-19 17:29:15 -0400 |
---|---|---|
committer | siddharth ravikumar <s@ricketyspace.net> | 2022-06-19 17:29:15 -0400 |
commit | ce73864f2418680f76a8a3f31a2bcc33fca68f43 (patch) | |
tree | 9e0009ab579c34c5c147dd4eecb7185848d68aac | |
parent | 9143286d503e264d5ec12edd4d22860eac24f69d (diff) |
static: update peach.rkt
Refactor so that it will be possible to generate the logo in different
sizes.
-rw-r--r-- | static/logo/peach.png | bin | 11642 -> 11617 bytes | |||
-rw-r--r-- | static/logo/peach.rkt | 23 |
2 files changed, 15 insertions, 8 deletions
diff --git a/static/logo/peach.png b/static/logo/peach.png Binary files differindex f47deb6..3673d06 100644 --- a/static/logo/peach.png +++ b/static/logo/peach.png diff --git a/static/logo/peach.rkt b/static/logo/peach.rkt index cfd6e11..98e01e0 100644 --- a/static/logo/peach.rkt +++ b/static/logo/peach.rkt @@ -13,18 +13,25 @@ (send dc set-brush "black" 'solid)) ;; Draws a moon. -(define (moon-drawing) - (let ((moon (new dc-path%))) - (send moon arc -50 50 320 320 1.57 4.36 #f) - (send moon arc 1 4 490 490 3.54 2.20 #t) +(define (moon-drawing size) + (let* ((moon (new dc-path%)) + (inner-arc-x (/ (* size -50) 500.0)) + (inner-arc-y (* -1 inner-arc-x)) + (inner-arc-size (/ (* size 320) 500.0)) + (outer-arc-x (/ (* size 5) 500.0)) + (outer-arc-y outer-arc-x) + (outer-arc-size (/ (* size 490) 500.0))) + (send moon arc inner-arc-x inner-arc-y inner-arc-size inner-arc-size 1.57 4.36 #f) + (send moon arc outer-arc-x outer-arc-y outer-arc-size outer-arc-size 3.54 2.20 #t) moon)) ;; Draws the peach logo in a bitmap and returns the bitmap. -(define (draw-logo) - (let* ((target (make-bitmap 500 500)) +(define (draw-logo size) + (let* ((target (make-bitmap size size)) (dc (new bitmap-dc% (bitmap target)))) (setup-dc dc) - (send dc draw-path (moon-drawing)) + (send dc set-brush "black" 'solid) + (send dc draw-path (moon-drawing size)) target)) ;; Exports the logo into PNG. @@ -32,7 +39,7 @@ (send logo save-file "peach.png" 'png)) ;; Peach logo as a bitmap. -(define peach-logo (draw-logo)) +(define peach-logo (draw-logo 500)) ;; Render logo in racket shell. (make-object image-snip% peach-logo) |