Skip to content

blendMode(REPLACE): the new color alpha is in fact utilized #871

Open
@KrabCode

Description

@KrabCode

Issue description

The reference on blendMode() says:

REPLACE - the pixels entirely replace the others and don't utilize alpha (transparency) values

This is confusing to me, it feels like I cannot set alpha to 0 with it because the new alpha values would not be utilized according to the reference (?), but in fact I can set alpha to 0 with it. This is the desired REPLACE behavior in my opinion, it's only the reference that is confusing me. I can understand the original pixel alpha not being utilized when completely replaced, but the reference makes it seem the new alpha will not be used either.

This behavior is demonstrated here with fill(0,0) and stroke(0,0) on a foreground canvas to reveal an underlying image:
https://gist.github.com/KrabCode/0335de613bbef231e7ec95ac6b60bf8f

URL(s) of affected page(s)

https://processing.org/reference/blendMode_.html

Proposed fix

REPLACE - the pixels entirely replace the others and don't utilize alpha (transparency) values of the original

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions