go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/cli/theme/colors/color.go (about)

     1  // Copyright (c) Mondoo, Inc.
     2  // SPDX-License-Identifier: BUSL-1.1
     3  
     4  package colors
     5  
     6  // NOTE: this package is used by various packages and should really have NO external dependency
     7  
     8  import (
     9  	"github.com/muesli/termenv"
    10  )
    11  
    12  // Color Theme
    13  type Theme struct {
    14  	// messages
    15  	Primary   termenv.Color
    16  	Secondary termenv.Color
    17  	Disabled  termenv.Color
    18  	Error     termenv.Color
    19  	Success   termenv.Color
    20  
    21  	// severity
    22  	Critical termenv.Color
    23  	High     termenv.Color
    24  	Medium   termenv.Color
    25  	Low      termenv.Color
    26  	Good     termenv.Color
    27  	Unknown  termenv.Color
    28  }
    29  
    30  func ProfileName(profile termenv.Profile) string {
    31  	switch profile {
    32  	case termenv.Ascii:
    33  		return "Ascii"
    34  	case termenv.ANSI:
    35  		return "ANSI"
    36  	case termenv.ANSI256:
    37  		return "ANSI256"
    38  	case termenv.TrueColor:
    39  		return "TrueColor"
    40  	default:
    41  		return "unknown"
    42  	}
    43  }