MCPcopy Create free account
hub / github.com/efogdev/mpris-timer / RGBAFromHex

Function RGBAFromHex

internal/core/prefs.go:79–87  ·  view source on GitHub ↗

RGBAFromHex assumes the value is correct and ignores alpha

(hex string)

Source from the content-addressed store, hash-verified

77
78// RGBAFromHex assumes the value is correct and ignores alpha
79func RGBAFromHex(hex string) (*gdk.RGBA, error) {
80 rgba := gdk.NewRGBA(0, 0, 0, 255)
81 ok := rgba.Parse(hex)
82 if !ok {
83 return nil, fmt.Errorf("invalid hex string")
84 }
85
86 return &rgba, nil
87}
88
89func SetShowPresets(value bool) {
90 UserPrefs.ShowPresets = value

Callers 1

populateVisualsGroupFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected