use crate::units::GetColorUnits;
pub trait ColorAlpha {
fn alpha(&self) -> f64;
#[deprecated(since = "0.7.0", note = "Please use `alpha` instead")]
fn get_alpha(&self) -> f64;
fn set_alpha(&mut self, val: f64);
fn opacify(&mut self, val: f64);
}
impl<T> ColorAlpha for T where T: GetColorUnits {
fn alpha(&self) -> f64 { self.get_units().alpha.get_f64() }
fn get_alpha(&self) -> f64 {
self.alpha()
}
fn set_alpha(&mut self, val: f64) {
self.get_units_mut().alpha.set(val);
}
fn opacify(&mut self, val: f64) {
self.get_units_mut().alpha.opacify(val);
}
}