Skip to content

Commit

Permalink
blend adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed Jun 22, 2024
1 parent 494ca27 commit b0b3670
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion maprenderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
4 changes: 2 additions & 2 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit b0b3670

Please sign in to comment.