Import upstream version 0.1+git20160626.1.22c06c8
Debian Janitor
2 years ago
19 | 19 |
simplified version of what you can do with chalk.
|
20 | 20 |
|
21 | 21 |
The following code:
|
22 | |
```
|
|
22 |
```go
|
23 | 23 |
package main
|
24 | 24 |
|
25 | 25 |
import (
|
|
63 | 63 |
WARNING
|
64 | 64 |
=============
|
65 | 65 |
|
66 | |
This package should be pretty stable (I don't forsee backwards incompatible changes), but I'm not making any promises :)⏎
|
|
66 |
This package should be pretty stable (I don't forsee backwards incompatible changes), but I'm not making any promises :)
|
44 | 44 |
start, stop textStyleDemarcation
|
45 | 45 |
}
|
46 | 46 |
|
47 | |
// TexStyle styles the given string using the desired text style.
|
|
47 |
// TextStyle styles the given string using the desired text style.
|
48 | 48 |
func (t TextStyle) TextStyle(val string) string {
|
49 | 49 |
if t == emptyTextStyle {
|
50 | 50 |
return val
|
|
131 | 131 |
|
132 | 132 |
var (
|
133 | 133 |
// Colors
|
|
134 |
|
134 | 135 |
Black = Color{0}
|
135 | 136 |
Red = Color{1}
|
136 | 137 |
Green = Color{2}
|
|
142 | 143 |
ResetColor = Color{9}
|
143 | 144 |
|
144 | 145 |
// Text Styles
|
|
146 |
|
145 | 147 |
Bold = TextStyle{1, 22}
|
146 | 148 |
Dim = TextStyle{2, 22}
|
147 | 149 |
Italic = TextStyle{3, 23}
|