Skip to content

Color PartialEq is broken when comparing different variants #9750

@JMS55

Description

@JMS55

Bevy version

0.11.2

Bug

Color PartialEq is implemented via derive. This means that different variants won't be equivalent, even if logically they should be.

Color::BLACK is Rgba(0, 0, 0, 1). RgbaLinear(0, 0, 0, 1) should be equivalent, but it is currently not.

We should write a by-hand PartialEq impl that converts all color variants to Rgba (or whatever we expect to incur the least conversion overhead), and then checks equivalence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions