wayland: implement alpha_modifier_v1
This commit is contained in:
parent
131f0481e8
commit
ff54a8ab96
37 changed files with 655 additions and 89 deletions
14
src/theme.rs
14
src/theme.rs
|
|
@ -1,6 +1,7 @@
|
|||
use std::{
|
||||
cell::{Cell, RefCell},
|
||||
cmp::Ordering,
|
||||
ops::Mul,
|
||||
};
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||
|
|
@ -23,6 +24,19 @@ impl Ord for Color {
|
|||
}
|
||||
}
|
||||
|
||||
impl Mul<f32> for Color {
|
||||
type Output = Self;
|
||||
|
||||
fn mul(self, rhs: f32) -> Self::Output {
|
||||
Self {
|
||||
r: self.r * rhs,
|
||||
g: self.g * rhs,
|
||||
b: self.b * rhs,
|
||||
a: self.a * rhs,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialOrd for Color {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
||||
Some(self.cmp(other))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue