1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-04 15:00:42 +00:00
OpenDiablo2/d2common/d2fileformats/d2pl2/pl2_color_24bits.go
2021-03-11 20:24:08 +01:00

19 lines
373 B
Go

package d2pl2
// PL2Color24Bits represents an RGB color
type PL2Color24Bits struct {
R uint8
G uint8
B uint8
}
// RGBA returns RGBA values of PL2Color
func (p *PL2Color24Bits) RGBA() uint32 {
return toComposite(p.R, p.G, p.B, mask)
}
// SetRGBA sets PL2Color's value to rgba given
func (p *PL2Color24Bits) SetRGBA(rgba uint32) {
p.R, p.G, p.B = toComponent(rgba)
}