Skip to main content

ferroui_controls/
acrylic_platform_compensation_levels.rs

1/// The opacity compensation a platform needs for each transparency level in
2/// order for acrylic materials to look the way they are defined.
3#[derive(Clone, Copy, Debug, Default, PartialEq)]
4pub struct AcrylicPlatformCompensationLevels {
5    transparent_level: f64,
6    blur_level: f64,
7    acrylic_blur_level: f64,
8}
9
10impl AcrylicPlatformCompensationLevels {
11    /// Creates the compensation levels.
12    pub const fn new(transparent: f64, blurred: f64, acrylic: f64) -> Self {
13        Self { transparent_level: transparent, blur_level: blurred, acrylic_blur_level: acrylic }
14    }
15
16    /// The compensation for the transparent level.
17    pub const fn transparent_level(&self) -> f64 {
18        self.transparent_level
19    }
20
21    /// The compensation for the blur level.
22    pub const fn blur_level(&self) -> f64 {
23        self.blur_level
24    }
25
26    /// The compensation for the acrylic blur level.
27    pub const fn acrylic_blur_level(&self) -> f64 {
28        self.acrylic_blur_level
29    }
30}