utils

package
v0.0.0-...-921f456 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BLACK = Color{R: 0, G: 0, B: 0}
View Source
var DEBUG = false
View Source
var IDColors = []ColorPair{
	{Color{R: 0, G: 0, B: 0}, WHITE},
	{Color{R: 255, G: 255, B: 255}, BLACK},
	{Color{R: 255, G: 127, B: 17}, WHITE},
	{Color{R: 255, G: 63, B: 0}, WHITE},
	{Color{R: 163, G: 0, B: 0}, WHITE},
	{Color{R: 239, G: 210, B: 141}, BLACK},
	{Color{R: 0, G: 175, B: 181}, WHITE},
	{Color{R: 134, G: 19, B: 136}, WHITE},
	{Color{R: 238, G: 171, B: 196}, BLACK},
	{Color{R: 201, G: 206, B: 189}, BLACK},
	{Color{R: 100, G: 64, B: 62}, WHITE},
	{Color{R: 37, G: 40, B: 61}, WHITE},
	{Color{R: 97, G: 201, B: 168}, BLACK},
	{Color{R: 165, G: 56, B: 96}, WHITE},
	{Color{R: 219, G: 254, B: 135}, BLACK},
	{Color{R: 28, G: 68, B: 142}, WHITE},
	{Color{R: 209, G: 122, B: 34}, WHITE},
	{Color{R: 42, G: 245, B: 255}, BLACK},
	{Color{R: 182, G: 198, B: 73}, BLACK},
	{Color{R: 56, G: 102, B: 65}, WHITE},
	{Color{R: 233, G: 223, B: 0}, BLACK},
	{Color{R: 255, G: 212, B: 0}, BLACK},
}
View Source
var INFO = false
View Source
var WARN = false
View Source
var WHITE = Color{R: 255, G: 255, B: 255}

Functions

func Debug

func Debug(msg string, args ...any) string

func Error

func Error(msg string, args ...any) string

func Fatal

func Fatal(msg string, args ...any) string

func FmtErr

func FmtErr(msg string, args ...any) string

func Info

func Info(msg string, args ...any) string

func Itoa

func Itoa(val int) string

func Itoa64

func Itoa64(val int64) string

func NewError

func NewError(msg string, args ...any) error

func Warn

func Warn(msg string, args ...any) string

Types

type Color

type Color struct {
	R, G, B uint8
}

type ColorPair

type ColorPair struct {
	A Color
	B Color
}

func GetIDColor

func GetIDColor() ColorPair

type OrderedMap

type OrderedMap[K comparable, V any] struct {
	M    map[K]V
	Keys []K
	// contains filtered or unexported fields
}

func NewOrderedMap

func NewOrderedMap[K comparable, V any]() *OrderedMap[K, V]

func NewOrderedMapSized

func NewOrderedMapSized[K comparable, V any](size int) *OrderedMap[K, V]

func (*OrderedMap[K, V]) Delete

func (om *OrderedMap[K, V]) Delete(key K)

func (OrderedMap[K, V]) Get

func (om OrderedMap[K, V]) Get(key K) (V, bool)

func (OrderedMap[K, V]) GetAtIndex

func (om OrderedMap[K, V]) GetAtIndex(index int) (V, bool)

func (OrderedMap[K, V]) GetKeys

func (om OrderedMap[K, V]) GetKeys() []K

func (OrderedMap[K, V]) Len

func (om OrderedMap[K, V]) Len() int

func (*OrderedMap[K, V]) Set

func (om *OrderedMap[K, V]) Set(key K, value V)

func (*OrderedMap[K, V]) SetAtIndex

func (om *OrderedMap[K, V]) SetAtIndex(index int, value V)

func (*OrderedMap[K, V]) Values

func (om *OrderedMap[K, V]) Values() []V

Jump to

Keyboard shortcuts

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