pub struct SurfaceSpec {
pub gain: f32,
pub saturation: f32,
pub tint: Hsla,
pub blur: f32,
pub rim: f32,
pub edge: f32,
pub edge_width: f32,
pub edge_aa: f32,
pub shadow: bool,
}Expand description
One surface’s numbers. out = gain * saturated(backdrop) + tint, over a
backdrop blurred at blur.
Fields§
§gain: f32Slope of the transfer line. Below 1 compresses contrast toward
tint; above 1 it brightens and slightly expands, which is what light
Clear measures. Named for what it is, not for one of its directions.
saturation: f32How far the backdrop’s chroma is pushed from its own grey, before the
gain drops the level. A gain alone moves level and colour together, so
this is the only way a surface goes dark and keeps its colours. 1 is
the pass-through Clear measures.
tint: HslaIts offset — the look’s own tone.
blur: f32Gaussian sigma under the lens, in logical pixels. It stands in for the average attenuation of fine detail, which the real material gets from snapshotting its backdrop coarsely.
rim: f32How far in from the rim the lens bends the backdrop, in logical pixels. A length rather than a share of the box: the displacement curve measured 2026-08-30 is one curve, the same from a 96pt box to a 320pt one and from r24 to r84. Past it the backdrop is untouched.
edge: f32How much white the lit rim adds at the edge itself, 0..1.
edge_width: f32How far in that light falls off to nothing, in logical pixels. Even the whole way round: measured 2026-08-30, the real rim reads the same on all four sides.
edge_aa: f32The coverage ramp at the shape’s own boundary, in logical pixels. 0.5 is one device pixel at 2x — the plain rasteriser’s answer; 0 is the hard edge it replaced.
shadow: boolWhether the surface casts a shadow. A lens separates itself from the page by bending it, and reads as a slab under one; a wash has nothing to bend and needs it.
Trait Implementations§
Source§impl Clone for SurfaceSpec
impl Clone for SurfaceSpec
Source§fn clone(&self) -> SurfaceSpec
fn clone(&self) -> SurfaceSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SurfaceSpec
Source§impl Debug for SurfaceSpec
impl Debug for SurfaceSpec
Source§impl PartialEq for SurfaceSpec
impl PartialEq for SurfaceSpec
impl StructuralPartialEq for SurfaceSpec
Auto Trait Implementations§
impl Freeze for SurfaceSpec
impl RefUnwindSafe for SurfaceSpec
impl Send for SurfaceSpec
impl Sync for SurfaceSpec
impl Unpin for SurfaceSpec
impl UnsafeUnpin for SurfaceSpec
impl UnwindSafe for SurfaceSpec
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more