mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
impl AddAssign for Color
This commit is contained in:
parent
c2c543e0ba
commit
0c3a77ac9f
1 changed files with 12 additions and 1 deletions
|
@ -3,7 +3,7 @@ use crate::shader::ShaderDefSuffixProvider;
|
|||
use bevy_asset::Handle;
|
||||
use bevy_core::bytes::GetBytes;
|
||||
use glam::Vec4;
|
||||
use std::ops::Add;
|
||||
use std::ops::{AddAssign, Add};
|
||||
use zerocopy::AsBytes;
|
||||
|
||||
#[repr(C)]
|
||||
|
@ -25,6 +25,17 @@ impl Color {
|
|||
}
|
||||
}
|
||||
|
||||
impl AddAssign<Color> for Color {
|
||||
fn add_assign(&mut self, rhs: Color) {
|
||||
*self = Color {
|
||||
r: self.r + rhs.r,
|
||||
g: self.g + rhs.g,
|
||||
b: self.b + rhs.b,
|
||||
a: self.a + rhs.a,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Add<Color> for Color {
|
||||
type Output = Color;
|
||||
fn add(self, rhs: Color) -> Self::Output {
|
||||
|
|
Loading…
Reference in a new issue