|
1 | | -# GolangStyle |
2 | | -GolangStyle |
| 1 | +# GoStyle |
| 2 | +Best Looking Windows Color Library made for Go users! |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | +## GoStyle Functions |
| 7 | + |
| 8 | +- Sample README that provides documentation for the functions in the GoStyle package. |
| 9 | + |
| 10 | +## `Init() error` |
| 11 | + |
| 12 | +- **Description:** Initializes the console, comes with simple error handle. |
| 13 | +- **Sample Usage:** |
| 14 | +```go |
| 15 | +if err := gostyle.Init(); err != nil { |
| 16 | + gostyle.Write("Failed to init console:", gostyle.RED_TO_BLACK, false) |
| 17 | + return |
| 18 | +} |
| 19 | +``` |
| 20 | + |
| 21 | +## `ClearConsole()` |
| 22 | + |
| 23 | +- **Description:** Clears the console. Anything currently displayed will be removed. |
| 24 | +- **Sample Usage:** |
| 25 | +```go |
| 26 | +gostyle.ClearConsole() |
| 27 | +``` |
| 28 | + |
| 29 | +## `HideCursor()` |
| 30 | + |
| 31 | +- **Description:** Hides the console cursor. |
| 32 | +- **Sample Usage:** |
| 33 | +```go |
| 34 | +gostyle.HideCursor() |
| 35 | +``` |
| 36 | + |
| 37 | +## `ShowCursor()` |
| 38 | + |
| 39 | +- **Description:** Shows the console cursor. |
| 40 | +- **Sample Usage:** |
| 41 | +```go |
| 42 | +gostyle.ShowCursor() |
| 43 | +``` |
| 44 | + |
| 45 | +## `Write(text string, gradient gostyle.Gradient, true/false)` |
| 46 | + |
| 47 | +- **Description:** Writes text to the console with an optional gradient and centers it based on your choice. |
| 48 | +- **Parameters:** |
| 49 | + - `text string`: Text to be written to the console. |
| 50 | + - `gradient gostyle.Gradient`: Optional gradient color for the text. |
| 51 | + - `true`: You Decide if it should be in center set true or false based on if you want the text to be centered or not. |
| 52 | +- **Sample Usage:** |
| 53 | +```go |
| 54 | +gostyle.Write("Your text here", gostyle.PURPLE_TO_BLUE, true) |
| 55 | +``` |
| 56 | + |
| 57 | +## `WriteColorized(text string, color string, true/false)` |
| 58 | + |
| 59 | +- **Description:** Writes text to the console with a specified color and centers it based on your choice. |
| 60 | +- **Parameters:** |
| 61 | + - `text string`: Text to be written to the console. |
| 62 | + - `color string`: Color of the text (e.g., "red", "blue"). |
| 63 | + - `true`: You Decide if it should be in center set true or false based on if you want the text to be centered or not. |
| 64 | +- **Sample Usage:** |
| 65 | +```go |
| 66 | +gostyle.WriteColorized("Your text here", "red", true) |
| 67 | +``` |
| 68 | + |
| 69 | +## `WriteAscii(text string, gradient gostyle.Gradient, true/false)` |
| 70 | + |
| 71 | +- **Description:** Writes ASCII art to the console with an optional gradient and centers it based on your choice. |
| 72 | +- **Parameters:** |
| 73 | + - `text string`: ASCII art to be written to the console. |
| 74 | + - `gradient gostyle.Gradient`: Optional gradient color for the ASCII art. |
| 75 | + - `true`: You Decide if it should be in center set true or false based on if you want the text to be centered or not. |
| 76 | +- **Sample Usage:** |
| 77 | +```go |
| 78 | +gostyle.WriteAscii("Your ASCII art here", gostyle.PURPLE_TO_BLUE, true) |
| 79 | +``` |
| 80 | + |
| 81 | +Remember to import the `gostyle` package before using these functions. |
| 82 | + |
| 83 | +### Credits: |
| 84 | +- https://github.com/MmCopyMemory (Lots of help) |
| 85 | +- https://github.com/billythegoat356 (GoStyle Idea, From Python to Go) |
0 commit comments