lib

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReUrl           = regexp.MustCompile(`^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?(?:jpg|jpeg|gif|png|tiff|tif|bmp|webp)$`)
	ReB64           = regexp.MustCompile(`(data:image\/[^;]+;base64,.*?)`)
	ReNumberOfColor = regexp.MustCompile(`(?m)( {0,}\+.{0,})$`)
	ClipBoardTiff   = regexp.MustCompile(`(?m)[a-z0-9]{40}.tiff`)
)

Functions

func Copy added in v1.1.0

func Copy(src, dataDir string) (string, error)

func DecodeBase64

func DecodeBase64(str, dataDir string) (string, error)

func Download

func Download(url, dataDir string) (string, error)

func GenPng

func GenPng(wf *aw.Workflow, path string, colors ...color.Color)

func GenPng2 added in v1.0.0

func GenPng2(wf *aw.Workflow, path string, colors []color.Color, m map[color.Color]string, ct string)

func GenerateASE added in v1.0.0

func GenerateASE(wf *aw.Workflow, path string, hexs []string)

func Hex added in v0.2.0

func Hex(wf *aw.Workflow, col color.Color) string

func Luminance added in v1.1.0

func Luminance(col color.Color) float64

Luminance computes the luminance (~ brightness) of the given color. Range: 0.0 for black to 1.0 for white.

func RemoveAllPng added in v1.0.0

func RemoveAllPng(dir string)

Types

type ClipBoard added in v1.1.0

type ClipBoard struct {
	DataHash string `gorm:"column:dataHash"`
	Item     string `gorm:"column:item"`
	AppPath  string `gorm:"column:apppath"`
	DateTime string `gorm:"column:ts"`
}

func (ClipBoard) TableName added in v1.1.0

func (ClipBoard) TableName() string

type ClipBoardRepository added in v1.1.0

type ClipBoardRepository interface {
	List(ctx context.Context, limit int) ([]*ClipBoard, error)
}

type Handler added in v0.2.0

type Handler struct {
	Ext    string
	Decode func(r io.Reader) (image.Image, error)
	Encode func(w io.Writer, m image.Image) error
}

type HexColor added in v0.2.0

type HexColor struct {
	Hex   string
	Color color.Color
}

type HexColors added in v0.2.0

type HexColors []HexColor

func Unique added in v0.2.0

func Unique(intSlice []color.Color) HexColors

func (HexColors) Hexs added in v0.2.0

func (hs HexColors) Hexs() []string

func (HexColors) HexsString added in v0.2.0

func (hs HexColors) HexsString() string

Jump to

Keyboard shortcuts

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