Codebase list golang-github-ttacon-chalk / 3be1ed5a-7e6b-4d35-a9a1-98068a75fd53/upstream
Import upstream version 0.1+git20160626.1.22c06c8 Debian Janitor 2 years ago
2 changed file(s) with 5 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
1919 simplified version of what you can do with chalk.
2020
2121 The following code:
22 ```
22 ```go
2323 package main
2424
2525 import (
6363 WARNING
6464 =============
6565
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 :)
4444 start, stop textStyleDemarcation
4545 }
4646
47 // TexStyle styles the given string using the desired text style.
47 // TextStyle styles the given string using the desired text style.
4848 func (t TextStyle) TextStyle(val string) string {
4949 if t == emptyTextStyle {
5050 return val
131131
132132 var (
133133 // Colors
134
134135 Black = Color{0}
135136 Red = Color{1}
136137 Green = Color{2}
142143 ResetColor = Color{9}
143144
144145 // Text Styles
146
145147 Bold = TextStyle{1, 22}
146148 Dim = TextStyle{2, 22}
147149 Italic = TextStyle{3, 23}