From c698a6fc5db489fa60784c6d498e810975056229 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 14 Mar 2023 19:58:38 -0400 Subject: Scoped label display and documentation tweaks (#23430) (#23433) Backport #23430 by @brechtvl * Fix scoped label left and right part breaking across lines. * Remove slanted divider in scoped label display, make it straight. After using this for a while, this feels more visually noisy than helpful. * Reduce contrast between scope and item to reduce probability of unreadable text on background. * Change documentation to remove mention of non-exclusive scoped labels. Co-authored-by: Brecht Van Lommel Co-authored-by: Lunny Xiao Co-authored-by: John Olheiser --- modules/templates/helper.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 19893c7c9d..822bbbd9b1 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -834,7 +834,7 @@ func RenderLabel(ctx context.Context, label *issues_model.Label) string { // Make scope and item background colors slightly darker and lighter respectively. // More contrast needed with higher luminance, empirically tweaked. luminance := (0.299*r + 0.587*g + 0.114*b) / 255 - contrast := 0.01 + luminance*0.06 + contrast := 0.01 + luminance*0.03 // Ensure we add the same amount of contrast also near 0 and 1. darken := contrast + math.Max(luminance+contrast-1.0, 0.0) lighten := contrast + math.Max(contrast-luminance, 0.0) @@ -859,12 +859,10 @@ func RenderLabel(ctx context.Context, label *issues_model.Label) string { return fmt.Sprintf(""+ "
%s
"+ - "
 
"+ "
%s
"+ "
", description, textColor, scopeColor, scopeText, - itemColor, scopeColor, textColor, itemColor, itemText) } -- cgit v1.2.3