From 5c4958ee13a13761b8981d646bd8d3ef1e005e19 Mon Sep 17 00:00:00 2001 From: Amolith Date: Fri, 17 Oct 2025 19:06:36 -0600 Subject: [PATCH] fix: correct bug label color conversion Remove unnecessary 16-bit to 8-bit channel conversion in labelToWebLabel. The RGBA() method already returns proper 8-bit values, not 16-bit as previously assumed. Co-Authored-By: Crush --- pkg/web/webui_bugs.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/web/webui_bugs.go b/pkg/web/webui_bugs.go index 8325749bea15e5d9c902b295b60db0ddc90294d2..3a4fc905ec3f1fe01fba29d7bab6d8e0367b0d53 100644 --- a/pkg/web/webui_bugs.go +++ b/pkg/web/webui_bugs.go @@ -289,13 +289,9 @@ func findBugByHash(rc *cache.RepoCache, hash string) (*cache.BugCache, error) { func labelToWebLabel(label common.Label) Label { rgba := label.Color().RGBA() - // RGBA() returns 16-bit channels (0-65535), convert to 8-bit (0-255) - r8 := uint8(rgba.R >> 8) - g8 := uint8(rgba.G >> 8) - b8 := uint8(rgba.B >> 8) return Label{ Name: label.String(), - Color: fmt.Sprintf("#%02x%02x%02x", r8, g8, b8), + Color: fmt.Sprintf("#%02x%02x%02x", rgba.R, rgba.G, rgba.B), } }