chore: fmt
759d1568
1 file(s) · +26 −26
| 5 | 5 | ) |
|
| 6 | 6 | ||
| 7 | 7 | const ( |
|
| 8 | - | Reset = "\033[0m" |
|
| 9 | - | Bold = "\033[1m" |
|
| 10 | - | Red = "\033[31m" |
|
| 11 | - | Green = "\033[32m" |
|
| 12 | - | Yellow = "\033[33m" |
|
| 13 | - | Blue = "\033[34m" |
|
| 14 | - | Magenta = "\033[35m" |
|
| 15 | - | Cyan = "\033[36m" |
|
| 16 | - | White = "\033[37m" |
|
| 17 | - | Gray = "\033[90m" |
|
| 8 | + | Reset = "\033[0m" |
|
| 9 | + | Bold = "\033[1m" |
|
| 10 | + | Red = "\033[31m" |
|
| 11 | + | Green = "\033[32m" |
|
| 12 | + | Yellow = "\033[33m" |
|
| 13 | + | Blue = "\033[34m" |
|
| 14 | + | Magenta = "\033[35m" |
|
| 15 | + | Cyan = "\033[36m" |
|
| 16 | + | White = "\033[37m" |
|
| 17 | + | Gray = "\033[90m" |
|
| 18 | 18 | ) |
|
| 19 | 19 | ||
| 20 | 20 | type Color struct { |
|
| 21 | - | Name string |
|
| 22 | - | Code string |
|
| 21 | + | Name string |
|
| 22 | + | Code string |
|
| 23 | 23 | } |
|
| 24 | 24 | ||
| 25 | 25 | var Palette = []Color{ |
|
| 26 | - | {"Red", Red}, |
|
| 27 | - | {"Green", Green}, |
|
| 28 | - | {"Yellow", Yellow}, |
|
| 29 | - | {"Blue", Blue}, |
|
| 30 | - | {"Magenta", Magenta}, |
|
| 31 | - | {"Cyan", Cyan}, |
|
| 32 | - | {"White", White}, |
|
| 33 | - | {"Gray", Gray}, |
|
| 26 | + | {"Red", Red}, |
|
| 27 | + | {"Green", Green}, |
|
| 28 | + | {"Yellow", Yellow}, |
|
| 29 | + | {"Blue", Blue}, |
|
| 30 | + | {"Magenta", Magenta}, |
|
| 31 | + | {"Cyan", Cyan}, |
|
| 32 | + | {"White", White}, |
|
| 33 | + | {"Gray", Gray}, |
|
| 34 | 34 | } |
|
| 35 | 35 | ||
| 36 | 36 | func Colorize(color, s string) string { |
|
| 61 | 61 | } |
|
| 62 | 62 | ||
| 63 | 63 | func PrintPalette() { |
|
| 64 | - | fmt.Print(" ") |
|
| 65 | - | for _, c := range Palette { |
|
| 66 | - | swatch := Colorize(c.Code, "● ") |
|
| 67 | - | fmt.Print(swatch) |
|
| 68 | - | } |
|
| 69 | - | fmt.Println() |
|
| 64 | + | fmt.Print(" ") |
|
| 65 | + | for _, c := range Palette { |
|
| 66 | + | swatch := Colorize(c.Code, "● ") |
|
| 67 | + | fmt.Print(swatch) |
|
| 68 | + | } |
|
| 69 | + | fmt.Println() |
|
| 70 | 70 | } |
|