summaryrefslogtreecommitdiffstats
path: root/models/issue_label.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/issue_label.go')
-rw-r--r--models/issue_label.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/models/issue_label.go b/models/issue_label.go
index 3eed8ed985..befe3f192a 100644
--- a/models/issue_label.go
+++ b/models/issue_label.go
@@ -62,6 +62,7 @@ type Label struct {
IsChecked bool `xorm:"-"`
}
+// APIFormat converts a Label to the api.Label format
func (label *Label) APIFormat() *api.Label {
return &api.Label{
ID: label.ID,
@@ -77,9 +78,9 @@ func (label *Label) CalOpenIssues() {
// ForegroundColor calculates the text color for labels based
// on their background color.
-func (l *Label) ForegroundColor() template.CSS {
- if strings.HasPrefix(l.Color, "#") {
- if color, err := strconv.ParseUint(l.Color[1:], 16, 64); err == nil {
+func (label *Label) ForegroundColor() template.CSS {
+ if strings.HasPrefix(label.Color, "#") {
+ if color, err := strconv.ParseUint(label.Color[1:], 16, 64); err == nil {
r := float32(0xFF & (color >> 16))
g := float32(0xFF & (color >> 8))
b := float32(0xFF & color)