Skip to content

Fix clear color in CompositingSpace::Srgb#23963

Merged
alice-i-cecile merged 4 commits intobevyengine:mainfrom
beicause:clear-color-srgb
Apr 24, 2026
Merged

Fix clear color in CompositingSpace::Srgb#23963
alice-i-cecile merged 4 commits intobevyengine:mainfrom
beicause:clear-color-srgb

Conversation

@beicause
Copy link
Copy Markdown
Member

Objective

Split off from #23803, Fix ClearColor with CompositingSpace::Srgb.

Solution

Convert clear color to Srgb

Testing

Code from #9213 (comment):

//!

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .insert_resource(ClearColor(Color::srgba(0., 0.5, 0., 1.)))
        .add_systems(Startup, |mut commands: Commands| {
            commands.spawn((Camera2d, CompositingSpace::Srgb));

            commands.spawn((
                Sprite::from_color(Color::WHITE.with_alpha(0.5), Vec2::new(512., 512.)),
                Transform::from_xyz(-256., 0., 0.),
            ));

            commands.spawn((
                Sprite::from_color(Color::BLACK.with_alpha(0.5), Vec2::new(512., 512.)),
                Transform::from_xyz(256., 0., 0.),
            ));
        })
        .run();
}

Before:
屏幕截图_20260414_120259

After:
屏幕截图_20260414_115624

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen X-Uncontroversial This work is generally agreed upon D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 24, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Apr 24, 2026
Comment thread crates/bevy_render/src/view/mod.rs Outdated
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 24, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 24, 2026
Merged via the queue into bevyengine:main with commit dca740e Apr 24, 2026
40 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in Rendering Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Uncontroversial This work is generally agreed upon

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants