hsutil

package
v0.0.0-...-165de30 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package hsutil holds utility and helper functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolToInt

func BoolToInt(b bool) int32

BoolToInt converts bool into 32-bit integer if b is true, then returns 1, else 0

func Color

func Color(rgba uint32) color.RGBA

Color converts an rgba uint32 to a colorEnabled.RGBA

func CreateFileAtPath

func CreateFileAtPath(pathToFile string, data []byte) bool

CreateFileAtPath creates file at path

func ExportToGif

func ExportToGif(images []*image.RGBA, delay int32) error

ExportToGif converts images area to GIF format and saves it under the path selected by user tutorial: http://tech.nitoyon.com/en/blog/2016/01/07/go-animated-gif-gen/

func ExportToPng

func ExportToPng(images []*image.RGBA) error

ExportToPng converts images area to PNG frames and saves it under the path selected by user

func Hex2RGB

func Hex2RGB(hex string) (r, g, b uint8, err error)

Hex2RGB converts haxadecimal string color into r, g, b

func RGB2Hex

func RGB2Hex(red, green, blue uint8) string

RGB2Hex converts RGB color into hexadecimal string

func SplitIntoLinesWithMaxWidth

func SplitIntoLinesWithMaxWidth(fullSentence string, maxChars int) []string

SplitIntoLinesWithMaxWidth splits the given string into lines considering the given maxChars

func Wrap

func Wrap[T int | int32](x, maxV T) T

Wrap integer to max: wrap(450, 360) == 90

Types

This section is empty.

Jump to

Keyboard shortcuts

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