Pre-1.0: signatures are not frozen. Generated from rustdoc JSON of the compiled crate; rustdoc JSON format version 60. Only public items are listed.
Design tokens and built-in themes: "polished" as the default.
A [Theme] is one small, typed bag of design tokens:
- color roles ([
Role]): background, surface, surface-raised, border, text, text-muted, accent, success, warning, danger, info and anon_*content color for each fill that carries text; - a type scale ([
Type] -> [TypeStyle]: size, weight, line height); - a spacing scale (
theme.space(n)), a radii scale ([Radius]); - elevation presets
0..=4([Elevation]) that map onto the real [DropShadow] / [Glow] kernel parameters plus an optional stroke edge, and ready-made material [LayerSpec]s; - state layers ([
State], [StateLayers]) and a focus ring ([FocusRing], stroke plus glow).
Six built-ins ship ([Theme::mission_dark], [Theme::mission_light],
[Theme::paper_light], [Theme::paper_dark], [Theme::high_contrast_dark],
[Theme::high_contrast_light]) and [Theme::from_accent] derives a full,
contrast-audited theme from a single accent color.
[Theme::resource_theme] exports every token as a named, typed literal
resource of the existing [crate::theme::Theme] dictionary
(theme.color.accent is Srgb8, theme.radius.md is LogicalLength, ...).
Every design theme exports exactly the same names and types, so a compiled
plan that binds Binding::Resource("theme.color.accent") stays valid when
the theme changes: [Theme::rebase_instance] swaps the base of a
ThemeInstance and the next evaluate yields the new colors. No graph
rebuild, no recompile, no retarget.
Structs
structaster_blueprint::design::ContrastIssue
pub struct ContrastIssue { /* see fields */ }One failed contrast pair reported by [Theme::audit].
Public fields
| field | type | |
|---|---|---|
pair | &'static str | |
ratio | f64 | |
required | f64 |
Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq
structaster_blueprint::design::Edge
pub struct Edge { /* see fields */ }A stroked edge of an elevation or surface.
Public fields
| field | type | |
|---|---|---|
width | f64 | |
color | aster_ui::Srgb8 | |
alignment | aster_ui::VectorStrokeAlignment |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_blueprint::design::Elevation
pub struct Elevation { /* see fields */ }One elevation preset. offset, sigma, spread and shadow are exactly
the [DropShadow] kernel parameters.
Public fields
| field | type | |
|---|---|---|
level | u8 | |
offset | [f64; 2] | |
sigma | f64 | |
spread | f64 | |
shadow | aster_ui::Srgb8 | |
edge | Option<Edge> | |
glow | Option<GlowSpec> |
Methods
fn drop_shadow(&self, w: f64, h: f64, radius: f64, scale: f64) -> Option<DropShadow>— The kernel parameters for aw x hshape, orNonefor a flat level.fn layers(&self, key: &str, bounds: LogicalRect, radius: f64, scale: f64) -> Result<Vec<LayerSpec>, Error>— Material layers for a shape ofboundswith cornerradius:{key}.shadowand{key}.glow(bothOutside, so the part root must not clip) and{key}.edge(Outline). Flat levels give an empty list.
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_blueprint::design::FocusRing
pub struct FocusRing { /* see fields */ }Focus ring: an outer stroke separated from the control by offset, plus an
optional glow (intensity == 0 disables it).
Public fields
| field | type | |
|---|---|---|
color | aster_ui::Srgb8 | |
width | f64 | |
offset | f64 | |
glow_sigma | f64 | |
glow_intensity | f64 |
Methods
fn layers(&self, key: &str, bounds: LogicalRect, radius: f64, scale: f64) -> Result<Vec<LayerSpec>, Error>—{key}.ring(and{key}.halowhen glowing) layers for a control ofboundswith cornerradius. Both areOutside/Outlinelayers placed outsidebounds, so the part root must not clip.
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_blueprint::design::GlowSpec
pub struct GlowSpec { /* see fields */ }An accent halo of an elevation.
Public fields
| field | type | |
|---|---|---|
color | aster_ui::Srgb8 | |
sigma | f64 | |
spread | f64 | |
intensity | f64 |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_blueprint::design::MotionToken
pub struct MotionToken { /* see fields */ }A named duration + easing pairing.
Public fields
| field | type | |
|---|---|---|
duration | MotionDuration | |
ease | Ease |
Methods
const fn new(duration: MotionDuration, ease: Ease) -> Selfconst FAST: Self— fast + standard: hover/press/focus fades, knobs.const NORMAL: Self— normal + standard: meters, tab indicator.const SLOW: Self— slow + standard: number tweens.const EMPHASIZED: Self— normal + emphasized: hero entrances.const ENTER: Self— normal + decelerate: something arriving.const EXIT: Self— fast + accelerate: something leaving.const SPRING: Self— fast + spring: a toggle that snaps into place (a switch, a checkbox).
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
structaster_blueprint::design::MotionTokens
pub struct MotionTokens { /* see fields */ }The motion scale of a theme.
Public fields
| field | type | |
|---|---|---|
fast_ms | u32 | |
normal_ms | u32 | |
slow_ms | u32 | |
standard | [f64; 4] | Cubic-bezier controls [x1, y1, x2, y2]. |
emphasized | [f64; 4] | |
decelerate | [f64; 4] | |
accelerate | [f64; 4] | |
spring | [f64; 4] | The overshoot curve of a control that snaps into place. |
reduced | bool | Reduced motion: every duration is 0, every transition is instant. |
Methods
fn ms(&self, d: MotionDuration) -> u32— Milliseconds of a duration token (0 when reduced).fn curve(&self, e: Ease) -> Curve— The curve of an easing token.fn ease(&self, e: Ease, t: f64) -> f64— Eased progress fortin0..=1(clamped).
Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq
structaster_blueprint::design::Skin
pub struct Skin { /* see fields */ }The skin: the depth, light and gradient tokens the default controls wear.
Every number here is a magnitude, not a colour: the skin is resolved
against the theme's palette at render time (see ui::skin), so one skin
dresses a light theme and a dark one. A high-contrast theme keeps the
rhythm (spacing, radii, row heights) and drops the soft effects
(soft is false): the outlines carry the structure instead.
Public fields
| field | type | |
|---|---|---|
lift | f64 | Px a control rises at full hover (0 = it does not move). |
sink | f64 | Px a control sinks at full press. |
hover_elev | u8 | Elevation steps a control gains at full hover (0 = none). |
button_gradient | f64 | How much the top of a filled button is lightened (0..1). |
button_shadow_face | f64 | How much the bottom of a filled button is darkened (0..1). |
button_highlight | f64 | Alpha of the 1 px inner top highlight of a filled button (0..1). |
button_glow | f64 | Intensity of the coloured halo under a filled button (0..1). |
focus_glow | f64 | Sigma of the focus halo (px); 0 = a hard ring only. |
focus_glow_intensity | f64 | Intensity of the focus halo (0..1). |
input_inset | f64 | How dark an input surface sits below its page (0..1). |
input_glow | f64 | Intensity of the glow an input shows while it has the focus (0..1). |
surface_highlight | f64 | Alpha of the hairline top highlight of a raised surface (0..1). |
surface_ambient | f64 | Intensity of the wide ambient halo of a raised surface (0..1). |
surface_elev | u8 | Elevation level of a raised surface. |
row_height | f64 | Row height of a table row (px). |
header_height | f64 | Header height of a table header (px). |
glass_alpha | f64 | Fill alpha of a glass surface over a rich background (0..1). |
glass_blur | f64 | Blur sigma of a glass surface (px). |
soft | bool | False in a high-contrast theme: no soft effects, no transparency. |
material | Material | The material the controls wear (flat, neu or glass). |
neu_light | f64 | Alpha of the light shadow a raised surface throws up-left (0..1). |
neu_dark | f64 | Alpha of the dark shadow a raised surface throws down-right (0..1). |
neu_blur | f64 | Sigma of the two shadows of a raised surface (px). |
neu_offset | f64 | How far the two shadows of a raised surface are offset (px). |
neu_inset | f64 | Strength of the debossed inner shadow of a well (0..1). |
neu_inset_blur | f64 | Sigma of the debossed inner shadow of a well (px). |
glass_rim | f64 | Alpha of the 1 px lit rim of a glass face (0..1). |
glass_saturation | f64 | Saturation of the frosted backdrop of a glass face (1 = unchanged). |
glass_grain | f64 | Film grain over a glass face (0..1). |
backdrop | f64 | Strength of the page backdrop behind the app (0 = none). |
backdrop_grain | f64 | Film grain over the page backdrop (0..1). |
touch | f64 | The smallest height an interactive control may take (px); 0 = what the builder asks for (the default: a touch shell sets it, the sizes of the standard controls are pinned by tests). |
Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq
structaster_blueprint::design::StateLayers
pub struct StateLayers { /* see fields */ }Strength of each state layer (0..=1, how far the fill moves toward its
content color; disabled instead fades toward the background).
Public fields
| field | type | |
|---|---|---|
hover | f64 | |
press | f64 | |
focus | f64 | |
disabled | f64 | Remaining opacity of a disabled fill or text (0.38 is typical). |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_blueprint::design::SystemPrefs
pub struct SystemPrefs { /* see fields */ }The accessibility and appearance settings of the operating system.
Public fields
| field | type | |
|---|---|---|
dark | bool | The system is in dark mode (prefers-color-scheme: dark). |
high_contrast | bool | Increased contrast (prefers-contrast: more). |
reduced_motion | bool | Reduced motion (prefers-reduced-motion: reduce). |
reduced_transparency | bool | Reduced transparency (prefers-reduced-transparency: reduce): frosted glass is drawn as a solid surface. |
text_scale | f64 | The user's text size (Dynamic Type, Android font scale): every type step is multiplied by it. 1. is the theme's own; kept within 0.5..=3.. |
Methods
fn new() -> Self— Light mode, nothing reduced, the theme's own text size.fn text_scale(self, k: f64) -> Selffn from_env() -> Self— The settings an environment names:ASTER_DARK,ASTER_CONTRAST(orASTER_HIGH_CONTRAST),ASTER_REDUCE_MOTION,ASTER_REDUCE_TRANSPARENCY(1,true,yes,onare on; anything else or nothing is off) andASTER_TEXT_SCALE(a number). A host with no OS to ask (a kiosk, a test run, a CI screenshot) calls this once at start; it reads the process environment only when called.fn from_lookup(get: impl Fn(&str) -> Option<String>) -> Self— [SystemPrefs::from_env] over any lookup (a map in a test, a config file).fn dark(self, on: bool) -> Selffn high_contrast(self, on: bool) -> Selffn reduced_motion(self, on: bool) -> Selffn reduced_transparency(self, on: bool) -> Self
Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq
structaster_blueprint::design::SystemThemes
pub struct SystemThemes { /* see fields */ }The theme each system setting selects. The default is mission light / dark and the two high-contrast built-ins.
Public fields
| field | type | |
|---|---|---|
light | super::Theme | |
dark | super::Theme | |
high_contrast_light | super::Theme | |
high_contrast_dark | super::Theme |
Methods
fn new(light: &Theme, dark: &Theme) -> Self— A light and a dark theme; increased contrast uses the high-contrast built-ins.fn high_contrast(self, light: &Theme, dark: &Theme) -> Self— Your own increased-contrast pair.fn brand_high_contrast(self) -> Self— Increased contrast keeps your brand: the pair is derived from the accents oflightanddark([Theme::increased_contrast]) instead of the built-in high-contrast themes.fn resolve(&self, prefs: SystemPrefs) -> Theme— The themeprefsselects, with its reduced-motion and reduced-transparency flags set.
Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq
structaster_blueprint::design::Theme
pub struct Theme { /* see fields */ }A complete set of design tokens.
Methods
fn motion(&self) -> MotionTokens— The theme's motion tokens.fn with_motion(self, m: MotionTokens) -> Self— Replace the motion tokens (custom durations or curves).fn with_reduced_motion(self, reduced: bool) -> Self— Reduced motion: all transitions become instant.fn increased_contrast(&self) -> Theme— This theme's increased-contrast sibling: the same accent and mode inStyle::Contrast(square corners, 2 px strokes, text pairs at 7:1), named<name>-contrast. Reduced motion and transparency carry over.fn reduced_transparency(&self) -> bool— Whether frosted glass is drawn as a solid surface (see [SystemPrefs::reduced_transparency]).fn text_scale(&self) -> f64— The user's text size multiplier (see [SystemPrefs::text_scale]).fn with_text_scale(self, k: f64) -> Self— The type steps atktimes the theme's own size (absolute:with_text_scale(1.)undoeswith_text_scale(1.5); non-finite values are ignored, others kept within0.5..=3.). It composes with the density's scale ([Theme::with_type_scale]).fn with_reduced_transparency(self, on: bool) -> Self— Reduced transparency:.glass(..)panels become the opaque surface colour, with no backdrop blur.fn name(&self) -> &strfn mode(&self) -> Modefn style(&self) -> Stylefn color(&self, role: Role) -> Srgb8— Color of a role.fn tint(&self, role: Role, alpha: f64) -> Srgb8— A role atalpha(0..=1), for tints, scrims and soft chips.fn text(&self, t: Type) -> TypeStyle— Type scale step.fn tokens(&self, t: Type) -> TypeTokens— The tokens of a type scale step: the size, the weight, the line height, the letter spacing (in em) and the face the step draws with.fn with_tracking(self, t: Type, tracking: f64) -> Self— The letter spacing of a type step, in em (negative is tighter, positive is wider). A non-finite value is ignored.fn with_type_face(self, t: Type, face: &'static str) -> Self— The face of a type step (the name of a registered face:"ui","bold","mono","display", ...).fn space(&self, step: usize) -> f64— Spacing step0..=11(0, 2, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64 at density 1); larger indices clamp to the last step.fn radius(&self, r: Radius) -> f64— Radius token. [Radius::Full] is [FULL_RADIUS]; use [Theme::radius_for].fn radius_for(&self, r: Radius, w: f64, h: f64) -> f64— Radius token clamped to half the shorter side of aw x hshape.fn elevation(&self, level: u8) -> &Elevation— Elevation preset; levels above [MAX_ELEVATION] clamp.fn states(&self) -> StateLayersfn focus_ring(&self) -> FocusRingfn skin(&self) -> &Skin— The skin tokens: the depth, light and gradient of the default controls.fn with_skin(self, skin: Skin) -> Self— The skin tokens, replaced (the whole set).fn material(&self) -> Material— The material the controls wear (flat, neu or glass).fn with_material(self, m: Material) -> Self— Wear another material (the one call that overrides a theme's default:Theme::paper_light().with_material(Material::Glass)).fn focus_edge(&self) -> Srgb8— The border an input shows while it has the focus: the accent, moved until it holds 3:1 against the background and every surface (the plain border when the accent cannot get there).fn raise(&self, role: Role, t: f64) -> Srgb8— A role lightened toward white byt(the lit top of a gradient).fn lower(&self, role: Role, t: f64) -> Srgb8— A role darkened toward black byt(the shaded bottom of a gradient).fn border_width(&self) -> f64— Stroke width of a plainBorderoutline (1, or 2 for high contrast).fn state_color(&self, base: Srgb8, state: State) -> Srgb8— A fill color in an interaction state. Hover/press/focus move the fill toward its readable content color; disabled fades it into the background.fn select_color(&self, base: Srgb8) -> Srgb8— The selected look of a fill:basemoved toward the accent by 14 %, stopping where content that is readable onbasewould stop being.fn fit_mix(&self, a: Srgb8, b: Srgb8, t: f64) -> Srgb8—mix(a, b, t)withtreduced until the content colour ofa([on_color]) stays readable on the result. A gradient end that cannot make initials unreadable: seeui::avatar.fn veil_alpha(&self, alpha: f64) -> f64— The strength of the Text-coloured veil drawn over a fill-less element in a hover or press state:alpha, held back where text, muted text or an ink that is readable on a surface (or the app bar, or a selected row) would stop being once the veil is on it.fn ink(&self, role: Role) -> Srgb8— Text-safe variant of a role:Accent,Success,Warning,Danger,InfoandTextMutedare nudged in lightness (hue kept) until they meet [Theme::min_text_contrast] (+3 % headroom) on every surface, the app-bar gradient end, a hover veil and a 16 % tint of the role colour (badges). Unchanged when the role already does. Other roles return their colour. Computed once per theme.fn edge(&self) -> Srgb8— The stroke of a control's boundary (a text field): [Role::Border] moved toward [Role::Text] until it is at least 3:1 (WCAG 1.4.11, +3 % headroom) against the page, a surface and a raised surface. Unchanged when the border already is (the high-contrast themes). Computed once per theme.fn min_text_contrast(&self) -> f64— The minimum body-text contrast this theme promises (4.5 or 7).fn responsive(&self) -> ui::responsive::Responsive— Breakpoints and compact type scale (seeui::responsive).fn with_responsive(self, r: ui::responsive::Responsive) -> Self- ...and 23 more
Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq
structaster_blueprint::design::TypeStyle
pub struct TypeStyle { /* see fields */ }One step of the type scale, in logical pixels.
Public fields
| field | type | |
|---|---|---|
size | f64 | |
weight | u16 | CSS-style weight (400 regular, 600 semibold, 700 bold). |
line_height | f64 |
Methods
fn bold(&self) -> bool— True for weights the bold face should render (>= 600).
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_blueprint::design::TypeTokens
pub struct TypeTokens { /* see fields */ }One step of the type scale with its letter spacing and its face: the tokens a text of that step draws with.
The tracking is in em (negative is tighter, positive is wider) and the face
is the name of a registered face (see [crate::typography::face]).
Public fields
| field | type | |
|---|---|---|
size | f64 | The size in logical px. |
weight | u16 | CSS-style weight (400 regular, 600 semibold, 700 bold). |
line_height | f64 | The line height in logical px. |
tracking | f64 | The letter spacing, in em (negative is tighter, positive is wider). |
face | &'static str | The face the step draws with (the name of a registered face). |
Methods
fn style(&self) -> TypeStyle— The style of the step (the size, the weight and the line height).fn bold(&self) -> bool— True for the steps whose weight class is the bold one (>= 600).
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_blueprint::design::color::Oklch
pub struct Oklch { /* see fields */ }A color in OKLCH: perceptual lightness l (0..1), chroma c, hue h (degrees).
Public fields
| field | type | |
|---|---|---|
l | f64 | |
c | f64 | |
h | f64 |
Methods
fn from_srgb(c: Srgb8) -> Selffn to_srgb(self) -> Srgb8— Opaque sRGB; chroma is reduced (hue and lightness kept) until it fits.
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
Enums
enumaster_blueprint::design::Ease
pub enum Ease { Linear, Standard, Emphasized, Decelerate, Accelerate, Spring }One of the theme easing curves.
Variants
LinearStandard— Symmetric ease for things that stay on screen.Emphasized— Strong ease-out with a quick start, for hero entrances.Decelerate— Ease-out: things arriving.Accelerate— Ease-in: things leaving.Spring— A slight overshoot, for a control that snaps into place (a switch, a checked box, a slider thumb): it goes a little past and settles back.
Trait implementations: Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, StructuralPartialEq
enumaster_blueprint::design::Material
pub enum Material { Flat, Neu, Glass }The material the skin dresses the controls in.
The material is a theme thing: one tree looks right in every theme because
the skin resolves the look at render time (see ui::skin). Three materials
ship:
- [
Material::Flat] - a flat face, a hairline edge and a hard shadow: the high-contrast themes keep it, because soft effects are noise there; - [
Material::Neu] - soft UI: raised surfaces carry a light shadow up-left and a dark one down-right, wells and fields are debossed into the page; - [
Material::Glass] - frosted glass: a translucent face over a blurred, saturated backdrop with a lit rim.
Methods
fn name(self) -> &'static str— The token name ("neu","glass","flat").
Variants
Flat— Flat faces, hairline edges, hard shadows (the high-contrast themes).Neu— Soft UI: extruded raised surfaces, debossed wells.Glass— Frosted glass over a rich backdrop.
Trait implementations: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq
enumaster_blueprint::design::Mode
pub enum Mode { Light, Dark }Light or dark appearance.
Variants
LightDark
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_blueprint::design::MotionDuration
pub enum MotionDuration { Fast, Normal, Slow }One of the three theme durations.
Variants
Fast— State layers, knobs, small popups (120 ms).Normal— Dialogs, toasts, meters (220 ms).Slow— Number tweens, large moves (360 ms).
Trait implementations: Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, StructuralPartialEq
enumaster_blueprint::design::Radius
pub enum Radius { None, Sm, Md, Lg, Xl, Full }Corner radius scale steps.
Methods
const ALL: [Radius; 6]fn name(self) -> &'static str
Variants
NoneSmMdLgXlFull— Pill. Resolve with [Theme::radius_for] to clamp to half the shorter side.
Trait implementations: Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, StructuralPartialEq
enumaster_blueprint::design::Role
pub enum Role { Background, Surface, SurfaceRaised, Border, Text, TextMuted, Accent, Success, Warning, Danger, Info, OnAccent, OnSuccess, OnWarning, OnDanger, OnInfo, Secondary, OnSecondary }A semantic color role. The On* roles are the text/icon color to use
on top of the matching fill.
Methods
const ALL: [Role; 18]fn name(self) -> &'static str— Snake-case token name ("surface_raised").fn on(self) -> Option<Role>— The content color that sits on this fill, if the role is a text-bearing fill.fn resource(self) -> String— Resource name of this role in the node-graph theme (theme.color.accent).
Variants
BackgroundSurfaceSurfaceRaisedBorderTextTextMutedAccentSuccessWarningDangerInfoOnAccentOnSuccessOnWarningOnDangerOnInfoSecondaryOnSecondary
Trait implementations: Clone, Copy, Debug, Eq, From<Role>, Hash, Ord, PartialEq, PartialOrd, RoleExt, StructuralPartialEq
enumaster_blueprint::design::State
pub enum State { Rest, Hover, Press, Focus, Disabled }Interaction states with a state layer.
Variants
RestHoverPressFocusDisabled
Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq
enumaster_blueprint::design::Style
pub enum Style { Mission, Paper, Contrast }The overall look of the non-color tokens (radii, type, elevation, density).
Variants
Mission— Compact, glowing sci-fi dashboard: medium radii, deep shadows, accent glow.Paper— Soft and airy: large radii, gentle layered shadows, relaxed type.Contrast— Hard-edged and loud: square corners, thick strokes, hard offset shadows.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_blueprint::design::Type
pub enum Type { Caption, Body, Label, Title, Headline, Display }The type scale steps.
Methods
const ALL: [Type; 6]fn name(self) -> &'static str
Variants
CaptionBodyLabelTitleHeadlineDisplay
Trait implementations: Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, StructuralPartialEq
Functions
fnaster_blueprint::design::contrast
pub fn contrast(a: aster_ui::Srgb8, b: aster_ui::Srgb8) -> f64WCAG contrast ratio (1.0..=21.0) of two opaque colors.
fnaster_blueprint::design::hex
pub const fn hex(rgb: u32) -> aster_ui::Srgb8Opaque color from 0xRRGGBB.
fnaster_blueprint::design::mix
pub fn mix(a: aster_ui::Srgb8, b: aster_ui::Srgb8, t: f64) -> aster_ui::Srgb8Straight sRGB byte mix, per channel including alpha: exactly the arithmetic
of the core.color.mix.v1 kernel. t == 0 is a, t == 1 is b.
fnaster_blueprint::design::on_color
pub fn on_color(bg: aster_ui::Srgb8) -> aster_ui::Srgb8The content color (INK or PAPER) with the better contrast against bg.
Always at least about 4.58:1 for any opaque bg.
fnaster_blueprint::design::with_alpha
pub fn with_alpha(c: aster_ui::Srgb8, alpha: f64) -> aster_ui::Srgb8The same color with a replaced alpha (0.0..=1.0).
fnaster_blueprint::design::color::contrast
pub fn contrast(a: aster_ui::Srgb8, b: aster_ui::Srgb8) -> f64WCAG contrast ratio (1.0..=21.0) of two opaque colors.
fnaster_blueprint::design::color::ensure_contrast
pub fn ensure_contrast(fg: aster_ui::Srgb8, bg: aster_ui::Srgb8, min: f64) -> aster_ui::Srgb8Moves fg in OKLCH lightness (hue and chroma kept as far as the gamut
allows) until it reaches contrast min against bg.
fnaster_blueprint::design::color::hex
pub const fn hex(rgb: u32) -> aster_ui::Srgb8Opaque color from 0xRRGGBB.
fnaster_blueprint::design::color::luminance
pub fn luminance(c: aster_ui::Srgb8) -> f64WCAG relative luminance of the color's RGB (alpha ignored).
fnaster_blueprint::design::color::mix
pub fn mix(a: aster_ui::Srgb8, b: aster_ui::Srgb8, t: f64) -> aster_ui::Srgb8Straight sRGB byte mix, per channel including alpha: exactly the arithmetic
of the core.color.mix.v1 kernel. t == 0 is a, t == 1 is b.
fnaster_blueprint::design::color::on_color
pub fn on_color(bg: aster_ui::Srgb8) -> aster_ui::Srgb8The content color (INK or PAPER) with the better contrast against bg.
Always at least about 4.58:1 for any opaque bg.
fnaster_blueprint::design::color::over
pub fn over(fg: aster_ui::Srgb8, bg: aster_ui::Srgb8) -> aster_ui::Srgb8fg composited over an opaque bg; the result is opaque.
fnaster_blueprint::design::color::with_alpha
pub fn with_alpha(c: aster_ui::Srgb8, alpha: f64) -> aster_ui::Srgb8The same color with a replaced alpha (0.0..=1.0).
Constants
constaster_blueprint::design::FULL_RADIUS
pub const FULL_RADIUS: f64Corner radius used for [Radius::Full] before clamping.
constaster_blueprint::design::MAX_ELEVATION
pub const MAX_ELEVATION: u8Highest elevation level.
constaster_blueprint::design::color::INK
pub const INK: aster_ui::Srgb8Near-black and near-white content colors used by [on_color].
constaster_blueprint::design::color::PAPER
pub const PAPER: aster_ui::Srgb8