package state // ColorFromInt decodes a packed uint32 into a hex color. func ColorFromInt(value uint32) Color { return Color{ R: uint8((value >> 24) & 0xFF), G: uint8((value >> 16) & 0xFF), B: uint8((value >> 8) & 0xFF), A: uint8((value >> 0) & 0xFF), } } // ToInt packs a hex color into a uint32. func (c Color) ToInt() uint32 { return uint32(c.R)<<24 | uint32(c.G)<<16 | uint32(c.B)<<8 | uint32(c.A) }