Skip to content

Commit

Permalink
Merge pull request #2 from sebastianwebber/bold
Browse files Browse the repository at this point in the history
adding bold support
  • Loading branch information
Dean Karn authored Feb 3, 2018
2 parents f04310f + 448321e commit cbbb5e6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ func main() {
// Blink
fmt.Printf("%s%s%s\n\n", ansi.Blink, "testing blink", ansi.BlinkOff)

// Bold
fmt.Printf("%s%s%s %s\n\n", ansi.Bold, "testing bold", ansi.BoldOff, "and normal strings")

// Custom combination
fmt.Printf("%s%s%s\n", blinkRed, "blink red underline", ansi.Reset)
}
Expand Down
2 changes: 2 additions & 0 deletions ansi.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ const (
CyanBackground = "\x1b[46m"
GrayBackground = "\x1b[47m"
ResetBackground = "\x1b[49m"
Bold = "\x1b[1m"
BoldOff = "\x1b[22m"
)

// Left out due to not being widely supported:
Expand Down
3 changes: 3 additions & 0 deletions examples/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ func main() {
// Blink
fmt.Printf("%s%s%s\n\n", ansi.Blink, "testing blink", ansi.BlinkOff)

// Bold
fmt.Printf("%s%s%s %s\n\n", ansi.Bold, "testing bold", ansi.BoldOff, "and normal strings")

// Custom combination
fmt.Printf("%s%s%s\n", blinkRed, "blink red underline", ansi.Reset)
}

0 comments on commit cbbb5e6

Please sign in to comment.