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

Method Sub

utils.go:565–583  ·  view source on GitHub ↗
(value uint8)

Source from the content-addressed store, hash-verified

563}
564
565func (color Color) Sub(value uint8) Color {
566
567 newColor := NewColor(color.RGBA())
568
569 for i, c := range newColor[:3] {
570
571 if c < value {
572 newColor[i] = 0
573 } else if int(c)-int(value) > 255 {
574 newColor[i] = 1
575 } else {
576 newColor[i] -= value
577 }
578
579 }
580
581 return newColor
582
583}
584
585func (color Color) IsDark() bool {
586 threshold := 60

Callers 15

AccentMethod · 0.95
UpdateMethod · 0.45
PasteCardsMethod · 0.45
StartDraggingMethod · 0.45
UpdateMethod · 0.45
DrawMethod · 0.45
UpdateMethod · 0.45
DrawShadowMethod · 0.45
DeadlineStateMethod · 0.45
DeadlineTextMethod · 0.45
DrawCardMethod · 0.45

Calls 2

RGBAMethod · 0.95
NewColorFunction · 0.85

Tested by

no test coverage detected