https://github.com/halsten-dev/gormatter
Gormatter in a small lib to help making colored and stylized outputs in the terminal.
https://github.com/halsten-dev/gormatter
color easytouse go golang lightweight output print style terminal
Last synced: 7 months ago
JSON representation
Gormatter in a small lib to help making colored and stylized outputs in the terminal.
- Host: GitHub
- URL: https://github.com/halsten-dev/gormatter
- Owner: halsten-dev
- License: mit
- Created: 2024-11-10T06:12:03.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-11-20T14:48:55.000Z (11 months ago)
- Last Synced: 2025-01-22T22:11:21.312Z (9 months ago)
- Topics: color, easytouse, go, golang, lightweight, output, print, style, terminal
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gormatter
## Introduction
Gormatter in a small lib to help making colored and stylized outputs in the terminal.## How to use
Import the package :```go
import (
gmt "github.com/halsten-dev/gormatter"
)
```Then there is choice between multiple function :
```go
fmt.Println(gmt.Bold(gmt.Red, gmt.None, "Text in red and bold"))
fmt.Println(gmt.BoldItalic(gmt.Blue, gmt.Yellow, "Text in blue, bold and italic with yellow background"))
fmt.Println(gmt.Italic(gmt.Yellow, gmt.Cyan, "Text in yellow in italic with cyan background"))
```Available colors :
```go
Black
Red
Green
Yellow
Blue
Magenta
Cyan
WhiteHighBlack
HighRed
HighGreen
HighYellow
HighBlue
HighMagenta
HighCyan
HighWhite
```Available functions :
```go
func Normal(foregroundColor int, backgroundColor int, text string) stringfunc Bold(foregroundColor int, backgroundColor int, text string) string
func Italic(foregroundColor int, backgroundColor int, text string) string
func Underline(foregroundColor int, backgroundColor int, text string) string
func BoldItalic(foregroundColor int, backgroundColor int, text string) string
func BoldUnderline(foregroundColor int, backgroundColor int, text string) string
func BoldItalicUnderline(foregroundColor int, backgroundColor int, text string) string
func ItalicUnderline(foregroundColor int, backgroundColor int, text string) string
```## License
MIT LicenseCopyright (c) 2024 Lionel Leeser
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.