pub struct LightColor {
pub r: f64,
pub g: f64,
pub b: f64,
}Expand description
An amount of light per channel: 0 is none, 1 is full.
Fields§
§r: f64The red channel.
g: f64The green channel.
b: f64The blue channel.
Implementations§
Source§impl LightColor
impl LightColor
Sourcepub const BLACK: LightColor
pub const BLACK: LightColor
No light.
Sourcepub const WHITE: LightColor
pub const WHITE: LightColor
Full white light.
Sourcepub fn from_color(color: Color, intensity: f64) -> LightColor
pub fn from_color(color: Color, intensity: f64) -> LightColor
The light of a colour at an intensity: the channels and the alpha of the colour as fractions, times the intensity.
Deviation (winui-composition.md): the alpha of the colour of a light scales it (a transparent light lights nothing); WinUI does not say.
Sourcepub fn scale(self, factor: f64) -> LightColor
pub fn scale(self, factor: f64) -> LightColor
The light times a factor.
Sourcepub fn add(self, other: LightColor) -> LightColor
pub fn add(self, other: LightColor) -> LightColor
The sum of two lights.
Sourcepub fn lerp(self, other: LightColor, t: f64) -> LightColor
pub fn lerp(self, other: LightColor, t: f64) -> LightColor
The light between self (at 0) and other (at 1).
Sourcepub fn clamped(self) -> LightColor
pub fn clamped(self) -> LightColor
Every channel limited to 0..1.
Sourcepub fn atop_pixel(self) -> [u8; 4]
pub fn atop_pixel(self) -> [u8; 4]
The light-map pixel that turns content into content lit by this
light under source-atop blending: premultiplied (L - m, 1 - m), m
the smallest channel, as RGBA bytes.
Trait Implementations§
Source§impl Clone for LightColor
impl Clone for LightColor
impl Copy for LightColor
Source§impl Debug for LightColor
impl Debug for LightColor
Source§impl Default for LightColor
impl Default for LightColor
Source§impl PartialEq for LightColor
impl PartialEq for LightColor
impl StructuralPartialEq for LightColor
Auto Trait Implementations§
impl Freeze for LightColor
impl RefUnwindSafe for LightColor
impl Send for LightColor
impl Sync for LightColor
impl Unpin for LightColor
impl UnsafeUnpin for LightColor
impl UnwindSafe for LightColor
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more