This commit is contained in:
Ryan Oldenburg 2022-06-27 00:36:45 -05:00
parent 741234786c
commit d80df8f958

View file

@ -169,13 +169,13 @@ proc toPremultipliedAlpha*(data: var seq[ColorRGBA | ColorRGBX]) {.raises: [].}
i += 4 i += 4
# Convert whatever is left # Convert whatever is left
for j in i ..< data.len: for i in i ..< data.len:
var c = data[j] var c = data[i]
if c.a != 255: if c.a != 255:
c.r = ((c.r.uint32 * c.a.uint32) div 255).uint8 c.r = ((c.r.uint32 * c.a) div 255).uint8
c.g = ((c.g.uint32 * c.a.uint32) div 255).uint8 c.g = ((c.g.uint32 * c.a) div 255).uint8
c.b = ((c.b.uint32 * c.a.uint32) div 255).uint8 c.b = ((c.b.uint32 * c.a) div 255).uint8
data[j] = c data[i] = c
proc isOpaque*(data: var seq[ColorRGBX], start, len: int): bool = proc isOpaque*(data: var seq[ColorRGBX], start, len: int): bool =
result = true result = true