Documentation ¶
Index ¶
- Constants
- Variables
- func GetUnderlyingWriter(out io.Writer) io.Writer
- func GetWriter(ctx context.Context, out io.Writer, defaultColor int, forceColors bool, ...) io.Writer
- func IsColorable(out io.Writer) bool
- func IsStdout(out io.Writer) bool
- func NewColorWriter(out io.Writer) io.Writer
- func SetupColors(ctx context.Context, out io.Writer, defaultColor int, forceColors bool) io.Writer
- func WithEventContext(ctx context.Context, out io.Writer, phase constants.Phase, subtaskID string) (io.Writer, context.Context)
- type Color
- type ColorPicker
Constants ¶
View Source
const DefaultColorCode = 34
Maintain compatibility with the old color coding. 34 is the code for blue.
Variables ¶
View Source
var ( // LightRed can format text to be displayed to the terminal in light red. LightRed = Color{/* contains filtered or unexported fields */} // LightGreen can format text to be displayed to the terminal in light green. LightGreen = Color{/* contains filtered or unexported fields */} // LightYellow can format text to be displayed to the terminal in light yellow. LightYellow = Color{/* contains filtered or unexported fields */} // LightBlue can format text to be displayed to the terminal in light blue. LightBlue = Color{/* contains filtered or unexported fields */} // LightPurple can format text to be displayed to the terminal in light purple. LightPurple = Color{/* contains filtered or unexported fields */} // Red can format text to be displayed to the terminal in red. Red = Color{/* contains filtered or unexported fields */} // Green can format text to be displayed to the terminal in green. Green = Color{/* contains filtered or unexported fields */} // Yellow can format text to be displayed to the terminal in yellow. Yellow = Color{/* contains filtered or unexported fields */} // Blue can format text to be displayed to the terminal in blue. Blue = Color{/* contains filtered or unexported fields */} // Purple can format text to be displayed to the terminal in purple. Purple = Color{/* contains filtered or unexported fields */} // Cyan can format text to be displayed to the terminal in cyan. Cyan = Color{/* contains filtered or unexported fields */} // White can format text to be displayed to the terminal in white. White = Color{/* contains filtered or unexported fields */} // None uses ANSI escape codes to reset all formatting. None = Color{} // Default default output color for output from Skaffold to the user Default = Blue )
View Source
var DefaultColorCodes = []Color{ LightRed, LightGreen, LightYellow, LightBlue, LightPurple, Red, Green, Yellow, Blue, Purple, Cyan, }
Functions ¶
func GetUnderlyingWriter ¶ added in v1.26.0
GetUnderlyingWriter returns the underlying writer if out is a colorableWriter
func IsColorable ¶
func SetupColors ¶
SetupColors conditionally wraps the input `Writer` with a color enabled `Writer`.
func WithEventContext ¶ added in v1.26.0
func WithEventContext(ctx context.Context, out io.Writer, phase constants.Phase, subtaskID string) (io.Writer, context.Context)
WithEventContext will return a new skaffoldWriter with the given parameters to be used for the event writer. If the passed io.Writer is not a skaffoldWriter, then it is simply returned.
Types ¶
type Color ¶
type Color struct {
// contains filtered or unexported fields
}
Color can be used to format text so it can be printed to the terminal in color.
type ColorPicker ¶ added in v1.30.0
func NewColorPicker ¶ added in v1.30.0
func NewColorPicker() ColorPicker
NewColorPicker creates a new ColorPicker.
Click to show internal directories.
Click to hide internal directories.