colorz

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 3 Imported by: 3

README

gopherz

ezpkg.io/colorz

PkgGoDev GitHub License version

Package colorz provides utilities for working with colors in terminal.

Installation

go get -u ezpkg.io/colorz@v0.2.2

Examples

colorz.Color
colorz.Yellow.Wrap("this is yellow")
colorz.Red.Printf("error: %s", "something went wrong")
fmt.Printf("roses are %sred%s and violets are %sblue%s\n", colorz.Red,colorz.Reset, colorz.Green, colorz.Reset)

Similar Packages

About ezpkg.io

As I work on various Go projects, I often find myself creating utility functions, extending existing packages, or developing packages to solve specific problems. Moving from one project to another, I usually have to copy or rewrite these solutions. So I created this repository to have all these utilities and packages in one place. Hopefully, you'll find them useful as well.

For more information, see the main repository.

Author

Oliver Nguyen  github

Documentation

Overview

Package colorz provides utilities for working with colors in terminal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Color

type Color byte
const (
	Black Color = iota + 30
	Red
	Green
	Yellow
	Blue
	Magenta
	Cyan
	White

	Reset Color = 0
)

func (Color) Code

func (c Color) Code() string

func (Color) Format

func (c Color) Format(s0 fmt.State, verb rune)

func (Color) Fprintf

func (c Color) Fprintf(w io.Writer, format string, args ...any) (n int, err error)

func (Color) Print

func (c Color) Print(args ...any)

func (Color) Printf

func (c Color) Printf(format string, args ...any)

func (Color) Println

func (c Color) Println(args ...any)

func (Color) Sprint

func (c Color) Sprint(args ...any) string

func (Color) Sprintf

func (c Color) Sprintf(format string, args ...any) string

func (Color) String

func (c Color) String() string

func (Color) Wrap

func (c Color) Wrap(s string) string

Jump to

Keyboard shortcuts

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