color.RGBA is no longer hardcoded

This commit is contained in:
Sasha Koshka 2023-07-11 22:25:44 -04:00
parent 6e316d18bc
commit 778cdb6827

View File

@ -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)