MCPcopy Index your code
hub / github.com/cloudfoundry/cli / modifyColor

Method modifyColor

util/ui/ui.go:488–501  ·  view source on GitHub ↗
(text string, colorPrinter *color.Color)

Source from the content-addressed store, hash-verified

486}
487
488func (ui *UI) modifyColor(text string, colorPrinter *color.Color) string {
489 if len(text) == 0 {
490 return text
491 }
492
493 switch ui.colorEnabled {
494 case configv3.ColorEnabled:
495 colorPrinter.EnableColor()
496 case configv3.ColorDisabled:
497 colorPrinter.DisableColor()
498 }
499
500 return colorPrinter.SprintFunc()(text)
501}
502
503// getFirstSet returns the first map if 1 or more maps are provided. Otherwise
504// it returns the empty map.

Callers 15

DisplayLogMessageMethod · 0.95
displayDiffForIntMethod · 0.95
displayDiffForNullIntMethod · 0.95
displayDiffForStringMethod · 0.95
displayDiffForStringsMethod · 0.95
displayDiffForUint64Method · 0.95
DisplayErrorMethod · 0.95
DisplayHeaderMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected