aboutsummaryrefslogtreecommitdiffstats
path: root/ansicolor_string.go
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2025-07-04 10:29:59 -0700
committerRose Hogenson <rosehogenson@posteo.net>2025-07-04 10:32:54 -0700
commitb0454e1de6ff0cf310b3acb599a7d42d7a079423 (patch)
treebf5be14f666dd51440d48e68c466051d95caa815 /ansicolor_string.go
downloadhi-b0454e1de6ff0cf310b3acb599a7d42d7a079423.tar.zst
Initial commit
Diffstat (limited to 'ansicolor_string.go')
-rw-r--r--ansicolor_string.go40
1 files changed, 40 insertions, 0 deletions
diff --git a/ansicolor_string.go b/ansicolor_string.go
new file mode 100644
index 0000000..b811166
--- /dev/null
+++ b/ansicolor_string.go
@@ -0,0 +1,40 @@
+// Code generated by "stringer -type=ansiColor -linecomment"; DO NOT EDIT.
+
+package main
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[black-0]
+ _ = x[red-1]
+ _ = x[green-2]
+ _ = x[yellow-3]
+ _ = x[blue-4]
+ _ = x[magenta-5]
+ _ = x[cyan-6]
+ _ = x[white-7]
+ _ = x[defaultColor-9]
+}
+
+const (
+ _ansiColor_name_0 = "blackredgreenyellowbluemagentacyanwhite"
+ _ansiColor_name_1 = "default"
+)
+
+var (
+ _ansiColor_index_0 = [...]uint8{0, 5, 8, 13, 19, 23, 30, 34, 39}
+)
+
+func (i ansiColor) String() string {
+ switch {
+ case 0 <= i && i <= 7:
+ return _ansiColor_name_0[_ansiColor_index_0[i]:_ansiColor_index_0[i+1]]
+ case i == 9:
+ return _ansiColor_name_1
+ default:
+ return "ansiColor(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+}