Skip to content

Commit

Permalink
Fix an issue with calling tinysvg.ColorBytes
Browse files Browse the repository at this point in the history
  • Loading branch information
xyproto committed May 14, 2024
1 parent 5a99e69 commit ec56f7d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions box.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"fmt"
"math/rand"
"strconv"

"github.com/xyproto/tinysvg"
)

// Box represents a box with the following properties:
Expand Down Expand Up @@ -186,8 +184,7 @@ func (pi *PixelImage) CoverBox(bo *Box, pink bool, optimizeColors bool) {
} else if optimizeColors {
colorString = shortColorString(byte(bo.r), byte(bo.g), byte(bo.b))
} else {
// THIS IS THE BUG
colorString = string(tinysvg.ColorBytes(bo.r, bo.g, bo.b))
colorString = fmt.Sprintf("#%02x%02x%02x", bo.r, bo.g, bo.b)
}

// Set the fill color
Expand Down

0 comments on commit ec56f7d

Please sign in to comment.