From fd9c8069284e8d51ca92ed75f319c6398e187fec Mon Sep 17 00:00:00 2001 From: "M. Sz" Date: Thu, 11 Mar 2021 10:19:19 +0100 Subject: [PATCH] d2pl2: lintfix --- d2common/d2fileformats/d2pl2/pl2_color.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/d2common/d2fileformats/d2pl2/pl2_color.go b/d2common/d2fileformats/d2pl2/pl2_color.go index 6b7666bb..835c8b2d 100644 --- a/d2common/d2fileformats/d2pl2/pl2_color.go +++ b/d2common/d2fileformats/d2pl2/pl2_color.go @@ -5,6 +5,8 @@ const ( bitShift8 bitShift16 bitShift24 + + mask = 0xff ) // PL2Color represents an RGBA color @@ -15,14 +17,12 @@ type PL2Color struct { _ uint8 } -const ( - mask = 0xff -) - +// RGBA returns RGBA values of PL2Color func (p *PL2Color) RGBA() uint32 { return toComposite(p.R, p.G, p.B, mask) } +// SetRGBA sets PL2Color's value to rgba given func (p *PL2Color) SetRGBA(rgba uint32) { p.R, p.G, p.B, _ = toComponent(rgba) }