From 778cdb68270050a2307eab7ab9646060b8948256 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 11 Jul 2023 22:25:44 -0400 Subject: [PATCH] color.RGBA is no longer hardcoded --- drawer.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drawer.go b/drawer.go index 8d73f64..d414244 100644 --- a/drawer.go +++ b/drawer.go @@ -13,11 +13,13 @@ type Drawer struct { TypeSetter } // Draw draws the drawer's text onto the specified canvas at the given offset. func (drawer Drawer) Draw ( destination draw.Image, - color color.RGBA, + color color.Color, offset image.Point, ) ( updatedRegion image.Rectangle, ) { + source := image.NewUniform(color) + drawer.For (func ( index int, char rune, @@ -39,7 +41,7 @@ func (drawer Drawer) Draw ( draw.DrawMask ( destination, destinationRectangle, - image.NewUniform(color), image.Point { }, + source, image.Point { }, mask, maskPoint, draw.Over)