helper

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 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 '#'")
View Source
var ColorInvalidErr = errors.New("hexToByte component invalid")

Functions

func FormatAlpha

func FormatAlpha(val float32) uint8

FormatAlpha is formatting transparent

func HexToRgb

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

HexToRgb is to turn hex color to RBG color

func InArrayWithStr

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

InArrayWithStr is the verification whether it is in the array

func IsChineseChar

func IsChineseChar(str string) bool

IsChineseChar is to detect whether it is Chinese

func LenChineseChar

func LenChineseChar(str string) int

LenChineseChar is to calc Chinese and letter length

func ParseHexColor

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

ParseHexColor is to turn the hex color to RGB color

func PathExists

func PathExists(path string) (bool, error)

PathExists is to detect whether the file exists

func RandIndex

func RandIndex(length int) int

RandIndex is to the random length range value

func RgbToHex

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

RgbToHex is to turn RBG color to hex color

Types

This section is empty.

Jump to

Keyboard shortcuts

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