Skip to content

Instantly share code, notes, and snippets.

@nulldatamap
Last active July 3, 2019 17:09
Show Gist options
  • Save nulldatamap/afe1336b0b1c9ce40097411494220dc5 to your computer and use it in GitHub Desktop.
Save nulldatamap/afe1336b0b1c9ce40097411494220dc5 to your computer and use it in GitHub Desktop.
Anarchist Programmer Flag
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
#lang racket
(require racket/draw)
(require pict)
(require file/convertible)
(define (flag width)
(define height (* width (/ 2 3)))
(define band (/ height 3))
(define spacing (* height 0.075))
(define f
(make-font #:size (- band spacing)
#:face "Source Code Pro"
#:weight 'medium
#:smoothing 'smoothed))
(cc-superimpose
(filled-rectangle width height
#:color "red"
#:border-color "red")
(filled-rectangle width band)
(colorize (text "(CHAOS" f) "red")))
(define (flag-to-file file-name width)
(with-output-to-file file-name
#:exists 'truncate
(λ ()
(display (convert (flag width) 'svg-bytes)))))
(flag-to-file "flag.svg" 1920)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment