Skip to content

Simple alpha blending as a special flag for Surface.fill #2435

Open
@Matiiss

Description

So basically add a flag that lets you do simple alpha blending using Surface.fill. It would be the equivalent of creating a surface with a certain alpha value and blitting that on the target surface, essentially this:

image = pygame.image.load(...).convert_alpha()

tint = pygame.Surface(image.get_size(), flags=pygame.SRCALPHA)
tint.fill((255, 0, 0, 100))  # red tint
image.blit(tint, (0, 0))

could turn into this:

image = pygame.image.load(...).convert_alpha()
image.fill((255, 0, 0, 100), special_flags=pygame.BLEND_RGBA)  # naming can be discussed obvs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions