pre-gif re-write

This commit is contained in:
2024-10-16 13:48:22 -05:00
parent da71b1bd85
commit 87c65bc84e
6 changed files with 102 additions and 12 deletions

View File

@@ -2,6 +2,8 @@
(use-modules (cairo))
(re-export (cairo-pattern-create-rgb . create-color))
;;;;;;;;;;;;;;;;;;;
;; Basic Drawing ;;
;;;;;;;;;;;;;;;;;;;
@@ -11,7 +13,6 @@
(define-public black (cairo-pattern-create-rgb 0 0 0))
(define-public white (cairo-pattern-create-rgb 1 1 1))
(define-public red (cairo-pattern-create-rgb 1 0 0))
(define (edge-painter cr graph)
(lambda (node)
@@ -33,7 +34,9 @@
(lambda (node)
(let ([x (caar node)]
[y (cdar node)]
[color (caddr node)])
[color (if (null? (cddr node))
white
(caddr node))])
(cairo-arc cr x y 4. 0. tau)
(cairo-set-source cr color)
(cairo-fill-preserve cr)