pl2: RGBA and SetRGBA methods for PL2Color24Bits

This commit is contained in:
M. Sz 2021-03-11 11:20:15 +01:00
parent fd9c806928
commit a7b8f82204
1 changed files with 10 additions and 0 deletions

View File

@ -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)
}