1
0
Fork 0
forked from wry/wry

wayland: implement alpha_modifier_v1

This commit is contained in:
Julian Orth 2024-03-18 19:18:30 +01:00
parent 131f0481e8
commit ff54a8ab96
37 changed files with 655 additions and 89 deletions

View file

@ -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))