From b0b367054e2e330dd03b3e329a492b58f53872dc Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Sat, 22 Jun 2024 13:43:42 +0200 Subject: [PATCH] blend adjustments --- maprenderer.go | 2 +- utils.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/maprenderer.go b/maprenderer.go index ca689d8..c8048c5 100644 --- a/maprenderer.go +++ b/maprenderer.go @@ -69,7 +69,7 @@ func RenderMap(na types.NodeAccessor, cr types.ColorResolver, from, to *types.Po // bottom up color blending for i := len(nodes) - 2; i >= 0; i-- { node := nodes[i] - c = BlendColor(c, node.Color) + c = BlendColor(c, node.Color, 3) } } diff --git a/utils.go b/utils.go index 9a53ca8..50d2fb0 100644 --- a/utils.go +++ b/utils.go @@ -112,8 +112,8 @@ func ColorAdjust(c *color.RGBA, value int) *color.RGBA { } } -func BlendColor(bg, fg *color.RGBA) *color.RGBA { - a := float64(fg.A) / 255 +func BlendColor(bg, fg *color.RGBA, bf float64) *color.RGBA { + a := float64(fg.A) / 255 / bf ai := 1 - a return &color.RGBA{