helper

package
v2.0.0-...-01b1ccc Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ColorHexFormatErr = errors.New("hex color must start with '#'")
	ColorInvalidErr   = errors.New("hexToByte component invalid")
)

Functions

func FormatAlpha

func FormatAlpha(val float32) uint8

FormatAlpha formats the alpha value

func HexToRgb

func HexToRgb(hex string) (int64, int64, int64)

HexToRgb converts hexadecimal color to RGB color

func InArrayWithStr

func InArrayWithStr(items []string, s string) bool

InArrayWithStr checks if a string is in an array

func IsChineseChar

func IsChineseChar(str string) bool

IsChineseChar checks if a string contains Chinese characters

func LenChineseChar

func LenChineseChar(str string) int

LenChineseChar calculates the character length of a string (supports Chinese)

func ParseHexColor

func ParseHexColor(s string) (c color.RGBA, err error)

ParseHexColor converts a hex color to an RGBA color

func PathExists

func PathExists(path string) (bool, error)

PathExists checks if a file path exists

func RandIndex

func RandIndex(length int) int

RandIndex generates a random index

func RgbToHex

func RgbToHex(red int64, green int64, blue int64) string

RgbToHex converts RGB color to hexadecimal color

Types

This section is empty.

Jump to

Keyboard shortcuts

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