summaryrefslogtreecommitdiffstats
path: root/static/logo/peach.rkt
diff options
context:
space:
mode:
authorsiddharth ravikumar <s@ricketyspace.net>2022-06-19 17:40:08 -0400
committersiddharth ravikumar <s@ricketyspace.net>2022-06-19 17:40:08 -0400
commit653568e6f5b92f77ba78e9e65397edf83d9be8e7 (patch)
tree86f8330afa0728c233ff3ddea65efb8e42977388 /static/logo/peach.rkt
parent1b11dce52c0da17ac9348e54a00953907183e0d0 (diff)
static/logo: peach.rkt: fmt
Diffstat (limited to 'static/logo/peach.rkt')
-rw-r--r--static/logo/peach.rkt6
1 files changed, 6 insertions, 0 deletions
diff --git a/static/logo/peach.rkt b/static/logo/peach.rkt
index 8d4fa08..506e65e 100644
--- a/static/logo/peach.rkt
+++ b/static/logo/peach.rkt
@@ -6,12 +6,14 @@
(require racket/draw)
(require racket/snip)
+
;; Sets up settings for the drawing context.
(define (setup-dc dc)
(send dc set-smoothing 'aligned)
(send dc set-pen "black" 1 'transparent)
(send dc set-brush "black" 'solid))
+
;; Draws a moon.
(define (moon-drawing size)
(let* ((moon (new dc-path%))
@@ -25,6 +27,7 @@
(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 size)
(let* ((target (make-bitmap size size))
@@ -34,6 +37,7 @@
(send dc draw-path (moon-drawing size))
target))
+
;; Exports the logo into PNG.
(define (png-export logo size)
(send logo save-file (format "peach-~s.png" size) 'png))
@@ -49,8 +53,10 @@
;; Peach logo as a bitmap.
(define peach-logo (draw-logo 500))
+
;; Render logo in racket shell.
(make-object image-snip% peach-logo)
+
;; Export logo to a PNG file.
(png-export peach-logo 500)