[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Partially Transparent Color-Dynamic Rectangles



Ian Mallett wrote:
On 10/14/07, *Luke Paireepinart* <rabidpoobear@xxxxxxxxx <mailto:rabidpoobear@xxxxxxxxx>> wrote:

    Ian Mallett wrote:
    > Yes, but then everything behind it is brighter when it shouldn't
    be...
What do you mean by this? When you have an opaque bar of a solid color ("pygame.draw.rect(surface, (255,0,0), (rect), 1)") then it looks red. If you put it over a black background, the pixels look darker. If I compensate by making all the pixels there somewhat lighter, lighter colored objects, such as asteroids will look wrong.
That's not what I was suggesting.
I meant, if you had a (150,0,0) and it looked wrong, change it to (190,0,0) or something before blitting.
I didn't mean to change the colors of everything after blitting.
Basically just use brighter colors.
But if you were already using 255, obviously you can't use brighter colors.
Anyway, after I looked at the somewhat darker rectangle for a while, it began looking right. It was just a change from the (255,0,0) bar to something like (150,0,0), which is how it should be.
Yep. It probably just looked strange because you were used to seeing the opaque version.

    The color you're using is a brighter color, so if you're alpha
    blending
    it then it'll make everything you're blending that's darker than it
    brighter.
    >   the solution is to use a more neutral background.
    Do you mean a brighter background?

Yes.
Okay.

-Luke