alpha-multiplier: perform multiplication in the renderer
This commit is contained in:
parent
33718340f7
commit
0872a1251d
8 changed files with 46 additions and 22 deletions
|
|
@ -115,8 +115,9 @@ impl Color {
|
|||
[to_u8(self.r), to_u8(self.g), to_u8(self.b), to_u8(self.a)]
|
||||
}
|
||||
|
||||
pub fn to_array_srgb(self) -> [f32; 4] {
|
||||
[self.r, self.g, self.b, self.a]
|
||||
pub fn to_array_srgb(self, alpha: Option<f32>) -> [f32; 4] {
|
||||
let a = alpha.unwrap_or(1.0);
|
||||
[self.r * a, self.g * a, self.b * a, self.a * a]
|
||||
}
|
||||
|
||||
#[expect(dead_code)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue