MCPcopy Create free account
hub / github.com/SolarLune/masterplan / Color

Method Color

contents.go:356–378  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

354}
355
356func (cc *CheckboxContents) Color() Color {
357
358 color := getThemeColor(GUICheckboxColor)
359 completedColor := getThemeColor(GUICompletedColor)
360
361 if cc.Card.CustomColor != nil {
362 color = cc.Card.CustomColor
363 h, s, v := cc.Card.CustomColor.HSV()
364 completedColor = NewColorFromHSV(h+0.04, s-0.2, v+0.2)
365 }
366
367 if len(cc.DependentCards()) > 0 {
368
369 if cc.PercentageOfChildrenComplete >= 0.99 {
370 color = completedColor
371 }
372
373 } else if cc.Card.Properties.Get("checked").AsBool() {
374 color = completedColor
375 }
376
377 return color
378}
379
380func (cc *CheckboxContents) DefaultSize() Vector {
381 return Vector{globals.GridSize * 9, globals.GridSize}

Callers

nothing calls this directly

Calls 6

DependentCardsMethod · 0.95
getThemeColorFunction · 0.85
NewColorFromHSVFunction · 0.85
HSVMethod · 0.80
AsBoolMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected