From 91b548e0bf38f4c4ef068bbb1e8f5c99c8ccb858 Mon Sep 17 00:00:00 2001 From: joren Date: Mon, 23 Mar 2026 11:29:14 +0100 Subject: [PATCH] Fix(Colors): Use standard Racket color names and round coin dots MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The (pp1 graphics) library resolves colors via Racket's color database, which doesn't support hex strings — they return #f causing a contract violation on set-brush. Replaced all hex colors with standard names: #2121DE -> "medium blue", #FFB851 -> "gold", #FFB8FF -> "hot pink", #FFFF00 -> "yellow", #FF0000 -> "red", #111111 -> "dark slate gray" Also switched coins from draw-rectangle! to draw-ellipse! for round dot rendering (arcade-accurate). Co-Authored-By: Claude Opus 4.6 --- pacman-project/adt/draw.rkt | 4 ++-- pacman-project/constants.rkt | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pacman-project/adt/draw.rkt b/pacman-project/adt/draw.rkt index 34f1fdd..6251261 100644 --- a/pacman-project/adt/draw.rkt +++ b/pacman-project/adt/draw.rkt @@ -154,13 +154,13 @@ color-door)))))) ;; draw-coins! :: maze -> / - ;; Redraws all coins as small centered dots. + ;; Redraws all coins as small round dots. (define (draw-coins! maze) ((coins-tile 'clear!)) ((maze 'for-each-cell) (lambda (row col cell-type) (when (= cell-type cell-type-coin) - ((coins-tile 'draw-rectangle!) + ((coins-tile 'draw-ellipse!) (+ (grid->pixel-x col) coin-inset) (+ (grid->pixel-y row) coin-inset) coin-size diff --git a/pacman-project/constants.rkt b/pacman-project/constants.rkt index 120ca03..dbe8022 100644 --- a/pacman-project/constants.rkt +++ b/pacman-project/constants.rkt @@ -147,17 +147,17 @@ (define rotation-up 90) (define rotation-down -90) - ;; Colors — arcade-style palette + ;; Colors — arcade-style palette (standard Racket color names only) (define color-background "black") - (define color-wall "#2121DE") - (define color-door "#FFB8FF") - (define color-coin "#FFB851") + (define color-wall "medium blue") + (define color-door "hot pink") + (define color-coin "gold") (define color-text "white") - (define color-title "#FFFF00") - (define color-header-bg "#111111") - (define color-game-over "#FF0000") + (define color-title "yellow") + (define color-header-bg "dark slate gray") + (define color-game-over "red") (define color-pause-bg "black") - (define color-pause-text "#FF0000") + (define color-pause-text "red") ;; UI layout — header bar at the top (define header-height 90)