Upgrade SAO theming #43
|
@ -173,13 +173,13 @@ impl Color {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn alpha_multiply(&self, mul: u8) -> Self {
|
pub const fn alpha_multiply(&self, mul: u8) -> Self {
|
||||||
let a = self.0 as u8 as u16;
|
let a = self.0 as u8 as u16;
|
||||||
let multiplied = ((a * (mul as u16)) >> 8) as u8;
|
let multiplied = ((a * (mul as u16)) >> 8) as u8;
|
||||||
self.with_alpha(multiplied)
|
self.with_alpha(multiplied)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_alpha(&self, alpha: u8) -> Self {
|
pub const fn with_alpha(&self, alpha: u8) -> Self {
|
||||||
Self(self.0 & 0xffffff00 | alpha as u32)
|
Self(self.0 & 0xffffff00 | alpha as u32)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue