Skip to content

JustTimmm/GoColor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎨 GoColor

GoColor is a lightweight Go library for adding colors and styles to your terminal output.
Instantly enhance the readability of your logs and CLI messages!

🚀 Installation

To install GoColor, run:

go get github.com/JustTimmm/GoColor

Then import it into your project:

import "github.com/JustTimmm/GoColor"

✨ Quick Example

With GoColor, you can apply text colors, background colors, and text styles (like bold, italic, etc.) to your strings. Here is a basic example:

package main

import "github.com/JustTimmm/GoColor"

func main() {
	// Text color
	GoColor.ColorLog(GoColor.ColorOption{
		TextColor: GoColor.Red,
	}, "GoColor on top!\n")

	// Background color
	GoColor.ColorLog(GoColor.ColorOption{
		BackgroundColor: GoColor.BackgroundBlue,
	}, "GoColor on top!\n")

	// Text + Background color
	GoColor.ColorLog(GoColor.ColorOption{
		TextColor: GoColor.Red,
		BackgroundColor: GoColor.BackgroundBlue,
	}, "GoColor on top!\n")
}

🛠️ Predefined Logs

GoColor includes several built-in styled logs:

GoColor.ErrorLog("Error log!\n")
GoColor.SuccessLog("Success log!\n")
GoColor.InfoLog("Info log!\n")
GoColor.DebugLog("Debug log!\n")
GoColor.WarnLog("Warn log!\n")
GoColor.RainbowLog("Rainbow Log!\n")

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

For better logs ✨

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages