MCPcopy Create free account
hub / github.com/SolarLune/masterplan / ColorFromHexString

Function ColorFromHexString

utils.go:708–718  ·  view source on GitHub ↗
(hex string)

Source from the content-addressed store, hash-verified

706}
707
708func ColorFromHexString(hex string) Color {
709
710 c := NewColor(0, 0, 0, 255)
711 for i := 0; i < len(hex); i += 2 {
712 v, _ := strconv.ParseInt(hex[i:i+2], 16, 32)
713 c[i/2] = uint8(v)
714 }
715
716 return c
717
718}
719
720var ColorTransparent = NewColor(0, 0, 0, 0)
721var ColorWhite = NewColor(255, 255, 255, 255)

Callers 2

DeserializeMethod · 0.85
ConstructMenusFunction · 0.85

Calls 1

NewColorFunction · 0.85

Tested by

no test coverage detected