mirror of
https://github.com/fatih/color.git
synced 2025-02-16 18:34:39 +02:00
Added high intensity colours
This commit is contained in:
parent
76d423163a
commit
aa04f74371
24
color.go
24
color.go
@ -53,6 +53,18 @@ const (
|
|||||||
FgWhite
|
FgWhite
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Foreground Hi-Intensity text colors
|
||||||
|
const (
|
||||||
|
FgHiBlack Attribute = iota + 90
|
||||||
|
FgHiRed
|
||||||
|
FgHiGreen
|
||||||
|
FgHiYellow
|
||||||
|
FgHiBlue
|
||||||
|
FgHiMagenta
|
||||||
|
FgHiCyan
|
||||||
|
FgHiWhite
|
||||||
|
)
|
||||||
|
|
||||||
// Background text colors
|
// Background text colors
|
||||||
const (
|
const (
|
||||||
BgBlack Attribute = iota + 40
|
BgBlack Attribute = iota + 40
|
||||||
@ -65,6 +77,18 @@ const (
|
|||||||
BgWhite
|
BgWhite
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Background Hi-Intensity text colors
|
||||||
|
const (
|
||||||
|
BgHiBlack Attribute = iota + 100
|
||||||
|
BgHiRed
|
||||||
|
BgHiGreen
|
||||||
|
BgHiYellow
|
||||||
|
BgHiBlue
|
||||||
|
BgHiMagenta
|
||||||
|
BgHiCyan
|
||||||
|
BgHiWhite
|
||||||
|
)
|
||||||
|
|
||||||
// New returns a newly created color object.
|
// New returns a newly created color object.
|
||||||
func New(value ...Attribute) *Color {
|
func New(value ...Attribute) *Color {
|
||||||
c := &Color{params: make([]Attribute, 0)}
|
c := &Color{params: make([]Attribute, 0)}
|
||||||
|
@ -30,6 +30,14 @@ func TestColor(t *testing.T) {
|
|||||||
{text: "magent", code: FgMagenta},
|
{text: "magent", code: FgMagenta},
|
||||||
{text: "cyan", code: FgCyan},
|
{text: "cyan", code: FgCyan},
|
||||||
{text: "white", code: FgWhite},
|
{text: "white", code: FgWhite},
|
||||||
|
{text: "hblack", code: FgHiBlack},
|
||||||
|
{text: "hred", code: FgHiRed},
|
||||||
|
{text: "hgreen", code: FgHiGreen},
|
||||||
|
{text: "hyellow", code: FgHiYellow},
|
||||||
|
{text: "hblue", code: FgHiBlue},
|
||||||
|
{text: "hmagent", code: FgHiMagenta},
|
||||||
|
{text: "hcyan", code: FgHiCyan},
|
||||||
|
{text: "hwhite", code: FgHiWhite},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, c := range testColors {
|
for _, c := range testColors {
|
||||||
@ -98,6 +106,14 @@ func TestNoColor(t *testing.T) {
|
|||||||
{text: "magent", code: FgMagenta},
|
{text: "magent", code: FgMagenta},
|
||||||
{text: "cyan", code: FgCyan},
|
{text: "cyan", code: FgCyan},
|
||||||
{text: "white", code: FgWhite},
|
{text: "white", code: FgWhite},
|
||||||
|
{text: "hblack", code: FgHiBlack},
|
||||||
|
{text: "hred", code: FgHiRed},
|
||||||
|
{text: "hgreen", code: FgHiGreen},
|
||||||
|
{text: "hyellow", code: FgHiYellow},
|
||||||
|
{text: "hblue", code: FgHiBlue},
|
||||||
|
{text: "hmagent", code: FgHiMagenta},
|
||||||
|
{text: "hcyan", code: FgHiCyan},
|
||||||
|
{text: "hwhite", code: FgHiWhite},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, c := range testColors {
|
for _, c := range testColors {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user