gostyle

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// these are static colors, made for simple printing they are not assosicated with gradients colors at all.
	Reset   = "\033[0m"
	Red     = "\033[31m"
	Green   = "\033[32m"
	Yellow  = "\033[33m"
	Blue    = "\033[34m"
	Magenta = "\033[35m"
	Cyan    = "\033[36m"
	White   = "\033[37m"
	// these are gradient colors, there arent assosicated with static ones, these are the colors that have transitions
	BLACK_TO_WHITE  = []int{0, 0, 0, 255, 255, 255}
	BLACK_TO_RED    = []int{0, 0, 0, 255, 0, 0}
	BLACK_TO_GREEN  = []int{0, 0, 0, 0, 255, 0}
	BLACK_TO_BLUE   = []int{0, 0, 0, 0, 0, 255}
	WHITE_TO_BLACK  = []int{255, 255, 255, 0, 0, 0}
	WHITE_TO_RED    = []int{255, 255, 255, 255, 0, 0}
	WHITE_TO_GREEN  = []int{255, 255, 255, 0, 255, 0}
	WHITE_TO_BLUE   = []int{255, 255, 255, 0, 0, 255}
	RED_TO_BLACK    = []int{255, 0, 0, 0, 0, 0}
	RED_TO_WHITE    = []int{255, 0, 0, 255, 255, 255}
	RED_TO_YELLOW   = []int{255, 0, 0, 255, 255, 0}
	RED_TO_PURPLE   = []int{255, 0, 0, 255, 0, 255}
	GREEN_TO_BLACK  = []int{0, 255, 0, 0, 0, 0}
	GREEN_TO_WHITE  = []int{0, 255, 0, 255, 255, 255}
	GREEN_TO_YELLOW = []int{0, 255, 0, 255, 255, 0}
	GREEN_TO_CYAN   = []int{0, 255, 0, 0, 255, 255}
	BLUE_TO_BLACK   = []int{0, 0, 255, 0, 0, 0}
	BLUE_TO_WHITE   = []int{0, 0, 255, 255, 255, 255}
	BLUE_TO_CYAN    = []int{0, 0, 255, 0, 255, 255}
	BLUE_TO_PURPLE  = []int{0, 0, 255, 255, 0, 255}
	YELLOW_TO_RED   = []int{255, 255, 0, 255, 0, 0}
	YELLOW_TO_GREEN = []int{255, 255, 0, 0, 255, 0}
	PURPLE_TO_RED   = []int{255, 0, 255, 255, 0, 0}
	PURPLE_TO_BLUE  = []int{255, 0, 255, 0, 0, 255}
	CYAN_TO_GREEN   = []int{0, 255, 255, 0, 255, 0}
	CYAN_TO_BLUE    = []int{0, 255, 255, 0, 0, 255}

	// this is init, this makes sure that colors print out successfully
	ENABLE_VIRTUAL_TERMINAL_PROCESSING uint32 = 0x0004
)

please don't skid or you're a noob lol

Functions

func CenterText

func CenterText(text string) string

func ClearConsole

func ClearConsole()

func Colorize

func Colorize(text, color string) string

Colorize applies color to text based on the provided color string.

func GradientFade

func GradientFade(text string, colors []int) string

GradientFade applies a gradient color effect to text.

func HideCursor

func HideCursor()

hide console cursror

func Init

func Init() error

func ShowCursor

func ShowCursor()

show console cursor

func Write

func Write(text string, colors []int, center bool)

Write writes text to the console, optionally applying colors and centering it.

func WriteColorized

func WriteColorized(text, color string, center bool)

WriteColorized writes colorized text to the console, optionally centering it.

Types

type CONSOLE_CURSOR_INFO

type CONSOLE_CURSOR_INFO struct {
	Size    uint32
	Visible int32
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL