Upgrade SAO theming #43

Merged
mars merged 17 commits from upgrade-sao-theming into main 2022-11-18 23:53:17 +00:00
1 changed files with 2 additions and 2 deletions
Showing only changes of commit 2aadd0d57a - Show all commits

View File

@ -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 multiplied = ((a * (mul as u16)) >> 8) as u8;
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)
}