https://github.com/evilbytecode/golangstyle
GolangStyle, best looking go library.
https://github.com/evilbytecode/golangstyle
cli color color-library console-application go go-package golang package
Last synced: 16 days ago
JSON representation
GolangStyle, best looking go library.
- Host: GitHub
- URL: https://github.com/evilbytecode/golangstyle
- Owner: EvilBytecode
- License: mit
- Created: 2024-06-11T16:27:20.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-08-15T19:08:04.000Z (9 months ago)
- Last Synced: 2025-03-26T08:37:32.593Z (about 1 month ago)
- Topics: cli, color, color-library, console-application, go, go-package, golang, package
- Language: Go
- Homepage:
- Size: 19.5 KB
- Stars: 14
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GoStyle (DONT USE NOT RELIABLE AT ALL + WIN ONLY)
Best Looking Windows Color Library made for Go users!
## Install
- ```go mod init bestcolorlib```
- ```go get github.com/EvilBytecode/GolangStyle/pkg```
- ```go run .```## GoStyle Functions
- Sample README that provides documentation for the functions in the GoStyle package.
## `Init() error`- **Description:** Initializes the console, comes with simple error handle.
- **Sample Usage:**
```go
if err := gostyle.Init(); err != nil {
gostyle.Write("Failed to init console:", gostyle.RED_TO_BLACK, false)
return
}
```## `ClearConsole()`
- **Description:** Clears the console. Anything currently displayed will be removed.
- **Sample Usage:**
```go
gostyle.ClearConsole()
```## `HideCursor()`
- **Description:** Hides the console cursor.
- **Sample Usage:**
```go
gostyle.HideCursor()
```## `ShowCursor()`
- **Description:** Shows the console cursor.
- **Sample Usage:**
```go
gostyle.ShowCursor()
```## `Write(text string, gradient gostyle.Gradient, true/false)`
- **Description:** Writes text to the console with an optional gradient and centers it based on your choice.
- **Parameters:**
- `text string`: Text to be written to the console.
- `gradient gostyle.Gradient`: Optional gradient color for the text.
- `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.
- **Sample Usage:**
```go
gostyle.Write("Your text here", gostyle.PURPLE_TO_BLUE, true)
```## `WriteColorized(text string, color string, true/false)`
- **Description:** Writes text to the console with a specified color and centers it based on your choice.
- **Parameters:**
- `text string`: Text to be written to the console.
- `color string`: Color of the text (e.g., "red", "blue").
- `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.
- **Sample Usage:**
```go
gostyle.WriteColorized("Your text here", "red", true)
```### MORE IN ```main.go```
Remember to import the `gostyle` package before using these functions.
### issues with some ascii styles will be fixed soon, i just need to find time for it. but most of them are supported
### Credits:
- https://github.com/MmCopyMemory (Lots of help)
- https://github.com/billythegoat356 (GoStyle Idea, From Python to Go)