We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm writing some code that generates a bitmap, pixel by pixel with some partial transparency. The pixels that are partially transparent don't show the colour I expect. Here's an example to illustrate the problem:
background(0,0,0) size(100,100) noStroke() c=color(0x7F7F0000) fill(c) rect(50,50,50,50) loadPixels() for y in range(50): for x in range(50): pixels[x+width*y]=c updatePixels()
I'd expect this to draw two identical squares. The square drawn by 'rect' is as I would expect (dull red). The square drawn by 'pixels' is unexpectedly bright. Is this expected behaviour? And if so, how should I modify my code?