util

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdjustColour

func AdjustColour(value string, adjustment int) string

AdjustColour adjusts a colour's brightness or darkness.

Assumes colour begins with '#' and returns a colour beginning with '#'.

func FormatBytes

func FormatBytes(bytes float64, sf int) string

FormatBytes formats bytes as gigabytes to sf significant figures.

func FormatSf

func FormatSf(value float64, sf int) string

FormatSf formats value with sf significant figures. The horizontal space used will remain static.

func GetAtIndex

func GetAtIndex[T any](a []T, i int) T

GetAtIndex returns the value at index i or the default value for type T if it does not exist.

Types

This section is empty.

Jump to

Keyboard shortcuts

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