diff --git a/d2common/d2fileformats/d2pl2/pl2_color_24bits.go b/d2common/d2fileformats/d2pl2/pl2_color_24bits.go index 514a2496..d6ebf7de 100644 --- a/d2common/d2fileformats/d2pl2/pl2_color_24bits.go +++ b/d2common/d2fileformats/d2pl2/pl2_color_24bits.go @@ -6,3 +6,13 @@ type PL2Color24Bits struct { 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) +}