Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change default
ColorMaterial
color to white (#3981)
# Context I wanted to add a `texture` to my `ColorMaterial` without explicitly adding a `color`. To do this I used `..Default::default()` which in turn gave me unexpected results. I was expecting that my texture would render without any color modifications, but to my surprise it got rendered in a purple tint (`Color::rgb(1.0, 0.0, 1.0)`). To fix this I had to explicitly define the `color` using `color: Color::WHITE`. ## What I wanted to use ```rust commands .spawn_bundle(MaterialMesh2dBundle { mesh: mesh_handle.clone().into(), transform: Transform::default().with_scale(Vec3::splat(8.)), material: materials.add(ColorMaterial { texture: Some(texture_handle.clone()), ..Default::default() // here }), ..Default::default() }) ```  ## What I had to use instead ```rust commands .spawn_bundle(MaterialMesh2dBundle { mesh: mesh_handle.clone().into(), transform: Transform::default().with_scale(Vec3::splat(8.)), material: materials.add(ColorMaterial { texture: Some(texture_handle.clone()), color: Color::WHITE, // here }), ..Default::default() }) ``` 
- Loading branch information