mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
22 lines
270 B
Go
22 lines
270 B
Go
package format
|
|
|
|
import "fmt"
|
|
|
|
const (
|
|
DefaultColor Color = iota + 30
|
|
Red
|
|
Green
|
|
Yellow
|
|
Blue
|
|
Magenta
|
|
Cyan
|
|
White
|
|
)
|
|
|
|
type Color uint8
|
|
|
|
// TODO: not cross platform (windows...)
|
|
func (c Color) Format(s string) string {
|
|
return fmt.Sprintf("\x1b[%dm%s\x1b[0m", c, s)
|
|
}
|