API reference

aster_blueprint::ui

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.

aster_blueprint::ui: the terse authoring layer.

One declarative element tree ([El]) built with plain functions and chained modifiers; spacing, radii, colours and type are theme tokens resolved at render time, so the same tree re-renders under any Theme. Display components (card, stat, chart, table, nav, ...) live in [components]. [Screen] / [render] solve the layout (real measured text, bundled DejaVu fonts), build the aster-ui scene with the effects (shadows, glow, strokes) and render headless, registering every labelled element in a [crate::uitree::UiTree] automatically. See docs/UI.md.

use aster_blueprint::ui::prelude::*;
let root = col([text("Hello").style(Type::Headline), badge("LIVE", Role::Success)]).pad(5);
let shot = Screen::new(&Theme::mission_dark())?.size(480, 240).render(&root)?;
shot.tree.assert_visible("Hello");
shot.png("hello.png")?;

Structs

structaster_blueprint::ui::App

pub struct App { /* see fields */ }

The interactive app: a Ui surface driven by the shared [Engine].

Methods

  • fn new(theme: &Theme, store: Store) -> Self — Start an app: App::new(&Theme::paper_dark(), store).size(960, 640).screen(|s| col([...]))?.
  • fn size(self, w: u32, h: u32) -> Self — Logical size in px (before [App::screen]).
  • fn scale(self, s: f64) -> Self — Output scale (before [App::screen]).
  • fn auto_density(self, on: bool) -> Self — Apply the density of the environment (the viewport's [Density]): the type scale through the theme's type steps, the smallest interactive target (the hit and focus box of an interactive element grows to it, its drawn size does not) and the focus ring width. Off by default, so every screen stays as it was.
  • fn tiled_shadows(self, on: bool) -> Self — Draw large drop shadows (cards, panels, headers) from a small baked drawing and clipped copies of it: the first frame of a page and a resize bake 1-5 ms of shadow instead of 20-25 ms per large card. Off by default, because the result can differ from the single drawing by one level in an occasional corner pixel (see [Screen::tiled_shadows]); an app that prefers the speed turns it on.
  • fn snap_pixels(self, on: bool) -> Self — Snap every laid-out box to the device pixel grid before painting, for crisp edges at fractional scales (1.25, 1.5): see [Screen::snap_pixels]. Off by default.
  • fn direction(self, d: Direction) -> Self — The reading direction of the screen: direction(Direction::Rtl) lays the whole tree out right to left (the rows from the right edge to the left, Start on the right, the grid columns from the right, the text right to left). An element that sets its own direction (El::dir) wins over the app's.
  • fn font_bytes(self, name: &str, bytes: &[u8]) -> Result<Self, interact::InteractError> — Register a face for the rich text (the runs may name it). The face is registered before the screen is made.
  • fn add_font_bytes(&mut self, name: &str, bytes: &[u8]) -> Result<(), interact::InteractError> — Register a face after the screen is made (a face loaded on demand, such as a typography choice). The next frame lays text out with it.
  • fn font_file(self, name: &str, path: impl AsRef<std::path::Path>) -> Result<Self, interact::InteractError> — Register a face for the rich text from a file (read now).
  • fn fallbacks(self, names: &[&str]) -> Self — The default fallback chain of the rich text: the faces a run falls back to when its own face has no glyph for a cluster.
  • fn screen(self, f: impl Fn(&Store) -> El + 'static) -> Result<Self, interact::InteractError> — Define the screen as a function of the store and render the first frame.
  • fn size_class(&self) -> super::responsive::Size — The size class of the current width under the theme's breakpoints.
  • fn stage_semantics(&self, presenter: &mut aster_ui::semantics::Presenter, policy: aster_ui::semantics::AccessibilityPolicy) -> Result<aster_ui::semantics::Ticket, aster_ui::semantics::SemanticError> — Stage the current frame's accessibility semantics (tree().semantics()) on an aster_ui presenter; the host acknowledges it with the matching input presentation.
  • fn store(&self) -> &Store — The store the screen reads: what actions and set changed so far.
  • fn image(&self) -> &Image — The last rendered frame as pixels.
  • fn tree(&self) -> &UiTree — The semantic tree of the last frame, with hovered pressed focused focusable disabled flags.
  • fn caret_rect(&self) -> Option<[f64; 4]> — The caret of the focused text field as [x, y, w, h] in layout px: where a host puts the IME candidate window (None when no text field has the focus, or its caret is scrolled out of the drawn lines).
  • fn rendered(&self) -> &Rendered — The last render: image, element tree and solved layout.
  • fn log(&self) -> &[Event] — The events the actions and the engine raised so far.
  • fn focused(&self) -> Option<&str> — The id of the focused element.
  • fn hovered(&self) -> Option<&str> — The id of the element under the pointer.
  • fn pressed(&self) -> Option<&str> — The id of the element the pointer is holding down.
  • fn set_accelerator(&mut self, accelerator: Option<Box<dyn aster_ui::accel::RasterAccelerator + Send>>) -> Option<Box<dyn aster_ui::accel::RasterAccelerator + Send>> — Experimental: install (or with None remove) an optional frame accelerator, such as the separate gpu/ plugin workspace's, and return the previous one. Without one (the default) every frame is drawn by the CPU renderer exactly as before. An accelerator's frames match the CPU's only within its documented tolerance, so byte-exact snapshot tests must not install one. It applies from the next rendered frame; a frame it fails is drawn by the CPU.
  • fn has_accelerator(&self) -> bool — Whether an accelerator is installed.
  • fn accelerator_last_error(&self) -> Option<String> — The installed accelerator's most recent failure (that frame was drawn by the CPU).
  • fn take_damage(&mut self) -> Option<Vec<[u32; 4]>> — The device rectangles [x, y, w, h] of [App::image] that changed since the previous call, then starts a new accumulation. None means "not known, present the whole frame" (the first frame, a resize, a full or layered render, a cut). Some(empty) means the pixels did not change. A host that uploads frames to a texture (a browser, a compositor) copies only these rectangles.
  • fn renders(&self) -> usize — Frames rendered so far (for tests).
  • fn target_ids(&self) -> Vec<&str> — Ids of all interactive elements in paint order.
  • fn engine(&self) -> &Engine — The shared input engine (acknowledged presentation, hover chain, ...).
  • fn write_png(&self, path: impl AsRef<std::path::Path>) -> headless::Result<()> — Write the last frame to a PNG file (open it and look at it).
  • fn assert_snapshot(&self, golden: impl AsRef<std::path::Path>, tolerance: u8) — Panic unless the last frame matches the golden PNG within tolerance per channel; a missing golden is a failure too, until ASTER_UPDATE_SNAPSHOTS=1 is set, which writes it.
  • fn set_defer_render(&mut self, on: bool) -> Result<Vec<Event>, interact::InteractError> — Render at most once per turn of a host's event loop (off by default; the native window host turns it on).
  • fn flush(&mut self) -> Result<Vec<Event>, interact::InteractError> — Settle and render what deferred moves, leaves and wheel steps owe ([App::set_defer_render]). Does nothing (and renders nothing) when nothing is owed; renders only if the owed settle changed the picture.
  • fn owes_render(&self) -> bool — A deferred move, leave or wheel step is waiting for [App::flush].
  • fn set(&mut self, name: &str, value: impl Into<Value>) -> Result<Vec<Event>, interact::InteractError> — Set a store value and re-render.
  • fn set_pending(&mut self, name: &str, value: impl Into<Value>) — Model change without rendering: input keeps using the last acknowledged geometry until [App::refresh] (or the next event).
  • fn set_view(&mut self, name: &str, value: impl Into<Value>) -> Result<Vec<Event>, interact::InteractError> — View-only change (same model snapshot): a press in flight survives a repaint that leaves every interactive box where it was, and is cancelled (StaleGeometry) by one that moves them.
  • fn run(&mut self, action: &Action) -> Result<Vec<Event>, interact::InteractError> — Run an action and re-render.
  • fn advance(&mut self, ms: i64) -> Result<Vec<Event>, interact::InteractError> — Advance the injected clock by ms and render the frame at the new time. This is the only way time moves: transitions are sampled at the clock, never at the wall clock, so a script is reproducible frame for frame. Store ints named <key>.ttl count down (ms); at 0 <key> becomes false (toasts), at the exact millisecond even inside a long step.
  • ...and 99 more

structaster_blueprint::ui::El

pub struct El { /* see fields */ }

One element of the UI tree. Build with [col], [row], [text] and the components; chain modifiers; hand the root to [crate::ui::Screen].

Methods

  • fn action(self, action: Action) -> El — Run action when clicked (alias of .on_click(action), reads well after [clickable]).
  • fn tone(self, role: Role) -> El — Re-tone a [clickable]: Role::Accent primary, Role::Danger / Role::Warning risky, Role::Info secondary.
  • fn primary(self) -> El — A solid [clickable]: the role's own face, a lit rim and a coloured halo (the call to action of a screen). The label wears the role's readable ink.
  • fn solid(self, role: Role) -> El — A solid [clickable] in a role: the danger of a form, the accent of a hero.
  • fn ghost(self) -> El — Quiet [clickable]: no fill or outline until hovered, tight padding (icon buttons, toolbars).
  • fn ghost_start(self) -> El — ghost() with the label at the start of the row instead of centred (sidebar items, list rows). ghost() keeps its centred look, so nothing that used it moves.
  • fn right(self, slot: impl Into<El>) -> El — Header slot at the top right of a [panel], level with the title (a [legend], a [badge], a [toggle_chip], a small button): panel("Throughput", "per min", [..]).right(legend(&[("Peak", Role::Warning)])). Calling it again replaces the slot. Anywhere but a panel(..) it is a refusal reported by render.
  • fn ringed(self) -> El — A soft ring around an [avatar]: avatar("R", Role::Warning).ringed(). Anywhere but an avatar(..) it is a refusal reported by render.
  • fn value(self, shown: impl AsRef<str>) -> El — Custom right-hand text of a [meter_row] instead of the percentage (meter_row("Filament", 0.4, Role::Info).value("1.2 kg"); "" shows none). Anywhere else this is a refusal reported by render.
  • fn logo(self, logo: impl Into<El>) -> El — Logo slot of an [app_bar], left of the title (a [logo_tile], an icon, any element). Anywhere but an app_bar(..) it is a refusal reported by render.
  • fn rule(self, from: impl Into<Col>, to: impl Into<Col>) -> El — A 2 px horizontal gradient rule along the bottom edge of an [app_bar] (.rule(Role::Accent, Role::Secondary); call it again to recolour). The bar keeps its height. Anywhere but an app_bar(..) it is a refusal reported by render.
  • fn shortcut(self, chord: Chord, action: Action) -> Self — Declare a global shortcut: the app runs action when the chord is pressed, even when nothing has focus. A chord with a modifier (Ctrl-K) also reaches the shortcut while a text field has focus; a plain chord never steals typing from a focused field (it only runs when nothing else handled the key).
  • fn on_hold(self, ms: u32, action: Action) -> Self — Run action after the element has been held down for ms: the pointer pressed on it and kept inside, or Space / Enter held while it has the focus. Letting go earlier cancels (Cancel(Released), nothing runs); the action runs once, at the moment the time is up, and the element must be released before it can run again. The hold is shown by Scalar <id>.hold (0..1; in quarters under reduced motion) and Bool <id>.holding; the app announces the start and the result. See hold_button. Needs an .id().
  • fn on_click(self, action: Action) -> Self — Run action when the element is clicked (pointer press+release inside, or Enter/Space when focused). Needs an .id().
  • fn on_hover(self, enter: Action, leave: Action) -> Self — Run enter when the pointer enters (or a descendant), leave when it leaves.
  • fn on_focus(self, action: Action) -> Self
  • fn on_blur(self, action: Action) -> Self
  • fn on_key(self, key: Key, action: Action) -> Self — Key-down while this element (or a descendant) has focus. Replaces Enter/Space activation for that key.
  • fn on_key_plain(self, key: Key, action: Action) -> Self — Like [El::on_key], but only for the bare key (Ctrl allowed): with Shift, Alt or Meta held the key falls through to the element's own handler. text_area(..).submit_on_enter(..) is built on it (Shift+Enter keeps its newline).
  • fn on_pad(self, pad: super::focus::Pad, action: Action) -> Self — A pad button that has no key of its own (Pad::X, Y, Start, Select) while this element (or a descendant) has focus. With nothing focused (or nothing on the way up from the focus) the first element on the screen that declares the button answers; inside an open dialog, the first one inside the dialog. Needs an .id(). App::on_pad binds a button for the whole app.
  • fn on_key_fn(self, f: impl Fn(&mut Store, Key, KeyModifiers) -> bool + 'static) -> Self — Any key while focused; return true when handled (text fields, lists).
  • fn on_input(self, f: impl Fn(&mut Store, super::text_input::Input, &mut super::text_input::InputEnv<'_>) -> bool + 'static) -> Self — Keys and IME composition events while focused, with host services (clipboard); return true when handled. Used by text inputs.
  • fn on_pointer(self, f: impl Fn(&mut Store, Ptr) + 'static) -> Self — Pointer press and drag over the element (sliders).
  • fn on_hover_move(self, f: impl Fn(&mut Store, Ptr) + 'static) -> Self — Pointer position while merely hovering (and while dragging) over the element: f runs on every move inside it. Used by interactive backgrounds (ui::fluid). Needs an .id().
  • fn on_text_pointer(self, f: impl Fn(&mut Store, Ptr, bool, &mut dyn FnMut(&str) -> f64) + 'static) -> Self — Press and drag over a text element: like [El::on_pointer] but also given first (the initial press) and a measure(text) -> width in the body face, so a text field can map x to a caret position. Used by text_field.
  • fn on_wheel(self, f: impl Fn(&mut Store, f64) + 'static) -> Self — Wheel / scroll deltas in px (positive = down).
  • fn on_nav(self, f: impl Fn(&mut Store, super::focus::Dir) -> bool + 'static) -> Self — Answer a directional focus move yourself: f reads and writes the store (a virtual grid scrolls to the item the move lands on and sets "~focus" to its id) and returns true when it took the move. The hook is asked on the way up from the focus, before the spatial pick, so App::nav and the arrow keys agree.
  • fn measure(self) -> Self — Publish the resolved size of this element in the store as <id>.w and <id>.h, so a screen can size itself from the space it really got (a virtual grid reads its own).
  • fn captures_tab(self) -> Self — Opt in to receive Tab and Shift+Tab as ordinary keys while this element (or a descendant) has the focus, instead of moving the focus: a terminal's tab completion, a code editor's indent. on_key(Key::Tab, ..), on_key_fn and on_input see Key::Tab (with shift set for Shift+Tab); a key nothing handles is still swallowed, so the focus never moves by accident. The element is made focusable and carries the tree flag captures-tab. Focus traversal everywhere else is unchanged.
  • fn focusable(self) -> Self — Reachable with Tab; click focuses it.
  • fn disabled_if(self, f: impl Fn(&Store) -> bool + 'static) -> Self — Disabled while f(store) is true: no input, dimmed, skipped by Tab. Applies to the whole subtree.
  • fn disabled(self, on: bool) -> Self — [El::disabled_if] for a state you already know while building the screen: .disabled(s.bool("busy")).
  • fn selected(self, on: bool) -> Self — [El::selected_if] for a state you already know while building the screen: .selected(s.int("tab") == 2).
  • fn selected_if(self, f: impl Fn(&Store) -> bool + 'static) -> Self — Selected while f(store) is true, symmetric with [El::disabled_if]: the theme's selected look is applied automatically (accent border and an accent-tinted fill over the element's own fill) and the element's UiTree node gets the selected flag. Put it on the interactive element (the one with .id() + .on_click), e.g. a list card or a tab.
  • fn skin(self, skin: Skin) -> Self — Choose how states are drawn (default [Skin::Fill]).
  • fn part(self) -> Self — State layers of the enclosing target are drawn on this descendant (the box of a checkbox, a slider thumb).
  • fn block(self) -> Self — Swallow pointer input (the panel of a dialog), without being focusable.
  • fn trap(self) -> Self — Focus trap: Tab cycles inside; focus moves in on appearance and is restored on removal.
  • fn focus_trap(self) -> Self — Focus trap (a dialog, a sheet, the command palette): the focus stays inside while it is open, moves in when it appears and is restored when it goes. Same as [El::trap].
  • fn focus_group(self, name: impl AsRef<str>) -> Self — A named focus group: the focusable descendants of this element are one group. The group remembers the child that had the focus, so coming back to it returns to the same child. The group wraps at its edges unless [El::focus_wrap] says otherwise.
  • ...and 179 more

Trait implementations: BackdropExt, BurstExt, ChartExt, Clone, Debug, DeformExt, DepthExt, DistortExt, From<&str>, From<Bloom>, From<Conic>, From<DataTable>, From<DataView>, From<DatePicker>, From<Field>, From<Flare>, From<Flow>, From<Grad>, From<IconEl>, From<KineFx>, From<LightLeak>, From<LightShafts>, From<Mesh>, From<Parallax> ...

structaster_blueprint::ui::Rendered

pub struct Rendered { /* see fields */ }

A rendered screen: pixels, the auto-registered semantic tree and the solved layout.

Public fields

fieldtype
imageheadless::Image
treeuitree::UiTree
solvedstd::rc::Rc<layout::Solved>Shared with the layout cache (a frame whose layout input did not change holds the cached solution).
theme_nameString

Methods

  • fn png(&self, path: impl AsRef<Path>) -> Result<(), UiError> — Write the picture as PNG.
  • fn params(&self, prefix: &str) -> Result<Vec<(Symbol, Literal)>, UiError> — Solved geometry of every element with an explicit .id() as graph LogicalLength parameters prefix.<id>.x|y|w|h, for graph-driven retargeting.

structaster_blueprint::ui::Screen

pub struct Screen { /* see fields */ }

Entry point: theme + size + scale, then render(&root).

Methods

  • fn new(theme: &Theme) -> Result<Self, UiError> — 1280x800 at 1x with the bundled DejaVu fonts (never system fonts).
  • fn size(self, w: u32, h: u32) -> Self — Logical size in px.
  • fn font_bytes(self, name: &str, bytes: &[u8]) -> Result<Self, UiError> — Register a face for the rich text (the runs may name it).
  • fn font_file(self, name: &str, path: impl AsRef<Path>) -> Result<Self, UiError> — Register a face for the rich text from a file.
  • fn fallbacks(self, names: &[&str]) -> Self — The default fallback chain of the rich text: the faces a run falls back to when its own face has no glyph for a cluster.
  • fn scale(self, scale: f64) -> Self — Output scale (2.0 = 2x pixel density).
  • fn theme(self, theme: &Theme) -> Self — Switch theme: re-render the same tree with different tokens.
  • fn layout_cache_stats(&self) -> (u64, u64) — (hits, misses) of the layout cache since the screen was made (for tests and profiling).
  • fn layout_cache_bytes(&self) -> usize — The heap the layout cache holds (the lowered trees and their solutions).
  • fn layout_slot_bytes(&self) -> Vec<usize> — The heap each layout slot holds (the lowered tree and its solution), most recent first.
  • fn layer_cache_stats(&self) -> (u64, u64) — (hits, misses) of the immersive layer caches since the screen was made (for tests and profiling).
  • fn render(&mut self, root: &El) -> Result<Rendered, UiError> — Layout, scene, effects, headless render, UiTree registration.
  • fn tiled_shadows(self, on: bool) -> Self — Draw large drop shadows (cards, panels, headers: more than two 128 px tiles on an axis) from one small baked drawing and clipped copies of it instead of baking the whole box: 1-5 ms instead of 20-25 ms for a 788x474 card, which is most of the first visit of a page and of a resize. Off by default: the renderer rounds the corner arcs of a fill by the box's own coordinates, so a tiled shadow equals the single drawing everywhere but for an occasional pixel one level off at a corner (one pixel of 3.4 million in the print-farm demo at 2x). Only power-of-two scales, boxes whose sides are multiples of 1/256 px and places that are not an exact half pixel are tiled; the rest keeps the single drawing.
  • fn snap_pixels(self, on: bool) -> Self — Snap every laid-out box to the device pixel grid before painting: each edge goes to the nearest device pixel, so a box at a fractional device position (a logical x of 263 at scale 1.25 is 328.75 px) paints with crisp edges, and stacked text blocks and fractional-width keycaps stay on the grid. Edges are rounded, not sizes, so boxes that touch keep touching; a baseline and a scroll clip move with their box, and the hit boxes are the painted ones. A box can grow or shrink by up to one device pixel. Off by default (the pixels of a fractional scale change); at an integer scale with whole logical coordinates it changes nothing.

structaster_blueprint::ui::Span

pub struct Span { /* see fields */ }

One inline run of a rich text: its text, and optionally its own face, size and colour. The runs of one rich text are laid out as one paragraph (the lines break across the runs).

Public fields

fieldtype
textStringThe text of the run.
fontOption<String>The face of the run (the element's own face when it is none).
sizeOption<f64>The size of the run (the element's own size when it is none).
colorOption<Col>The colour of the run (the element's own colour when it is none).
dirOption<layout::Direction>The run is a directional isolate (see [Span::dir]).
decoSpanDecoThe run is underlined, struck through or on a background; none of it changes the layout (see [Span::underline]).
italicboolThe run is set in the oblique face (see [Span::italic]).

Methods

  • fn new(text: impl Into<String>) -> Span — A run of text in the element's own face, size and colour.
  • fn underline(self) -> Span — A line under the run, in the run's colour (a hyperlink, an SGR underline). It sits below the baseline and does not change the run's width or the line's height, so give the line some leading if the next line must not touch it.
  • fn strike(self) -> Span — A line through the middle of the run, in the run's colour (deleted text, an SGR strikethrough). Layout is unchanged.
  • fn bg(self, c: impl Into<Col>) -> Span — A background behind the run: the full height of the run's line, as wide as the run (a terminal cell's background, a highlight, a code chip). It is drawn under the text and does not change the layout. The text colour is not adjusted: pick a pair with enough contrast (the a11y audit judges text against what is drawn under it).
  • fn italic(self) -> Span — The oblique face of the run. The bundled faces have two obliques, Inter Oblique and DejaVu Sans Mono Oblique: the proportional oblique ("italic") or the oblique monospace ("mono-italic") when the run is a monospace one. The host cannot slant a face (it refuses a synthetic bold or italic), so a proportional oblique is Inter Oblique (see docs/TYPE.md).
  • fn dir(self, dir: layout::Direction) -> Span — Make the run a directional isolate (UAX #9 LRI / RLI): it is resolved in dir on its own and counts as one neutral object for the text around it, so a Hebrew name in an English sentence keeps its own order and the punctuation next to it stays in the sentence's direction.
  • fn font(self, f: impl Into<String>) -> Span — The face of the run ("bold" is the bold face of the theme).
  • fn mono(self) -> Span — The monospace face of the run ("mono", or the oblique monospace when the run is an italic one).
  • fn tabular(self) -> Span — Tabular figures: every digit of the run has the width of the others, so a column of values lines up and a running clock does not jitter. (A number with a short unit is tabular without asking.)
  • fn proportional(self) -> Span — Proportional figures, even in a number with a unit.
  • fn small_caps(self) -> Span — Small capitals: the lower case of the run is drawn as capitals at 80 % of their size, in the weight of the run (Latin; the sans faces of the default set have them).
  • fn fractions(self) -> Span — Diagonal fractions: 1/2 is drawn as a fraction.
  • fn slashed_zero(self) -> Span — A zero with a slash through it, so it is never an O (codes, serial numbers, tables).
  • fn case_sensitive(self) -> Span — Case-sensitive forms: the hyphen, the slash and the brackets sit at the middle of the capitals. (A text in capitals gets them without asking.)
  • fn weight(self, w: u16) -> Span — The run at a weight of the Inter ramp, 100 (Thin) to 900 (Black), rounded to the nearest hundred: every weight is a face of its own, so the steps are real (.weight(300) is lighter than .weight(400)).
  • fn bold(self) -> Span — The bold face of the run.
  • fn size(self, s: f64) -> Span — The size of the run (px).
  • fn color(self, c: impl Into<Col>) -> Span — The colour of the run.

Trait implementations: Clone, Debug

structaster_blueprint::ui::SpanDeco

pub struct SpanDeco { /* see fields */ }

The decoration of a [Span]: a line under or through the run in its colour, and a background behind it.

Public fields

fieldtype
underlinebool
strikebool
bgOption<Col>

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::a11y::A11yIssue

pub struct A11yIssue { /* see fields */ }

One finding.

Public fields

fieldtype
ruleA11yRule
idString
rectuitree::Rect
messageString
fixString

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::a11y::A11yReport

pub struct A11yReport { /* see fields */ }

The result of [UiTree::audit_a11y].

Public fields

fieldtype
issuesVec<A11yIssue>
warningsVec<A11yIssue>Findings that do not fail the audit: the backdrop under a text is not fully known.

Methods

  • fn is_clean(&self) -> bool
  • fn of(&self, rule: A11yRule) -> impl Iterator<Item = &A11yIssue>
  • fn warnings(&self) -> &[A11yIssue] — The warnings of the report (the backdrops the audit could not read).
  • fn assert_clean(&self) — Panics with the full report unless there are no findings.

Trait implementations: Clone, Debug, Default, Display, PartialEq, StructuralPartialEq

structaster_blueprint::ui::a11y::Meta

pub struct Meta { /* see fields */ }

Author-supplied accessibility metadata on an element (S::a11y).

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::a11y::NodeA11y

pub struct NodeA11y { /* see fields */ }

What the builder knew about a node (static facts; interaction state is in UiNode::flags).

Public fields

fieldtype
interactivebool
focusablebool
nameStringLabel ("" = none).
name_from_contentboolThe name was taken from the element's own text, which for a text field may be its contents.
descriptionString
valueOption<String>
numericOption<aster_ui::semantics::NumericValue>
sensitivebool
expandedOption<bool>
rtlboolThe element sits in a right-to-left subtree (the reading order runs right to left).
fadingboolThe element is fading in or out: its text is only transiently faint, so the contrast audit leaves it alone until it settles.
textOption<TextInfo>The measured contrast of the text (the builder leaves it empty: the audit measures the backdrops when it runs, see [UiTree::audit_a11y] and [UiTree::text_contrasts]).

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::a11y::OverflowIssue

pub struct OverflowIssue { /* see fields */ }

One finding of [UiTree::audit_overflow]: a container whose children extend past its content box.

Public fields

fieldtype
idStringThe container.
rectuitree::Rect
over[f64; 2]How far the children stick out past the content box, in logical px: (right/bottom, ...) as (x, y).
childOption<String>The child that reaches furthest past the container's edge, when it is in the tree.
messageString
fixString

Trait implementations: Clone, Debug, Display, PartialEq, StructuralPartialEq

structaster_blueprint::ui::a11y::SemNode

pub struct SemNode { /* see fields */ }

One node of the semantic mapping, in aster_ui::semantics terms.

Public fields

fieldtype
idStringThe UiTree node id.
parentOption<usize>Index of the nearest emitted ancestor.
rectuitree::Rect
roleaster_ui::semantics::Role
nameString
descriptionString
valueOption<String>
numericOption<aster_ui::semantics::NumericValue>
stateaster_ui::semantics::State
actionsaster_ui::semantics::Actions
model_keyOption<aster_ui::ModelKey>

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::a11y::SemanticTree

pub struct SemanticTree { /* see fields */ }

The accessibility tree of a screen: logical order, flat, parents by index.

Public fields

fieldtype
nodesVec<SemNode>

Methods

  • fn find(&self, id: &str) -> Option<&SemNode>
  • fn descriptions<'a>(&self, scene: &Scene) -> Vec<Description<'a>> — aster_ui descriptions for a semantics::Presenter::stage: the nodes whose model_key is in scene (in an App scene those are the interactive elements; labels and text are folded into their names).
  • fn dump(&self) -> String — A stable text dump for snapshots and eyes.

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::a11y::TextInfo

pub struct TextInfo { /* see fields */ }

Foreground/background facts for one text node.

Public fields

fieldtype
fgaster_ui::Srgb8
bgaster_ui::Srgb8The background sample with the lowest contrast.
ratiof64
requiredf64
pxf64
runOption<String>The text of the run this contrast belongs to (a rich text only): the audit reports the worst run of a rich text and says which run it is.
unknownboolThe backdrop under the text is not fully known (a picture or another paint the audit cannot model): bg is the last known colour, the audit reports it as a warning.
layerusizeWhich unreadable layer (an index in paint order) made the backdrop unknown.
coveredboolAn opaque picture covers the backdrop ([El::opaque_art]): no colour under the text is known at all. bg and ratio are then not a measurement (bg is transparent, ratio is 0), the contrast is not judged and the audit reports it as unknown.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::charts::Axis

pub struct Axis { /* see fields */ }

A linear value axis with "nice" bounds and a tick step.

Public fields

fieldtype
lof64
hif64
stepf64

Methods

  • fn new(min: f64, max: f64) -> Axis — Smallest nice range that contains min..=max and zero, in steps of 1, 2, 2.5 or 5 x 10^k (at most about 5 intervals).
  • fn fit(min: f64, max: f64) -> Axis — Like [Axis::new] for data that need not include zero (an x axis of years, a y axis of 98..102): the smallest nice range around min..=max, in the same steps.
  • fn frac(&self, v: f64) -> f64 — Where v sits in the range: 0 at lo, 1 at hi (clamped).
  • fn ticks(&self) -> Vec<f64> — Tick values from lo to hi inclusive.
  • fn label(&self, v: f64) -> String — The tick label for v (12, 2.5, 1.5k).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::charts::LogAxis

pub struct LogAxis { /* see fields */ }

A logarithmic value axis (.log_y()): whole decades, 10^lo to 10^hi, a tick every step decades (one for up to five decades, more beyond that so the labels do not crowd). The values must be above zero.

Public fields

fieldtype
loi32
hii32
stepi32

Methods

  • fn new(min: f64, max: f64) -> LogAxis — The decades that contain min..=max (both above zero).
  • fn frac(&self, v: f64) -> f64 — Where v sits: 0 at 10^lo, 1 at 10^hi (clamped; zero and below sit at 0).
  • fn ticks(&self) -> Vec<f64> — Tick values, 10^lo up to 10^hi.
  • fn label(&self, v: f64) -> String — The tick label for v: 0.01, 1, 100, 10k, 1M.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

structaster_blueprint::ui::charts::Series

pub struct Series { /* see fields */ }

One named data series for [line_chart] / [area_chart].

Public fields

fieldtype
nameString
valuesVec<f64>

Methods

  • fn new<V: Copy + Into<f64>>(name: impl AsRef<str>, values: &[V]) -> Self — Series::new("CPU", &[3., 5., 4.]); the colour cycles Accent, Info, Success, Warning unless .role(..).
  • fn role(self, role: Role) -> Self
  • fn right_axis(self) -> Self — Plot this series against a second value axis on the right, with its own nice range and ticks (line_chart, area_chart: a temperature over a request count). At least one series must stay on the left axis. The legend and the chart's description say which series are on the right.

Trait implementations: Clone, Debug

structaster_blueprint::ui::charts::XySeries

pub struct XySeries { /* see fields */ }

One named series of (x, y) points for [scatter_chart].

Public fields

fieldtype
nameString
pointsVec<[f64; 2]>

Methods

  • fn new<X: Copy + Into<f64>, Y: Copy + Into<f64>>(name: impl AsRef<str>, points: &[(X, Y)]) -> Self — XySeries::new("run A", &[(1., 2.5), (2., 3.1)]); the colour cycles Accent, Info, Success, Warning unless .role(..).
  • fn role(self, role: Role) -> Self

Trait implementations: Clone, Debug

structaster_blueprint::ui::choreo::PageMotion

pub struct PageMotion { /* see fields */ }

Where a page's elements come from when the page changes.

Public fields

fieldtype
from_opf64The opacity the page starts at.
from_off[f64; 2]The offset (px) the page starts at.
from_scalef64The scale the page starts at.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::choreo::Stagger

pub struct Stagger { /* see fields */ }

How a staggered entrance is timed.

Public fields

fieldtype
step_msu32The delay between two children (ms). It shrinks when there are many children, so the whole entrance still fits in [Stagger::max_total_ms].
risef64How far the children rise into place (px).
dur_msu32How long one child takes to arrive (ms).
max_total_msu32The most the whole entrance takes (ms): the last child is in place by then.
max_itemsusizeThe most children that are staggered (the rest arrive with the last one).

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::components::PipelineOpts

pub struct PipelineOpts { /* see fields */ }

Vertical layout of [pipeline_with].

Public fields

fieldtype
valignlayout::AlignHow each column's nodes sit in the height: Align::Stretch (default) spreads them over the whole height, Start / Center / End pack each column into the top / middle / bottom (equal-size cells per node).
staggerf64Fraction of the height (0..=0.4) by which every other column (the 2nd, 4th, ..) is pushed down and the others pulled up: the zig-zag of a staggered flow. 0. = none (default).

Methods

  • fn new() -> Self
  • fn valign(self, a: Align) -> Self
  • fn stagger(self, f: f64) -> Self

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::controls::DataView

pub struct DataView { /* see fields */ }

The states every data view has, in one place: [loading_state] while Bool <key>.loading, [error_state] with a retry while Text <key>.error is not empty, [empty_state_icon] when there is nothing (count == 0), else view(). The first that applies wins, in that order. The retry button <key>.retry ("Try again") clears the error and sets <key>.loading again (the app starts its request when it sees the flag); .on_retry(..) adds an action of your own. Works around anything that has a count: a list, a chart's data, a grid_auto of cards, a shelf.

data_view(s, "hosts", rows.len(), || hbar_chart(&values, &names)).empty(empty_state("∅", "No hosts", "Add one")).build()

Methods

  • fn loading(self, el: El) -> Self — Your own loading placeholder (skeleton_card()s in a grid_auto) instead of [loading_state].
  • fn empty(self, el: El) -> Self — Your own empty state ("Nothing matches" with a "Clear filters" button).
  • fn error_title(self, title: impl AsRef<str>) -> Self — The error panel's title (the detail is the Text <key>.error).
  • fn on_retry(self, action: Action) -> Self — Run action as well when "Try again" is clicked.
  • fn keep_stale(self) -> Self — Keep showing the view while it has rows, whatever the loading and error flags say (a refresh in the background, a failed refresh): the placeholders then stand in for an empty view only.
  • fn build(self) -> El

Trait implementations: From<DataView>

structaster_blueprint::ui::controls::Form

pub struct Form { /* see fields */ }

A group of validated fields. form.can_submit(store) is true while every rule passes; bind a submit control to it with .disabled_if(form.disabled()), or give it form.submit(action), which runs the action only when the form is valid and otherwise reveals every error and moves the focus to the first field that fails. Create it once, outside the screen closure, and move a clone into it; fields register themselves when built. Around that: [Form::summary] (an error summary for the top), [Form::fail] / [Form::pending] / [Form::resolve] (a server's verdict, an async check), [Form::submit_on_enter], [Form::reset].

Methods

  • fn new() -> Self
  • fn rule(&self, key: impl AsRef<str>, f: impl Fn(&Store) -> Result<(), String> + 'static) -> &Self — Add a rule over the whole store for the field with id key (a select, a stepper, a date picker, or a check across fields such as "the two passwords match"). Err(message) blocks the form.
  • fn errors(&self, s: &Store) -> Vec<(String, String)> — (field key, message) for every failing rule, in the order the fields were built; a server answer given with fail counts while the field still holds the value it was given for.
  • fn submit_on_enter(&self, action: Action) -> Action — submit action, and make every single-line field built after this call submit it on Enter (a field with its own .on_key(Key::Enter, ..) keeps that). Returns the action for the submit button.
  • fn pending(key: impl AsRef<str>) -> Action — A check on key's current value is under way (a request to the server): the field shows "Checking..." where its hint is, and submit waits (it reveals the errors and focuses the field, as for any failing rule). Answer with fail or resolve; an edit of the value drops it too.
  • fn resolve(key: impl AsRef<str>) -> Action — The check started with pending passed: the field goes back to its hint.
  • fn fail(key: impl AsRef<str>, msg: impl AsRef<str>) -> Action — A server's (or any late) verdict on one field: Form::fail("email", "That email is taken") shows the message under the field at once, focuses it, and blocks submit until the field's value changes (then the answer no longer applies and goes away by itself). Run it from an action after the "request" finished.
  • fn summary(&self, s: &Store) -> El — A summary of the problems on the form for its top: a danger callout (heard as an alert) titled "N problems to fix" with one line per shown error, "Label: message", that moves the focus to its field when clicked or activated. Nothing until a field shows an error (after a failed submit, or once a field was left).
  • fn can_submit(&self, s: &Store) -> bool — Every registered rule passes (also true for a form with no rules).
  • fn disabled(&self) -> impl Fn(&Store) -> bool + 'static — Predicate for .disabled_if(..): true while the form cannot be submitted.
  • fn touch_all(&self) -> Action — Action that shows every field's error (put it on a disabled-looking submit, or run it on Enter).
  • fn reset(&self) -> Action — Hide every error again: clears each field's touched flag and the server answers given with fail (the values stay; empty them yourself). Run it after a successful submit or from a "Clear" button.
  • fn focus_first_error(&self) -> Action — Reveal every error and focus the first field that fails (nothing happens when the form is valid).
  • fn submit(&self, action: Action) -> Action — Run action when every rule passes; otherwise reveal every error and focus the first failing field instead. Put it on the submit element and on .on_key(Key::Enter, ..) of the fields.

Trait implementations: Clone, Default

structaster_blueprint::ui::controls::InputEnv

pub struct InputEnv<'a> { /* see fields */ }

Host services available to an input handler.

Public fields

fieldtype
clipboard&'a mut dyn Clipboard

structaster_blueprint::ui::controls::MemoryClipboard

pub struct MemoryClipboard(..)

In-memory clipboard (the default for headless use and tests).

Trait implementations: Clipboard, Clone, Debug, Default

structaster_blueprint::ui::controls::Shelf

pub struct Shelf { /* see fields */ }

One horizontally scrolling row of tiles: the builder.

Only the tiles in view (plus an overscan) are built, so count may be 100k+.

Methods

  • fn gap(self, px: impl Into<f64>) -> Self — The gap between the tiles (px).
  • fn overscan(self, n: usize) -> Self — The tiles built beyond the view (default 1).
  • fn smooth_scroll(self, ms: u32) -> Self — Ease the offset moves of the shelf: ms is the duration of a move (the target stays in the Scalar <id>.scroll).
  • fn touch_scroll(self) -> Self — Pan with a touch drag (see [El::touch_scroll]).
  • fn overscroll(self, on: bool) -> Self — Rubber-band at the ends (see [El::overscroll]).
  • fn smooth_wheel(self, ms: u32) -> Self — Ease the wheel's moves too (see [El::smooth_wheel]).
  • fn reorderable(self, on_move: impl Fn(&mut Store, usize, usize) + 'static) -> Self — The tiles of the shelf can be reordered by the user: on_move(from, to) runs when a tile lands on a new place (the app moves it in its own list).
  • fn build(self) -> El — The shelf itself.

Trait implementations: From<Shelf>

structaster_blueprint::ui::controls::Shelves

pub struct Shelves { /* see fields */ }

A page of shelves: the builder.

Only the shelves in view (plus an overscan) are built, and a shelf only its tiles in view.

Methods

  • fn gap(self, px: impl Into<f64>) -> Self — The gap between the tiles and between the shelves (px).
  • fn overscan(self, n: usize) -> Self — The shelves (and the tiles) built beyond the view (default 1).
  • fn title_h(self, px: impl Into<f64>) -> Self — The height of a shelf title (the body's line height by default).
  • fn smooth_scroll(self, ms: u32) -> Self — Ease the offset moves of the page and of its shelves: ms is the duration of a move (the target stays in the Scalar <id>.scroll).
  • fn touch_scroll(self) -> Self — Pan with a touch drag (see [El::touch_scroll]).
  • fn overscroll(self, on: bool) -> Self — Rubber-band at the ends (see [El::overscroll]).
  • fn smooth_wheel(self, ms: u32) -> Self — Ease the wheel's moves too (see [El::smooth_wheel]).
  • fn reorderable(self, on_move: impl Fn(&mut Store, usize, usize, usize) + 'static) -> Self — The tiles of every shelf can be reordered by the user: on_move(shelf, from, to) runs when a tile lands on a new place of its shelf (the app moves it in its own list).
  • fn build(self) -> El — The page itself.

Trait implementations: From<Shelves>

structaster_blueprint::ui::controls::TextInput

pub struct TextInput { /* see fields */ }

Builder for text inputs: text_input(s, "k", "placeholder") then .password(), .multiline(rows), .max_length(n), .validate(..), .form(&form), .w(px), then .build() (or .into() / .child(..)) to get the [El].

Methods

  • fn password(self) -> Self — Mask the value and enable the reveal toggle (see [password_field]).
  • fn multiline(self, rows: usize) -> Self — rows visible lines (>= 2 makes a wrapping text area).
  • fn max_length(self, n: usize) -> Self — At most n chars: typing past it is refused, a paste is cut to fit.
  • fn w(self, px: impl Into<f64>) -> Self — Exact width in px. Without it the input is 240 px wide on its own, but fills the width of a stretching parent (a col) or of a .grow(1.) slot in a row, and a text area wraps at the width it was actually given.
  • fn multi_caret(self) -> Self — Opt in to several carets/selections. Ctrl-D selects the word at the caret, then adds the next occurrence of the selected text; Alt-Down / Alt-Up (text area) add a caret on the next / previous line. Typing, Enter, Backspace, Delete, Left/Right and Home/End then apply at every caret, Escape keeps only the primary one. The extra ones live in Text <key>.extra (caret:anchor;.., chars); any other key, a click, undo or IME collapses them. Off by default (single caret as before).
  • fn reveal_toggle(self, on: bool) -> Self — Show or hide the Show/Hide toggle of a password field.
  • fn validate(self, f: impl Fn(&str) -> Result<(), String> + 'static) -> Self — Validation rule: Err(message) is shown under the field in the danger role once the field was edited or left (<key>.touched), and the border turns danger.
  • fn rule(self, r: rules::Rule) -> Self — validate with a ready-made [rules::Rule]: .rule(rules::required("Name?").and(rules::min_len(3, "Too short"))).
  • fn validate_store(self, f: impl Fn(&Store) -> Result<(), String> + 'static) -> Self — A rule over the whole store, run after .validate(..): it can compare this field with others ("the passwords match") or read any other state. Shown and registered with the [Form] like the others.
  • fn required(self) -> Self — Mark the field required: a * after the label, "Required" in the field's description, and an error ("Required") once it was left while empty (blank counts as empty), ahead of any .validate(..) / .rule(..). With a [Form] it is a rule by itself, so .form(&f) needs nothing else.
  • fn required_msg(self, msg: impl AsRef<str>) -> Self — required with your own message ("Enter your name").
  • fn error(self, msg: impl AsRef<str>) -> Self — An error that shows at once, whatever the field holds (a server's answer: "That email is taken"). It wins over a rule's.
  • fn form(self, form: &Form) -> Self — Register the field's rule with a [Form] (.validate(..), .rule(..) or .required()).
  • fn on_key(self, key: Key, action: Action) -> Self — .on_key(Key::Enter, action) on the field (submit).
  • fn submit_on_enter(self, action: Action) -> Self — Enter runs action (send the message) while Shift+Enter still inserts a newline: the chat composer of a [text_area]. The action runs for Enter and Ctrl+Enter, not for Shift, Alt or Meta with it; an IME's Enter that confirms a composition is not a key and never submits. The field's accessible description says so ("Enter sends, Shift+Enter adds a new line"), unless .required() writes its own. In a single-line field it is the same as .on_key(Key::Enter, action). Clear the draft in the same action: Action::seq([send, Action::set("draft", "")]).
  • fn disabled_if(self, f: impl Fn(&Store) -> bool + 'static) -> Self — Disabled while f(store) is true.
  • fn label(self, label: impl AsRef<str>) -> Self — A caption above the field; it is also the field's label (the placeholder otherwise).
  • fn hint(self, hint: impl AsRef<str>) -> Self — Helper text under the field, muted; a validation error replaces it while there is one.
  • fn counter(self) -> Self — A 12 / 280 character count under the field, right aligned (needs .max_length(n); refused without).
  • fn clear_button(self) -> Self — An x button at the end of a single-line field (<key>.clear, label "Clear") that empties it, undoably, and keeps the focus; its slot is kept while the field is empty so the field does not change width.
  • fn on_change(self, action: Action) -> Self — Run action after the text changed by typing, deleting, pasting, cutting, undo, an IME commit or the clear button (not when the app sets the key itself): mark a form dirty, start a debounce timer (start_timer + App::on_expire), filter.
  • fn read_only(self) -> Self — Read only: the caret, selection, Ctrl-A and copy work, typing, deleting, pasting, cutting, undo and IME do nothing, and the field is a read-only text field for assistive tech. (Disabled is .disabled_if(..).)
  • fn mono(self) -> Self — Set the text in the monospace face (see [El::mono]): hostnames, commands, keys, fingerprints, code. Every character has the same advance, so a caret, a selection and a column of fields line up.
  • fn copy_button(self) -> Self — A copy button at the end of a single-line field (<key>.copy, labelled "Copy"): it puts the whole text on the app clipboard, shows a check mark for a moment (Bool <key>.copied, a 1.5 s timer) and the app announces "Copied". Pair it with read_only or [selectable_text] for a command, a fingerprint, an address.
  • fn bare(self) -> Self — No fill and no outline: the field reads as plain text (its focus ring still shows). Selection and copy work as before.
  • fn build(self) -> El — Build the element.

Trait implementations: From<TextInput>

structaster_blueprint::ui::controls::VirtualGrid

pub struct VirtualGrid { /* see fields */ }

A virtualised grid of tiles: the builder.

virtual_grid(s, "g", 10_000, 220., 140., |i| tile(i)) is a grid of 10,000 tiles that lays out the rows in view only. The columns follow the width the grid got (or .cols(n), or a minimum tile width in the foundation's units). The tiles are keyed <id>.<i>; the scroll offset is the Scalar <id>.scroll and the focused index the Int <id>.sel.

Methods

  • fn cols(self, n: usize) -> Self — A fixed number of columns (else they follow the width the grid got).
  • fn min_tile_w(self, l: Len) -> Self — The smallest a tile may be, in the foundation's units (Len::Vw(12.)): the columns follow it and the tiles share the width the grid got.
  • fn gap(self, px: impl Into<f64>) -> Self — The gap between the tiles (px).
  • fn overscan(self, rows: usize) -> Self — The rows built above and below the view (default 1).
  • fn smooth_scroll(self, ms: u32) -> Self — Ease the offset moves of the grid: ms is the duration of a move (the target stays in the Scalar <id>.scroll).
  • fn touch_scroll(self) -> Self — Pan with a touch drag (see [El::touch_scroll]).
  • fn overscroll(self, on: bool) -> Self — Rubber-band at the ends (see [El::overscroll]).
  • fn smooth_wheel(self, ms: u32) -> Self — Ease the wheel's moves too (see [El::smooth_wheel]).
  • fn reorderable(self, on_move: impl Fn(&mut Store, usize, usize) + 'static) -> Self — The tiles of the grid can be reordered by the user: on_move(from, to) runs when a tile lands on a new place (the app moves it in its own list).
  • fn build(self) -> El — The grid itself.

Trait implementations: From<VirtualGrid>

structaster_blueprint::ui::controls::rules::Rule

pub struct Rule(..)

A validation rule: Ok(()) or the message to show.

Methods

  • fn new(f: impl Fn(&str) -> Result<(), String> + 'static) -> Rule
  • fn check(&self, v: &str) -> Result<(), String> — Check a value.
  • fn and(self, next: Rule) -> Rule — This rule, then next when it passes: the first failure's message wins.

Trait implementations: Clone

structaster_blueprint::ui::cut::Cut

pub struct Cut { /* see fields */ }

A screen transition. Cut::dissolve().edge(hex(0xff9a3d), 2.).ms(700).

Angles are degrees with y down: 0 travels left to right, 90 top to bottom.

Methods

  • fn dissolve() -> Cut — Seeded fBm noise threshold: the new screen appears where the noise is low first.
  • fn wipe(angle_deg: f64) -> Cut — A soft edge sweeping across at angle_deg; the new screen follows it.
  • fn iris() -> Cut — A circle opening from a point (the pointer when known, else the centre). .close() shrinks the old screen instead.
  • fn pixelate() -> Cut — The old screen breaks into growing blocks, the new one resolves from them.
  • fn push() -> Cut — The old screen slides out and shrinks while the new one slides in and grows. angle: 180 (default) leaves left.
  • fn fade() -> Cut — A plain cross-fade: every pixel mixes old into new by the eased progress (no front, no noise). The look of a theme switch (App::theme_fade).
  • fn seed(self, seed: u32) -> Self — Noise seed (dissolve).
  • fn grain(self, px: f64) -> Self — Noise feature size in logical px (dissolve).
  • fn octaves(self, n: u32) -> Self
  • fn value_noise(self) -> Self — Blocky value noise instead of smooth Perlin (dissolve).
  • fn edge(self, color: impl Into<Col>, width: f64) -> Self — A glowing band in color along the front (all but pixelate and push). width 1 is about 4 % of the travel; 2 is a thick burn.
  • fn angle(self, deg: f64) -> Self — Direction of the wipe or push.
  • fn feather(self, f: f64) -> Self — Softness of the front as a fraction of the travel (0.02 crisp, 0.3 very soft).
  • fn hard(self) -> Self — A one-pixel-antialiased front.
  • fn at(self, x: f64, y: f64) -> Self — Iris centre as fractions of the screen (default: the pointer, else 0.5, 0.5).
  • fn close(self) -> Self — Iris closing on the old screen (it shrinks into the point) instead of opening onto the new one.
  • fn blocks(self, px: f64) -> Self — Largest mosaic block in logical px.
  • fn screen(self) -> Self — Play over the whole screen wherever cut_on puts it (the meaning of a nested cut_on before region cuts existed).
  • fn region(self) -> Self — Play inside the declaring element's rectangle, also on the tree root.
  • fn ms(self, ms: u32) -> Self — A literal duration in ms (still instant under reduced motion).
  • fn duration(self, d: MotionDuration) -> Self — A theme duration (MotionDuration::Slow ...).
  • fn ease(self, e: Ease) -> Self — A theme curve.
  • fn token(self, t: MotionToken) -> Self — A duration and curve from a theme token (MotionToken::EMPHASIZED).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::data::Column

pub struct Column { /* see fields */ }

A column of a [DataTable].

Methods

  • fn new(title: impl AsRef<str>) -> Self — A sortable column titled title, flexible width 1.
  • fn grow(self, g: f64) -> Self — Relative width (flex weight).
  • fn right(self) -> Self — Right-align (numbers).
  • fn no_sort(self) -> Self — Header is not clickable.
  • fn secondary(self) -> Self — Hidden at the Compact (phone) size class.

Trait implementations: Clone, From<T>

structaster_blueprint::ui::data::DataTable

pub struct DataTable { /* see fields */ }

Sortable, filterable, paged table with optional row selection.

Store keys (all optional to initialise; missing = default): Text <key>.sort (column index or ""), Bool <key>.desc, Text <key>.q (filter), Int <key>.page (0-based), Text list <key>.sel (selected row numbers as text; read them with [DataTable::selected]). Ids: headers <key>.h.<col>, select-all <key>.all, row boxes <key>.sel.<row>, filter field <key>.q, pager <key>.page.*.

Methods

  • fn new<C: Into<Column>>(s: &Store, key: impl AsRef<str>, cols: impl IntoIterator<Item = C>, rows: Vec<Vec<String>>) -> Self — rows[r][c] is the text of cell c of row r (row number r is the stable row id).
  • fn page_size(self, n: usize) -> Self — Rows per page (default 8).
  • fn search(self, on: bool) -> Self — Show or hide the filter box (default shown).
  • fn selectable(self) -> Self — Checkbox column with select-all.
  • fn cell(self, f: impl Fn(usize, usize, &str) -> Option<El> + 'static) -> Self — Custom cell element: return None to use the plain text.
  • fn selected(s: &Store, key: &str) -> Vec<usize> — Selected row numbers (ascending) of table key.
  • fn order(&self) -> Vec<usize> — Row numbers after filtering and sorting (what the pager slices), for assertions.
  • fn build(self) -> El

Trait implementations: From<DataTable>

structaster_blueprint::ui::deco::Bg

pub struct Bg { /* see fields */ }

A highlight behind a range: a pill.

Public fields

fieldtype
fillFill
pad[f32; 2]Logical px around the run.
radiusf32
borderOption<(Color, f32)>

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::Caret

pub struct Caret { /* see fields */ }

A caret.

Public fields

fieldtype
atOption<(usize, usize)>(line, column), or None to sit at the end of the revealed text.
colorColor
blinkboolBlinks (period 1.06 s) when true.
blockboolBlock (cell wide) or bar.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::CodeOpts

pub struct CodeOpts { /* see fields */ }

Options of a code block beyond its decoration.

Public fields

fieldtype
langStringThe language name (js, sh, cs...); also the caption when caption is set.
captionbool
line_numbersbool
plainboolNo decoration at all: the plain monospace text (no lexing, no layers). The baseline, and an escape hatch.

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::deco::Deco

pub struct Deco { /* see fields */ }

Everything a code block's decoration is made of.

Public fields

fieldtype
rulesVec<Rule>
marksVec<Mark>
revealOption<Reveal>
caretOption<Caret>
edge_fadeOption<EdgeFade>
typingOption<Typing>
spotlightOption<Spotlight>

Methods

  • fn key(&self) -> u64 — A stable key of everything that changes a picture (the debug text, hashed once).
  • fn shape_key(&self) -> u64 — The key of what shapes the text and its cells: everything but the reveal's progress, so a reveal that advances every frame keeps its lexed cells and its glyph plane and only repaints.
  • fn animated(&self) -> bool — Whether any layer moves with the clock.
  • fn push(self, r: Rule) -> Deco

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::EdgeFade

pub struct EdgeFade { /* see fields */ }

The right-edge fade of a line the view clips.

Public fields

fieldtype
widthf32Logical px the text fades over.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::Glow

pub struct Glow { /* see fields */ }

A soft glow around the glyphs.

Public fields

fieldtype
colorColor
radiusf32Blur radius, logical px.
strengthf320..=2: how opaque the glow is at its core.
pulseOption<(f32, f32)>A pulse: (period s, depth 0..=1); the glow breathes between 1 - depth and 1 of its strength.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::Line

pub struct Line { /* see fields */ }

An underline or a strike-through.

Public fields

fieldtype
kindLineKind
colorOption<Color>The text colour when none.
thicknessf32Logical px (0 = the type size / 14, at least 1 device px).
marchf32Marching speed in logical px per second (dotted, dashed and wavy move along the line); 0 = still.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::Mark

pub struct Mark { /* see fields */ }

A mark that is not tied to characters: a band behind whole lines, a gutter bar, the current line.

Public fields

fieldtype
linesstd::ops::Range<usize>Lines a..b (0-based, end exclusive).
fillOption<Fill>The band behind the lines (full width).
gutterOption<Color>A bar in the gutter at the left edge.
ruleOption<Color>A hairline above and below the band.
whenOption<Mode>

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::Outline

pub struct Outline { /* see fields */ }

A stroke around the glyphs (drawn under the fill).

Public fields

fieldtype
colorColor
widthf32Logical px.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::Reveal

pub struct Reveal { /* see fields */ }

A per-glyph reveal driven by progress (0..=1).

Public fields

fieldtype
modeRevealMode
progressf32
caretOption<bool>A caret at the reveal front (typewriter shows one unless Some(false)).
flashOption<(f32, f32)>Glyphs that just appeared flash brighter and settle over secs: (glyphs per second, secs). Only for the typewriter mode.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::Rule

pub struct Rule { /* see fields */ }

Public fields

fieldtype
selSel
styleStyle
whenOption<Mode>

Methods

  • fn new(sel: Sel, style: Style) -> Rule
  • fn class(c: Class, style: Style) -> Rule
  • fn when(self, m: Mode) -> Rule

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::Shimmer

pub struct Shimmer { /* see fields */ }

A sheen sweeping across the glyphs.

Public fields

fieldtype
colorColor
widthf32Width of the band as a fraction of its scope (0.05..=1).
periodf32Seconds per sweep (the sweep then rests for rest seconds).
restf32
anglef32
strengthf320..=1.
scopeScopeLine or Block.
staggerf32Seconds between lines starting their sweep (a cascade); 0 = together.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::Spotlight

pub struct Spotlight { /* see fields */ }

Dim everything except a selected range; progress (0..=1) is eased, dim is how far the rest drops.

Public fields

fieldtype
selSel
progressf32
dimf32

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::Style

pub struct Style { /* see fields */ }

One layer of decoration. Every field is optional; see [Style::over].

Public fields

fieldtype
fillOption<Fill>
opacityOption<f32>
glowOption<Glow>
outlineOption<Outline>
underlineOption<Line>
strikeOption<Line>
bgOption<Bg>
shimmerOption<Shimmer>
flowOption<f32>A gradient fill that flows: cycles per second of the clock (the gradient repeats back and forth and scrolls).
focusOption<bool>Internal: Some(false) marks text a spotlight dims.

Methods

  • fn is_empty(&self) -> bool
  • fn over(&self, top: &Style) -> Style — self with top laid over it: every field top sets replaces the one here.
  • fn fill(self, f: Fill) -> Style
  • fn color(self, c: Color) -> Style
  • fn glow(self, g: Glow) -> Style
  • fn underline(self, kind: LineKind, color: Option<Color>) -> Style
  • fn bg(self, fill: Fill) -> Style

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::Typing

pub struct Typing { /* see fields */ }

A typing treatment driven by the clock: glyphs appear at cps after delay seconds, a caret leads, fresh glyphs flash and settle over flash seconds, and (with band) a soft band follows the caret's line.

Public fields

fieldtype
cpsf32
delayf32
flashf32
bandbool

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::cells::Cells

pub struct Cells { /* see fields */ }

Public fields

fieldtype
linesVec<LineCells>
stylesVec<super::style::Style>
marksVec<super::style::Mark>
max_colsusizeCharacters in the longest line.

Trait implementations: Clone, Debug

structaster_blueprint::ui::deco::cells::LineCells

pub struct LineCells { /* see fields */ }

One resolved line.

Public fields

fieldtype
charsVec<char>
styleVec<u16>Style id per character (index into [Cells::styles]).
segVec<u32>Segment id per character: equal ids are one token (one gradient run under [super::style::Scope::Token]).

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::deco::layer::Spec

pub struct Spec { /* see fields */ }

One decorated text: its source, language, decoration and view width.

Cheap to make every frame: the key of the text and decoration is computed once by the caller ([Spec::keyed]) and the resolved cells live in a cache shared by every spec of the same key.

Public fields

fieldtype
textstd::rc::Rc<str>
langsuper::lex::Lang
kindKind
decosuper::style::Deco
view_wOption<f32>The width the text is viewed in (logical px), for the edge fade; None = unknown (no fade).

Methods

  • fn base_key(text: &str, lang: Lang, kind: &Kind, deco: &Deco) -> u64 — The key of a text, its language and kind, and its decoration: compute once, pass to [Spec::keyed] each frame.
  • fn new(text: &str, lang: Lang, kind: Kind, deco: Deco, view_w: Option<f32>) -> Spec
  • fn keyed(text: Rc<str>, lang: Lang, kind: Kind, deco: Deco, view_w: Option<f32>, base: u64) -> Spec — A spec over an already normalized text with its precomputed [Spec::base_key].

structaster_blueprint::ui::deco::lex::Tok

pub struct Tok { /* see fields */ }

One lexed span.

Public fields

fieldtype
rangestd::ops::Range<usize>
classClass

Trait implementations: Clone, Debug, Eq, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::paint::BaseOpts

pub struct BaseOpts<'a> { /* see fields */ }

What the glyph pass needs beyond the frame.

Public fields

fieldtype
revealOption<&'a Reveal>
blurs&'a [(f32, Plane)]Blurred copies of the plane (radius in device px, plane) for the blur reveal.
skip_marchingboolLines that march are drawn by the dynamic layer, not here.
dimf32How far a spotlight dims the text it leaves out (0..=1, already eased).
flash_to[u8; 4]What a freshly typed glyph flashes toward.

structaster_blueprint::ui::deco::paint::CBg

pub struct CBg { /* see fields */ }

Public fields

fieldtype
fillCPaint
pad[f32; 2]
radiusf32
borderOption<([u8; 4], f32)>

Trait implementations: Clone, Debug

structaster_blueprint::ui::deco::paint::CCaret

pub struct CCaret { /* see fields */ }

Public fields

fieldtype
lineusize
colusize
color[u8; 4]
blinkbool
blockbool

Trait implementations: Clone, Debug

structaster_blueprint::ui::deco::paint::CGlow

pub struct CGlow { /* see fields */ }

Public fields

fieldtype
color[u8; 4]
radiusf32
strengthf32
pulseOption<(f32, f32)>

Trait implementations: Clone, Debug

structaster_blueprint::ui::deco::paint::CLine

pub struct CLine { /* see fields */ }

Public fields

fieldtype
kindLineKind
colorOption<[u8; 4]>
thickf32Device px (0 = from the type size).
marchf32

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::paint::CMark

pub struct CMark { /* see fields */ }

Public fields

fieldtype
linesstd::ops::Range<usize>
fillOption<CPaint>
gutterOption<[u8; 4]>
ruleOption<[u8; 4]>

Trait implementations: Clone, Debug

structaster_blueprint::ui::deco::paint::CShimmer

pub struct CShimmer { /* see fields */ }

Public fields

fieldtype
color[u8; 4]
widthf32
periodf32
restf32
anglef32
strengthf32
scopeScope
staggerf32

Trait implementations: Clone, Debug

structaster_blueprint::ui::deco::paint::CStyle

pub struct CStyle { /* see fields */ }

A style with its colours resolved for a theme and its lengths for a scale.

Public fields

fieldtype
fillCPaint
opacityf32
glowOption<CGlow>
outlineOption<([u8; 4], f32)>
underlineOption<CLine>
strikeOption<CLine>
bgOption<CBg>
shimmerOption<CShimmer>
flowf32Cycles per second of a flowing gradient (0 = still).
focusboolFalse for text a spotlight dims.

Trait implementations: Clone, Debug

structaster_blueprint::ui::deco::paint::Ev

pub struct Ev<'a> { /* see fields */ }

A gradient set up for one box: colour(x, y) is two multiplies and a lookup.

Methods

  • fn new(p: &'a CPaint, bx: [f32; 4]) -> Ev<'a>
  • fn flowing(self, phase: f32) -> Ev<'a> — The same gradient flowing: phase gradient lengths along, folded back and forth so it never jumps.
  • fn at(&self, x: f32, y: f32) -> [u8; 4]

Trait implementations: Clone, Copy

structaster_blueprint::ui::deco::paint::Frame

pub struct Frame<'a> { /* see fields */ }

The shared inputs of a paint.

Public fields

fieldtype
plane&'a Plane
geo&'a Geo
cells&'a super::cells::Cells
cs&'a [CStyle]
fadeOption<(f32, f32)>The right-edge fade: (start x, width) in plane device px.
tf32Clock seconds, for flowing gradients.

structaster_blueprint::ui::deco::paint::GState

pub struct GState { /* see fields */ }

Public fields

fieldtype
af32
dyf32Vertical offset in em (positive = down).
sf32
blurf32Blur radius in logical px.

Methods

  • const REST: GState

Trait implementations: Clone, Copy, Debug

structaster_blueprint::ui::deco::paint::Geo

pub struct Geo { /* see fields */ }

Where the lines and characters sit in the plane, in device pixels.

Public fields

fieldtype
scalef32
pitchf32Line pitch.
firstusizeFirst line in the plane, and how many.
nlinesusize
x0f32Plane position of the text's origin (the top-left of line first).
y0f32
pad_lf32The text element's left padding (where its box starts, left of x0).
baselinef32From a line's top: the baseline, and the type size.
emf32
edgesVec<Vec<f32>>Per plane line: character edges (chars + 1), from x0.
block[f32; 4]The whole block's box in plane coordinates (it may reach beyond the plane when the plane is a window).
glyphs_beforeVec<usize>Non-blank characters before each line (the whole block, not the window) and the total.
glyphsusize
total_linesusize
max_colsusize

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::deco::paint::Plane

pub struct Plane { /* see fields */ }

A coverage plane: one byte per device pixel.

Public fields

fieldtype
wusize
husize
aVec<u8>

Methods

  • fn new(w: usize, h: usize) -> Plane
  • fn blurred(&self, r: usize) -> Plane — A copy blurred with three box passes of r pixels each (close to a Gaussian of sigma r).

Trait implementations: Clone, Debug, Eq, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::style::Bg

pub struct Bg { /* see fields */ }

A highlight behind a range: a pill.

Public fields

fieldtype
fillFill
pad[f32; 2]Logical px around the run.
radiusf32
borderOption<(Color, f32)>

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::style::Caret

pub struct Caret { /* see fields */ }

A caret.

Public fields

fieldtype
atOption<(usize, usize)>(line, column), or None to sit at the end of the revealed text.
colorColor
blinkboolBlinks (period 1.06 s) when true.
blockboolBlock (cell wide) or bar.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::style::Deco

pub struct Deco { /* see fields */ }

Everything a code block's decoration is made of.

Public fields

fieldtype
rulesVec<Rule>
marksVec<Mark>
revealOption<Reveal>
caretOption<Caret>
edge_fadeOption<EdgeFade>
typingOption<Typing>
spotlightOption<Spotlight>

Methods

  • fn key(&self) -> u64 — A stable key of everything that changes a picture (the debug text, hashed once).
  • fn shape_key(&self) -> u64 — The key of what shapes the text and its cells: everything but the reveal's progress, so a reveal that advances every frame keeps its lexed cells and its glyph plane and only repaints.
  • fn animated(&self) -> bool — Whether any layer moves with the clock.
  • fn push(self, r: Rule) -> Deco

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::style::EdgeFade

pub struct EdgeFade { /* see fields */ }

The right-edge fade of a line the view clips.

Public fields

fieldtype
widthf32Logical px the text fades over.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::style::Glow

pub struct Glow { /* see fields */ }

A soft glow around the glyphs.

Public fields

fieldtype
colorColor
radiusf32Blur radius, logical px.
strengthf320..=2: how opaque the glow is at its core.
pulseOption<(f32, f32)>A pulse: (period s, depth 0..=1); the glow breathes between 1 - depth and 1 of its strength.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::style::Line

pub struct Line { /* see fields */ }

An underline or a strike-through.

Public fields

fieldtype
kindLineKind
colorOption<Color>The text colour when none.
thicknessf32Logical px (0 = the type size / 14, at least 1 device px).
marchf32Marching speed in logical px per second (dotted, dashed and wavy move along the line); 0 = still.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::style::Mark

pub struct Mark { /* see fields */ }

A mark that is not tied to characters: a band behind whole lines, a gutter bar, the current line.

Public fields

fieldtype
linesstd::ops::Range<usize>Lines a..b (0-based, end exclusive).
fillOption<Fill>The band behind the lines (full width).
gutterOption<Color>A bar in the gutter at the left edge.
ruleOption<Color>A hairline above and below the band.
whenOption<Mode>

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::style::Outline

pub struct Outline { /* see fields */ }

A stroke around the glyphs (drawn under the fill).

Public fields

fieldtype
colorColor
widthf32Logical px.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::style::Reveal

pub struct Reveal { /* see fields */ }

A per-glyph reveal driven by progress (0..=1).

Public fields

fieldtype
modeRevealMode
progressf32
caretOption<bool>A caret at the reveal front (typewriter shows one unless Some(false)).
flashOption<(f32, f32)>Glyphs that just appeared flash brighter and settle over secs: (glyphs per second, secs). Only for the typewriter mode.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::style::Rule

pub struct Rule { /* see fields */ }

Public fields

fieldtype
selSel
styleStyle
whenOption<Mode>

Methods

  • fn new(sel: Sel, style: Style) -> Rule
  • fn class(c: Class, style: Style) -> Rule
  • fn when(self, m: Mode) -> Rule

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::style::Shimmer

pub struct Shimmer { /* see fields */ }

A sheen sweeping across the glyphs.

Public fields

fieldtype
colorColor
widthf32Width of the band as a fraction of its scope (0.05..=1).
periodf32Seconds per sweep (the sweep then rests for rest seconds).
restf32
anglef32
strengthf320..=1.
scopeScopeLine or Block.
staggerf32Seconds between lines starting their sweep (a cascade); 0 = together.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::style::Spotlight

pub struct Spotlight { /* see fields */ }

Dim everything except a selected range; progress (0..=1) is eased, dim is how far the rest drops.

Public fields

fieldtype
selSel
progressf32
dimf32

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::style::Style

pub struct Style { /* see fields */ }

One layer of decoration. Every field is optional; see [Style::over].

Public fields

fieldtype
fillOption<Fill>
opacityOption<f32>
glowOption<Glow>
outlineOption<Outline>
underlineOption<Line>
strikeOption<Line>
bgOption<Bg>
shimmerOption<Shimmer>
flowOption<f32>A gradient fill that flows: cycles per second of the clock (the gradient repeats back and forth and scrolls).
focusOption<bool>Internal: Some(false) marks text a spotlight dims.

Methods

  • fn is_empty(&self) -> bool
  • fn over(&self, top: &Style) -> Style — self with top laid over it: every field top sets replaces the one here.
  • fn fill(self, f: Fill) -> Style
  • fn color(self, c: Color) -> Style
  • fn glow(self, g: Glow) -> Style
  • fn underline(self, kind: LineKind, color: Option<Color>) -> Style
  • fn bg(self, fill: Fill) -> Style

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::deco::style::Typing

pub struct Typing { /* see fields */ }

A typing treatment driven by the clock: glyphs appear at cps after delay seconds, a caret leads, fresh glyphs flash and settle over flash seconds, and (with band) a soft band follows the caret's line.

Public fields

fieldtype
cpsf32
delayf32
flashf32
bandbool

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::display::TimelineItem

pub struct TimelineItem { /* see fields */ }

One event on a [timeline].

Methods

  • fn new(title: impl AsRef<str>, time: impl AsRef<str>) -> Self
  • fn detail(self, d: impl AsRef<str>) -> Self
  • fn role(self, r: Role) -> Self
  • fn icon(self, i: Icon) -> Self

Trait implementations: Clone

structaster_blueprint::ui::field::Field

pub struct Field { /* see fields */ }

Builder returned by [field]; .build() (or .into() / .child(..)) gives the [El].

Methods

  • fn label(self, label: impl AsRef<str>) -> Self — A caption above the control; it is the control's label.
  • fn hint(self, hint: impl AsRef<str>) -> Self — Helper text under the control, muted; an error replaces it while there is one.
  • fn required(self) -> Self — Mark the field required: a * after the label, "Required" in the control's description, and an error ("Required") once the control was left while its Text or List value is empty. A Bool (a checkbox, a switch) must be true: "I accept the terms". Other kinds of value always pass; use validate for those.
  • fn required_msg(self, msg: impl AsRef<str>) -> Self — required with your own message ("Pick a country").
  • fn validate(self, f: impl Fn(&Store) -> Result<(), String> + 'static) -> Self — A rule over the store (it sees every key, so it can check a stepper, a date or two fields together). Its Err(message) shows under the control, in the danger role, once the control was left (<key>.touched).
  • fn error(self, msg: impl AsRef<str>) -> Self — An error that shows at once, whatever the control holds (a server's answer). It wins over a rule's.
  • fn form(self, form: &Form) -> Self — Register the field's rules (required and validate) with a [Form].
  • fn build(self) -> El — Build the element.

Trait implementations: From<Field>

structaster_blueprint::ui::fluidfx::FluidSpec

pub struct FluidSpec { /* see fields */ }

Everything a fluid element needs; build with the chained modifiers.

let spec = FluidSpec::smoke().ink(Role::Accent).background(Role::Surface).brush(0.05, 30.);

Methods

  • fn new() -> Self — 128 x 72 cells, ink look: swirls that linger, no emitters.
  • fn smoke() -> Self — Smoke: dye rises, fades in about a second, three soft white plumes along the bottom edge.
  • fn ink_pool() -> Self — Ink: slow, glowing colour that stays for a long time. Colour it with [FluidSpec::ink], or give the brush a hue cycle with [FluidSpec::rainbow].
  • fn embers() -> Self — Embers: one scalar dye coloured by the ember ramp, two jets sweeping in from the left.
  • fn config(self, config: FluidConfig) -> Self — Replace the simulation parameters.
  • fn cells(self, cols: usize, rows: usize) -> Self — Grid size in cells (default 128 x 72; the image is stretched over the element).
  • fn cells_for(self, cols: usize, w: f64, h: f64) -> Self — cols cells across and as many rows as keep the cells square in a w x h box (the rows are clamped to 8..=1024), so the simulation does not stretch with the box's aspect.
  • fn style(self, style: FluidStyle) -> Self — Replace the look (exposure, glow, ramp, upscale). background is taken from the theme unless this style sets one and [FluidSpec::background] is not called.
  • fn emitter(self, e: Emitter) -> Self — Add a continuous source.
  • fn emitters(self, list: impl IntoIterator<Item = Emitter>) -> Self
  • fn obstacle(self, o: Obstacle) -> Self — A static solid region (rect or circle, 0..1 coordinates).
  • fn warmup(self, seconds: f32) -> Self — Seconds of simulation to run before the first frame, so an ambient background is not empty when it appears. Default: 1.5 for a fluid with emitters, 0 otherwise.
  • fn pointer(self, p: FluidPointer) -> Self — How the pointer stirs it (default: while dragging).
  • fn brush(self, radius: f32, force: f32) -> Self — Pointer brush: radius in widths and the velocity per width dragged (default 0.045 and 30).
  • fn brush_color(self, c: impl Into<Col>) -> Self — Dye the pointer leaves (a theme colour). Default: the ink, or white.
  • fn rainbow(self) -> Self — The brush hue cycles along the stroke.
  • fn ink(self, c: impl Into<Col>) -> Self — Colour of emitters and brush that did not pick their own (a theme colour).
  • fn background(self, c: impl Into<Col>) -> Self — The colour the dye is added to (a theme colour; default Role::Background, so the fluid blends into the screen). Pass None-like transparency with [FluidSpec::transparent].
  • fn round_clip(self) -> Self — Clip the picture to the element's corner radius (.radius(..) / .round() on the fluid): the picture is resampled to the device pixels of the box and the corners are cut with an antialiased edge. Off by default (the image is the plain rectangle); costs one resample of the box per new frame.
  • fn transparent(self) -> Self — Premultiplied light over whatever is behind the element (no background colour).
  • fn exposure(self, e: f32) -> Self
  • fn glow(self, g: f32) -> Self
  • fn ramp(self, stops: Vec<(f32, [u8; 3])>) -> Self — Colour ramp (position 0..1, sRGB) for the density; see [FluidStyle::ember] / [FluidStyle::ice].
  • fn upscale(self, n: usize) -> Self — Output pixels per cell, 1..=4 (sharper, costs time).

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::fx::Backdrop

pub struct Backdrop { /* see fields */ }

A scene drawn once. Backdrop::new("dusk", || sky_stack()), then backdrop.el() at the bottom of the root overlay and backdrop.glass(panel, Glass::new()) for the panels.

Methods

  • fn new(key: impl AsRef<str>, build: impl Fn() -> El + 'static) -> Backdrop — A backdrop named key (hashed) whose scene build makes. build runs on a miss only: the first frame, a resize, a scale or theme change, or a new key.
  • fn glass_from(self, scene: impl Fn() -> El + 'static) -> Backdrop — Frost the glass from scene instead of from the picture: usually the sky alone, without the light, the grain and the vignette that are laid over it (the glass then looks through to the sky, as .glass(&sky) does). It is rendered at a quarter of the size, the way GlassExt::glass renders its backdrop, so the frosted pictures are those of .glass(&scene, ..) with the scene at rest. Without it the glass frosts a quarter-size copy of the picture.
  • fn sky(self, sky: Sky) -> Backdrop — Give the picture a living sky: [Sky] layers (clouds that drift, an aurora that breathes, grain) composed over it by the clock in small tiles, so that a frame costs the tiles it refreshes and not the screen. Glass still frosts the picture at rest. Opt-in: without it the backdrop is a still, as before. See docs/CINEMATIC.md.
  • fn progressive(self) -> Backdrop — Paint the first frame fast: a soft stand-in (the sky of [Backdrop::glass_from] stretched from its quarter-size render, 40 ms at 1080p, which the glass needs anyway; without one, the scene at a quarter of the size, which costs about as much as the full render) and the full picture replaces it on the next frame (a hitch of the full render's cost). The screen must present that next frame (an animation, a tick or any input does). Opt-in: pixels of the first frame differ (they are soft, and the grain is coarse).
  • fn el(&self) -> El — The full-bleed element that shows the picture (put it first in the root overlay, .cover()ed by default). One image copy per repaint; an unchanged frame is a cache hit.
  • fn glass(&self, panel: El, g: Glass) -> El — Frost panel over this backdrop: a blurred, tinted copy of the picture behind it (like GlassExt::glass), baked once per panel rectangle and parameters, not once per frame.

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::Bloom

pub struct Bloom { /* see fields */ }

Bloom: bright parts of source glow outward. source is the backdrop element (the same one you draw at the bottom of the screen).

Public fields

fieldtype
sourceui::el::El
thresholdf64Luma above which pixels bloom 0..1.
radiusf64Blur radius in logical px.
strengthf64
blendaster_ui::BlendModeAdditive by default: bloom is light added to what is beneath.

Methods

  • fn threshold(self, t: f64) -> Self
  • fn radius(self, r: f64) -> Self
  • fn strength(self, s: f64) -> Self
  • fn blend(self, mode: aster_ui::BlendMode) -> Self — Blend mode of the glow (default Add).
  • fn el(self) -> El

Trait implementations: Clone, Debug, From<Bloom>

structaster_blueprint::ui::fx::Burst

pub struct Burst(..)

What a click throws: a [Particles] system fired at the pointer.

Public fields

fieldtype
0Particles

Methods

  • fn sparks() -> Self
  • fn confetti() -> Self
  • fn pulse() -> Self — A soft ring of dots that expands and fades (a ripple of light).
  • fn seed(self, seed: u64) -> Self
  • fn count(self, n: usize) -> Self
  • fn colors(self, cols: impl IntoIterator<Item = impl Into<Col>>) -> Self
  • fn duration(&self) -> f64 — Longest time any particle of a burst lives, in seconds.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::Camera3d

pub struct Camera3d { /* see fields */ }

Where the scene is looked at from.

Public fields

fieldtype
eyeVec3
targetVec3
upVec3
fovf64Vertical field of view in degrees (perspective).
orthoOption<f64>Some(height): orthographic, height world units tall.
nearf64
farf64

Methods

  • fn perspective(eye: Vec3, target: Vec3, fov: f64) -> Camera3d
  • fn orthographic(eye: Vec3, target: Vec3, height: f64) -> Camera3d
  • fn look_at(self, eye: Vec3, target: Vec3) -> Camera3d
  • fn fov(self, deg: f64) -> Camera3d
  • fn up(self, up: Vec3) -> Camera3d
  • fn clip(self, near: f64, far: f64) -> Camera3d
  • fn matrices(&self, aspect: f64) -> (M4, M4) — The matrices a point goes through: (view, projection) for a picture of aspect (w / h).
  • fn project(&self, p: Vec3, w: f64, h: f64) -> Option<(f64, f64, f64)> — A world point on the screen: (x, y) in 0..w x 0..h pixels (y down) and its depth in view units; None behind the camera.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::Chroma

pub struct Chroma { /* see fields */ }

RGB split.

Public fields

fieldtype
pxf64Split in logical px (at the corners when radial).
degOption<f64>None: radial (grows from the centre); Some(deg): one direction.

Methods

  • fn radial(px: f64) -> Self
  • fn directional(px: f64, deg: f64) -> Self

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::Conic

pub struct Conic { /* see fields */ }

A conic (angular sweep) gradient. conic([..]).spin(30.).el().

Public fields

fieldtype
colsVec<ui::el::Col>
anglef64Start angle in degrees (0 = pointing right, clockwise).
center[f64; 2]Centre as fractions of the box.
spinf64Degrees per second (0 = still).
loopedboolThe sweep wraps back to the first colour (seamless).

Methods

  • fn angle(self, deg: f64) -> Self
  • fn center(self, fx: f64, fy: f64) -> Self
  • fn spin(self, deg_per_s: f64) -> Self
  • fn open(self) -> Self — Do not wrap: the last colour is the end of the sweep.
  • fn el(self) -> El — The gradient as an element that fills its box (.size, .radius, .grow apply).

Trait implementations: Clone, Debug, From<Conic>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::Distort

pub struct Distort { /* see fields */ }

Shockwave, haze and chromatic aberration for .distort(..) / [distort_below].

Public fields

fieldtype
shockOption<Shock>
hazeOption<Haze>
chromaOption<Chroma>
onOption<String>Store counter that fires the shockwave (default: a click on the element).
atOption<[f64; 2]>Fixed ring origin as fractions of the box (default: the pointer when it fired).
seedu64

Methods

  • fn shockwave_on_click() -> Self — A ring from the click point (needs .id() on an element; for an overlay name a counter with .on(..)).
  • fn shockwave() -> Self — The same ring, meant to be fired with [Distort::on].
  • fn haze() -> Self — Heat shimmer.
  • fn underwater() -> Self — Underwater wobble.
  • fn chromatic() -> Self — A static radial RGB split.
  • fn shock(self, s: Shock) -> Self
  • fn haze_with(self, h: Haze) -> Self
  • fn chroma(self, c: Chroma) -> Self
  • fn on(self, key: &str) -> Self — Fire the shockwave when the store counter key changes (instead of on click).
  • fn at(self, fx: f64, fy: f64) -> Self — Always start the ring at these fractions of the box.
  • fn seed(self, seed: u64) -> Self

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::Extrusion3d

pub struct Extrusion3d { /* see fields */ }

A 2D outline pushed into a solid: a path, a polygon or the glyphs of a text.

let logo = Extrusion3d::path(shape_commands).height(2.0).depth(0.5).bevel(0.05);
Object3d::new(logo).material(Material3d::glossy(hex(0xff7a30)))

Methods

  • fn path(cmds: impl IntoIterator<Item = ui::vector::VectorCommand>) -> Extrusion3d — The closed sub-paths of cmds (curves are flattened; sub-paths nest by even-odd, so a counter is a hole). The path's own units are scaled to height tall once .height(..) is given.
  • fn polygon(points: &[[f64; 2]]) -> Extrusion3d — A polygon (counter-clockwise or clockwise; y down like a path).
  • fn text(el: El, w: f64, h: f64) -> Extrusion3d — The glyphs of el (a text element with the font and weight you want; it is drawn white on transparent at w x h logical pixels and its outline is traced). Needs fonts, so it appears only when the scene is drawn by a screen.
  • fn height(self, h: f64) -> Self — World height of the finished outline (default 1).
  • fn depth(self, d: f64) -> Self — Thickness along z (default 0.25).
  • fn bevel(self, b: f64) -> Self — Chamfer on both faces (default 0.02): the bevel is what catches the light on an edge.
  • fn tracking(self, t: f64) -> Self — Extra space between the glyphs of an extruded text, as a fraction of its height (default 0.05): the letters of a tight font touch once they have depth.
  • fn bulge(self, b: f64) -> Self — Lean the face normals outward from the middle (0.3 a gentle dome): a flat face then sweeps its reflection across the studio like polished metal instead of showing one flat colour.
  • fn geometry(self) -> Geometry3d

Trait implementations: Clone, From<Extrusion3d>

structaster_blueprint::ui::fx::Flare

pub struct Flare { /* see fields */ }

Lens flare: lens_flare(Flare::new().follow_pointer()). A hot core, an anamorphic horizontal streak, ghost rings and hexagonal bokeh along the axis through the screen centre; fades as the light nears the screen edge.

Public fields

fieldtype
at[f64; 2]Light position as fractions of the screen.
colorui::el::Col
intensityf64
streakf64
ghostsusize
bokehbool
fade_fromf64Fraction of the way to the edge where the fade starts.
followbool
orbitf64Cycles per second of an animated Lissajous path around at (0 = fixed).
blendaster_ui::BlendMode

Methods

  • fn new() -> Self
  • fn at(self, x: f64, y: f64) -> Self
  • fn color(self, c: impl Into<Col>) -> Self
  • fn intensity(self, v: f64) -> Self
  • fn streak(self, v: f64) -> Self — Length of the horizontal streak 0..=2 (0 = none).
  • fn ghosts(self, n: usize) -> Self — Number of ghosts 0..=7.
  • fn bokeh(self, on: bool) -> Self — Hexagonal bokeh on every other ghost (false: rings only).
  • fn fade_from(self, v: f64) -> Self — Fade begins this far (0..1) from the centre toward the edge.
  • fn follow_pointer(self) -> Self — The light follows the pointer (static at at without one and under reduced motion).
  • fn orbit(self, cps: f64) -> Self — The light drifts on a slow path around at, cps cycles per second (static under reduced motion).
  • fn blend(self, mode: BlendMode) -> Self
  • fn spec(&self, at: [f64; 2], rgb: [u8; 3], alpha: f64, size: [f64; 2]) -> FlareSpec — The spec for a w x h picture with the light at fractions at (edge falloff applied).
  • fn el(self) -> El

Trait implementations: Clone, Copy, Debug, Default, From<Flare>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::Flicker

pub struct Flicker { /* see fields */ }

A looped glitch flicker over finished text: every every seconds a burst of burst seconds shifts slices sideways, splits the colour channels and dims the text.

Public fields

fieldtype
everyf64
burstf64
amountf64

Methods

  • fn new() -> Self
  • fn every(self, secs: f64) -> Self
  • fn burst(self, secs: f64) -> Self
  • fn amount(self, a: f64) -> Self — Displacement and dimming strength, 0..=2.

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::Flow

pub struct Flow { /* see fields */ }

An animated linear gradient whose bands drift and undulate (hero backgrounds, progress shimmer). Looped, so the motion is seamless.

Public fields

fieldtype
colsVec<ui::el::Col>
anglef64Direction in degrees (0 = left to right).
speedf64Scroll speed in cycles per second (0 = still).
warpf64Undulation of the bands 0..1.
stepf64The picture is rebuilt every step seconds (0 = every frame).

Methods

  • fn angle(self, deg: f64) -> Self
  • fn speed(self, cycles_per_s: f64) -> Self
  • fn warp(self, w: f64) -> Self
  • fn step(self, secs: f64) -> Self — Rebuild the picture every secs seconds (default 0.2; 0 = every frame).
  • fn el(self) -> El

Trait implementations: Clone, Debug, From<Flow>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::Fog

pub struct Fog { /* see fields */ }

A fog bank. Build with [Fog::bank] or [Fog::height], turn into an element with [fog].

Methods

  • fn bank() -> Self — A bank of drifting fog that fades out toward the top and bottom of its box.
  • fn height() -> Self — Height fog: thickest at the bottom of its box, thinning upward.
  • fn color(self, c: impl Into<Col>) -> Self — Fog colour (before the scene light tints it).
  • fn density(self, v: f64) -> Self — Peak opacity 0..=1.
  • fn scale(self, px: f64) -> Self — Size of the biggest billows in px.
  • fn drift(self, vx: f64, vy: f64) -> Self — Drift in px per second ((0, 0) bakes once and never changes).
  • fn depth(self, z: f64) -> Self — Depth of the bank in px for the scene's pointer parallax (negative: far, moves less and the other way).
  • fn seed(self, seed: u32) -> Self — Seed of the noise.
  • fn shafts(self, strength: f64) -> Self — Beams of the scene light through the fog, 0..=2 (0, the default, is none). Shadowed behind opaque elements.
  • fn sky(self, backdrop: &El) -> Self — The backdrop alone, for the shafts' occluders ([LightShafts::sky]).
  • fn band(self, top: f64, bottom: f64) -> Self — A bank occupies this band of its box (fractions from the top; default 0.15..0.9).
  • fn rise(self, frac: f64) -> Self — Height fog fills this fraction of its box from the bottom (default 0.5).

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::Fog3d

pub struct Fog3d { /* see fields */ }

Volumetric fog: exponential depth fog, optional height fog, light scattered through the shadow map (god rays), noise.

Public fields

fieldtype
colorui::el::Col
densityf64
height_fallofff64
base_heightf64
scatterf64
anisotropyf64
noiseOption<FogNoise3d>
stepsusize
max_distancef64
ambientf64
motesf64

Methods

  • fn new(density: f64) -> Fog3d — Fog3d of extinction density per world unit (0.02 thin haze, 0.08 thick).
  • fn color(self, c: impl Into<Col>) -> Self
  • fn height(self, falloff: f64, base: f64) -> Self — Thin out above base: density falls by e every 1 / falloff units.
  • fn scatter(self, s: f64) -> Self — Brightness of the scattered light.
  • fn anisotropy(self, g: f64) -> Self — Phase function asymmetry -1..1 (Henyey-Greenstein): above 0 the light piles up when you look toward it.
  • fn noise(self, n: FogNoise3d) -> Self
  • fn steps(self, n: usize) -> Self — Samples per view ray (more is smoother and slower).
  • fn max_distance(self, d: f64) -> Self
  • fn motes(self, k: f64) -> Self — Dust motes that glint where the beams are (0 none, 1 subtle, 3 snowy). They drift with the scene's time.
  • fn ambient(self, a: f64) -> Self — How much the ambient light tints the fog.

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::FogNoise3d

pub struct FogNoise3d { /* see fields */ }

Noise that makes the fog patchy and, with drift, move.

Public fields

fieldtype
scalef64Size of a cloud in world units.
strengthf640..1: how far the density swings around its mean.
driftVec3World units per second the pattern travels.
seedu32

Methods

  • fn new(scale: f64, strength: f64) -> FogNoise3d
  • fn drift(self, d: Vec3) -> Self
  • fn seed(self, s: u32) -> Self

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::FxCtx

pub struct FxCtx<'a> { /* see fields */ }

Everything a layer may look at while it makes its picture.

Public fields

fieldtype
wf64Element size in logical px.
hf64
scalef64Output scale (1.0 or 2.0).
radiusf64Corner radius in logical px.
theme&'a design::Theme
origin[f64; 2]Absolute top-left of the element on screen.
screen[f64; 2]The whole screen in logical px.
elOption<&'a super::el::El>The element the layer is attached to, with its children.
in_belowboolThe picture is being made for an offscreen render of "what is below" a glass panel: layers that would themselves look below answer with a cheap flat stand-in.
fadef64Opacity this layer is shown at (0..=1): the element or an ancestor was faded with .opacity(..). The painter scales the alpha of a [Made::Pix] by it; layers that build a [Made::Rec] themselves (particles) multiply it into their own opacity.

Methods

  • fn dev(&self) -> (u32, u32) — Device pixel size of the element.
  • fn dev_capped(&self, max_px: usize) -> (u32, u32, u32) — Device-pixel size reduced by an integer factor so the picture has at most max_px pixels (smooth content bakes at low resolution and is stretched back bilinearly).
  • fn color(&self, c: impl Into<Col>) -> Srgb8
  • fn render_el(&mut self, el: &El, w: f64, h: f64) -> Option<Pix> — Render an element (not necessarily in the tree) into a picture at the output scale.
  • fn render_in_place(&mut self, el: &El) -> Option<Pix> — Render el (this element, a copy) where it really sits: layers inside see the true screen position. Use for pictures that replace the element (tilt).
  • fn render_below(&mut self, scale: f64) -> Option<Pix> — The screen as painted below this layer's element, at scale (0.25..=8): every panel, picture and text drawn earlier in paint order, without this element, its children or anything above it. None while such a picture is already being made, or without a host.
  • fn render_el_at(&mut self, el: &El, w: f64, h: f64, scale: f64) -> Option<Pix> — Like [FxCtx::render_el] at an explicit scale (0.25..=8): blurred backdrops render small.

structaster_blueprint::ui::fx::Geometry3d

pub struct Geometry3d { /* see fields */ }

What an object is made of.

Methods

  • fn cube(w: f64, h: f64, d: f64) -> Geometry3d — A box w wide, h tall, d deep.
  • fn rounded_box(w: f64, h: f64, d: f64, radius: f64) -> Geometry3d — A box with rounded edges (radius is clamped to half the smallest side).
  • fn sphere(radius: f64) -> Geometry3d
  • fn torus(major: f64, minor: f64) -> Geometry3d — A torus lying flat: ring radius major, tube radius minor.
  • fn cylinder(radius: f64, height: f64) -> Geometry3d — A capped cylinder along y.
  • fn capsule(radius: f64, length: f64) -> Geometry3d — A capsule along y: length is the straight part between the two hemispheres.
  • fn plane(w: f64, d: f64) -> Geometry3d — A flat ground plane facing up, w by d.
  • fn from_mesh(m: Mesh) -> Geometry3d — Any mesh; the scene hash covers every vertex.
  • fn from_obj(bytes: &[u8]) -> Option<Geometry3d> — A Wavefront OBJ file (v, vn, f; polygons are fanned). None when it has no face.
  • fn mesh_ref(&self) -> Option<&Mesh> — The mesh behind a geometry (None for text, which exists once the scene is drawn).

Trait implementations: Clone, From<Extrusion3d>, From<Mesh>

structaster_blueprint::ui::fx::Glass

pub struct Glass { /* see fields */ }

How the glass looks.

Public fields

fieldtype
blurf64Blur sigma in logical px.
tintui::el::ColTint colour and how strongly it covers 0..1.
tint_alphaf64
saturationf64Saturation of the backdrop (1 = unchanged, 1.4 = vivid).
brightnessf64Brightness multiplier of the backdrop.
edgef64Strength of the 1 px top-left edge highlight 0..1.

Methods

  • fn new() -> Self
  • fn blur(self, sigma: f64) -> Self
  • fn tint(self, c: impl Into<Col>, alpha: f64) -> Self
  • fn saturation(self, s: f64) -> Self
  • fn brightness(self, b: f64) -> Self
  • fn edge(self, e: f64) -> Self

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::Glitch

pub struct Glitch { /* see fields */ }

Seeded slice offsets, RGB split and block corruption.

Public fields

fieldtype
seedu64
slicesu32Horizontal slices at full strength.
shiftf64Largest slice offset in logical px.
rgbf64RGB split in logical px.
blocksu32Corrupted blocks at full strength.
ratef64Glitch pictures per second.
durationf64Seconds a burst or a flicker lasts.
everyf64Mean seconds between ambient flickers (0 = none).
burstboolFires on a click / counter.
strengthf64
onOption<String>

Methods

  • fn burst() -> Self — A glitch burst on every click of the element (or .on(key)).
  • fn ambient() -> Self — An occasional ambient flicker, no trigger needed.
  • fn seed(self, seed: u64) -> Self
  • fn slices(self, n: u32) -> Self
  • fn shift(self, px: f64) -> Self
  • fn rgb(self, px: f64) -> Self
  • fn blocks(self, n: u32) -> Self
  • fn rate(self, fps: f64) -> Self
  • fn duration(self, seconds: f64) -> Self
  • fn every(self, seconds: f64) -> Self — Also flicker on its own about every seconds.
  • fn strength(self, s: f64) -> Self
  • fn on(self, key: &str) -> Self — Fire when the store counter key changes (instead of on click).

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::Haze

pub struct Haze { /* see fields */ }

Noise-driven displacement.

Public fields

fieldtype
ampf64Peak displacement in logical px.
scalef64Feature size in logical px.
speedf64Noise time per second.
heatboolHeat shimmer: mostly sideways, rising, strongest toward the bottom. Otherwise a slow wobble in both axes.

Methods

  • fn heat() -> Self
  • fn water() -> Self
  • fn amp(self, px: f64) -> Self
  • fn scale(self, px: f64) -> Self
  • fn speed(self, s: f64) -> Self

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::Hologram

pub struct Hologram { /* see fields */ }

Scanlines, flicker and a slight barrel curve.

Public fields

fieldtype
curvef64Barrel curve (0 = flat, 0.06 = a CRT).
scanf64Scanline darkness 0..1 and spacing in logical px.
spacingf64
flickerf64Brightness flicker 0..1.
rollf64Rolling bright bar, screens per second (0 = none).
tintui::el::Col
tint_amountf64How much of the picture's luma is recoloured toward the tint 0..1.
chromaf64RGB split in logical px at the corners.
vignettef64Corner darkening 0..1.
seedu64

Methods

  • fn new() -> Self
  • fn curve(self, k: f64) -> Self
  • fn scanlines(self, darkness: f64, spacing_px: f64) -> Self
  • fn flicker(self, f: f64) -> Self
  • fn roll(self, screens_per_s: f64) -> Self
  • fn tint(self, c: impl Into<Col>, amount: f64) -> Self
  • fn chroma(self, px: f64) -> Self
  • fn vignette(self, v: f64) -> Self
  • fn seed(self, seed: u64) -> Self

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::Kinetic

pub struct Kinetic { /* see fields */ }

A kinetic reveal. Start from [Kinetic::decode], [Kinetic::typewriter] or [Kinetic::stagger] and chain.

Public fields

fieldtype
modeMode
orderReveal
seedu64
durationf64Seconds from the first to the last glyph settling.
cpsOption<f64>Typewriter speed in glyphs per second (overrides duration).
delayf64Seconds to wait before starting.
glyphsGlyphs
caretbool
glowOption<ui::el::Col>Colour of the glow trail on newly revealed glyphs (None: no glow).
glow_secsf64
accentui::el::ColColour of scramble glyphs and freshly revealed ones; they cool into the text colour.
flickerOption<Flicker>
exitboolPlay in reverse: the text is shown, then leaves.
holdOption<f64>Reveal, stay for this long, then leave (one shot).
replayOption<String>Play again whenever this store counter changes.
tick_hzf64Scramble glyphs change this many times a second.

Methods

  • fn decode() -> Self — Random glyphs settle into the text.
  • fn typewriter() -> Self — One glyph at a time (.caret() adds a blinking caret, .cps(..) sets the speed).
  • fn stagger() -> Self — Glyphs fade, slide and scale in on a spring with overshoot.
  • fn seed(self, seed: u64) -> Self
  • fn duration(self, secs: f64) -> Self
  • fn cps(self, glyphs_per_sec: f64) -> Self
  • fn delay(self, secs: f64) -> Self
  • fn order(self, o: Reveal) -> Self
  • fn glyphs(self, g: Glyphs) -> Self
  • fn caret(self) -> Self — A blinking caret after the last typed glyph (typewriter), lingering about a second at the end.
  • fn glow(self, c: impl Into<Col>) -> Self — A glow trail on glyphs as they land, fading over glow_secs.
  • fn glow_secs(self, secs: f64) -> Self
  • fn accent(self, c: impl Into<Col>) -> Self
  • fn tick_hz(self, hz: f64) -> Self — How many times a second scramble glyphs change (default 30).
  • fn flicker(self, f: Flicker) -> Self — Looped glitch flicker once the text is on screen.
  • fn exit(self) -> Self — The exit reveal: the text is shown, then decodes/types/staggers away.
  • fn hold(self, secs: f64) -> Self — Reveal, hold secs, then play out. Under reduced motion the text stays.
  • fn replay_on(self, key: impl AsRef<str>) -> Self — Restart whenever the store counter key changes (Action::inc(key, 1)).
  • fn total(&self, n: usize) -> f64 — Seconds from the start to the last pixel of the reveal changing: duration plus the pop, cooling and glow tails (for a text of n glyphs; a typewriter's cps sets the duration).

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::Layer

pub struct Layer { /* see fields */ }

A pixel layer attached to an element (see [El::fx_layer]).

Methods

  • fn new(key: u64, slot: Slot, cache: Cache, make: impl Fn(&mut FxCtx<'_>) -> Option<Made> + 'static) -> Layer — key must change whenever the picture would: hash every parameter the closure reads.
  • fn known_colors(self, lo: Srgb8, hi: Srgb8) -> Self — The opaque picture stays between these two colours: the contrast audit measures text over it against both.
  • fn cosmetic(self) -> Self — A faint accent the contrast audit leaves out (rim, inner shadow, grain, shadow outside the shape).
  • fn positional(self) -> Self
  • fn content_keyed(self) -> Self — The picture depends on the element's subtree: key the cache on it too.
  • fn below(self) -> Self — The picture is made from what the screen painted before this element ([FxCtx::render_below]).
  • fn aligned(self) -> Self — Bake per sub-pixel position and draw as ink-cropped tiles: for borders and rims, whose damage should be the ring, not the box.
  • fn blended(self, mode: aster_ui::BlendMode) -> Self — Draw the picture with mode (Add for light). The mode is folded into the cache key.
  • fn label(self, label: &'static str) -> Self — Name shown in the frame profile (ui::prof).
  • fn clipped(self) -> Self — Clip the picture to the element's corner radius.
  • fn key(&self) -> u64
  • fn cache(&self) -> Cache — How the picture is cached across frames.
  • fn bake(&self, ctx: &mut FxCtx<'_>) -> Option<Made> — Make the picture for the element in ctx (None: draw the element normally).

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::Light3d

pub struct Light3d { /* see fields */ }

A light: directional (a sun, with shadows), point or spot.

Public fields

fieldtype
colorui::el::Col
intensityf64
shadowbool
softnessf64
rangef64
fogf64
specularf64

Methods

  • fn directional(from: Vec3) -> Light3d — A sun shining from the direction from (a vector pointing at the light from the scene's centre). Casts shadows.
  • fn point(pos: Vec3) -> Light3d — A point light at pos; intensity is the radiant power seen at one unit.
  • fn spot(pos: Vec3, target: Vec3, inner_deg: f64, outer_deg: f64) -> Light3d — A spot light at pos aimed at target, full inside inner_deg and gone at outer_deg from the axis.
  • fn color(self, c: impl Into<Col>) -> Self
  • fn intensity(self, i: f64) -> Self
  • fn shadows(self, on: bool) -> Self — Shadow map on or off (directional lights only).
  • fn softness(self, s: f64) -> Self — Angular radius of the light as a tangent: how fast the shadow softens away from the contact (0.02 sharp, 0.12 very soft).
  • fn range(self, r: f64) -> Self — Distance at which a point or spot light is gone.
  • fn specular(self, k: f64) -> Self — Strength of this light's specular highlights (0 = diffuse only).
  • fn fog_scatter(self, k: f64) -> Self — How much of this light the fog scatters (0 hides it from the fog).

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::LightLeak

pub struct LightLeak { /* see fields */ }

A warm wash bleeding in from a screen edge or corner, like light leaking into a lens.

Public fields

fieldtype
colorui::el::Col
at[f64; 2]Where it enters, as fractions of the box (0, 0 = top-left corner).
sizef64Reach as a fraction of the box diagonal.
strengthf64
breathef64Slow breathing in cycles per second (0 = still).
blendaster_ui::BlendModeAdditive by default: the leak lights what it covers instead of tinting it.

Methods

  • fn size(self, s: f64) -> Self
  • fn strength(self, s: f64) -> Self
  • fn blend(self, mode: aster_ui::BlendMode) -> Self — Blend mode of the wash (default Add; SourceOver tints instead of lighting).
  • fn breathe(self, cycles_per_s: f64) -> Self
  • fn el(self) -> El

Trait implementations: Clone, Copy, Debug, From<LightLeak>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::LightShafts

pub struct LightShafts { /* see fields */ }

Volumetric light shafts: light_shafts(LightShafts::from(0.7, 0.2).color(..)). Put it last in the root overlay (it sees everything painted before it).

Public fields

fieldtype
colorui::el::Col
intensityf64
densityf64
decayf64
reachf64Reach as a fraction of the screen diagonal.
raysf64
shimmerf64
coref64
followbool
skyOption<ui::el::El>
qualityf64
blendaster_ui::BlendModeAdditive by default: the shafts light what they cross.
directionOption<f64>The direction of the rays in degrees (0 = right, 90 = down): None radiates from the light (a sunburst), a direction makes the rays travel in parallel.
spreadf64The width of the ray fan in degrees (0 = parallel rays; the rays fan out within half of it).

Methods

  • fn from(x: f64, y: f64) -> Self — A point light at fractions (x, y) of the screen (0, 0 = top-left; may lie outside).
  • fn element(el: &El) -> Self — The light is el (a bright shape in a screen-sized box, e.g. a sun disc or a window); rays stream from its brightness.
  • fn from_el(el: &El) -> Self — The light is el: the rays stream from its brightness. Same as [LightShafts::element].
  • fn resting_at(&self) -> [f64; 2] — Where the light rests: fractions of the screen (an element light is found by its shape).
  • fn color(self, c: impl Into<Col>) -> Self
  • fn intensity(self, v: f64) -> Self
  • fn density(self, v: f64) -> Self — How dark occluders make the rays behind them 0..=2.
  • fn decay(self, v: f64) -> Self — 0.9..1: lower weighs occluders near the lit pixel more (short, local shadows).
  • fn reach(self, v: f64) -> Self
  • fn rays(self, v: f64) -> Self — Contrast of the angular streaks 0..1.
  • fn shimmer(self, rate: f64) -> Self — Slow noise shimmer in ray cells per second (0 = still: a static light is a cache hit).
  • fn core(self, v: f64) -> Self
  • fn follow_pointer(self) -> Self — The light follows the pointer (a point light moves to it, an element is carried along); without a pointer, or under reduced motion, it rests at its own place.
  • fn sky(self, backdrop: &El) -> Self — The backdrop alone (the full-bleed background, as for GlassExt::glass): whatever differs from it counts as an occluder. Without it the screen's border colour is the sky.
  • fn quality(self, lo: f64) -> Self — Working resolution as a fraction of the screen (0.25..=0.5; default 0.25).
  • fn blend(self, mode: BlendMode) -> Self
  • fn direction(self, angle_deg: f64) -> Self — The rays leave the light in this direction (degrees: 0 = right, 90 = down) and travel in parallel: a window casts a beam instead of a sunburst, and the occluders cast parallel shadows. Without a direction the light radiates as before.
  • fn spread(self, deg: f64) -> Self — The rays fan out within half this angle (degrees) of the direction (0 = parallel rays, up to 180: a half-plane).
  • fn directional(self, angle_deg: f64, spread_deg: f64) -> Self — The rays leave the light in this direction (degrees) and fan out within it.
  • fn el(self) -> El

Trait implementations: Clone, Debug, From<LightShafts>

structaster_blueprint::ui::fx::Material3d

pub struct Material3d { /* see fields */ }

PBR-lite material: base colour, roughness, metalness, emissive, rim.

Public fields

fieldtype
baseui::el::Col
roughf64
metalf64
emissiveOption<(ui::el::Col, f64)>
rimf64
rim_colorOption<ui::el::Col>
double_sidedbool
receive_shadowbool
patternPattern3d
fadeOption<(f64, f64)>
reflectf64
coatf64
catcherf64
reflect_reachf64
glassf64
refractionf64
frostf64
thicknessf64
causticsf64

Methods

  • fn new(base: impl Into<Col>) -> Material3d
  • fn accent() -> Material3d — The theme's accent colour, satin.
  • fn glossy(base: impl Into<Col>) -> Material3d — Glossy with a clear coat: lacquered plastic or car paint.
  • fn matte(base: impl Into<Col>) -> Material3d
  • fn metal(base: impl Into<Col>) -> Material3d
  • fn emissive(color: impl Into<Col>, strength: f64) -> Material3d — A light source's body: shows color at strength regardless of lighting.
  • fn glass(tint: impl Into<Col>, radius: f64) -> Material3d — Transmissive glass tinted by tint (white is clear): the view through it is the rest of the scene and, when the scene has [Scene3d::refract_ui], the page beneath, bent by the surface normal like a lens, with a little chromatic spread, a Fresnel reflection of the studio and absorption that deepens toward the rim. radius is the body's size in world units (it scales the bend).
  • fn refraction(self, k: f64) -> Self — How strongly glass bends the view (default 1.6, a ball lens that inverts the view; 0 is a flat pane).
  • fn frosted(self, k: f64) -> Self — Frosted glass: blur the view through it by k (0 clear, 1 milky).
  • fn caustics(self, k: f64) -> Self — Show the bright caustic spot that glass bodies focus into their shadow on this surface (floors and shadow catchers).
  • fn shadow_catcher(strength: f64) -> Material3d — An invisible plane that only shows what the scene does to it: the shadows and contact darkening of the objects and their mirror image (reflect), composited over whatever is beneath the picture (a card, a page). strength is how dark a full shadow is.
  • fn floor() -> Material3d — A floor that takes its look from the theme: a slightly raised surface, rough, fading out at the edge, with a mirror sheen.
  • fn roughness(self, r: f64) -> Self
  • fn metallic(self, m: f64) -> Self
  • fn emission(self, color: impl Into<Col>, strength: f64) -> Self
  • fn rim(self, strength: f64, color: impl Into<Col>) -> Self — Fresnel rim light of strength (tinted by color, default the base colour brightened).
  • fn double_sided(self) -> Self
  • fn no_shadow_receive(self) -> Self
  • fn pattern(self, p: Pattern3d) -> Self
  • fn fade(self, inner: f64, outer: f64) -> Self — Fade the surface out radially (world units from the object's origin): a floor that dissolves into the page.
  • fn reflect(self, k: f64) -> Self — Show the scene's mirror image on this surface (a floor): 0..1.
  • fn reflect_reach(self, h: f64) -> Self — The mirror image fades out within h world units of height above the surface (default: a smooth exponential).
  • fn coat(self, k: f64) -> Self — A thin gloss layer over the base: reflections of the studio on top of the colour.

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::Mesh

pub struct Mesh { /* see fields */ }

A mesh (multi-point) gradient: colour blobs blended smoothly, optionally drifting.

Public fields

fieldtype
pointsVec<(f64, f64, ui::el::Col)>(x, y, colour) with x, y as fractions of the box.
sharpnessf64Falloff sharpness (1 = very soft, 4 = distinct blobs).
driftf64Orbit radius of each point as a fraction of the box (0 = still).
speedf64Orbit speed in turns per second.
stepf64The picture is rebuilt every step seconds (0 = every frame).

Methods

  • fn sharpness(self, s: f64) -> Self
  • fn step(self, secs: f64) -> Self — Rebuild the picture every secs seconds (default 0.2; 0 = every frame).
  • fn drift(self, radius: f64, speed: f64) -> Self — Each point wanders on a small loop of radius (box fraction) at speed turns/s.
  • fn el(self) -> El

Trait implementations: Clone, Debug, From<Mesh>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::Object3d

pub struct Object3d { /* see fields */ }

A geometry with a transform and a material. Transform calls compose in reading order: the first one is applied to the object first, so .rotate_y(30).at(1, 0, 0) rotates in place and then moves, while .at(..).rotate_y(30) orbits.

Methods

  • fn new(geom: impl Into<Geometry3d>) -> Object3d
  • fn material(self, m: Material3d) -> Self
  • fn at(self, x: f64, y: f64, z: f64) -> Self — Move to (x, y, z).
  • fn rotate_x(self, deg: f64) -> Self
  • fn rotate_y(self, deg: f64) -> Self
  • fn rotate_z(self, deg: f64) -> Self
  • fn scale(self, s: f64) -> Self
  • fn scale_xyz(self, x: f64, y: f64, z: f64) -> Self
  • fn spin(self, deg_per_s: f64) -> Self — Turn about the object's own up axis at deg_per_s (an animated scene; a still frame shows the angle at its time).
  • fn casts_shadow(self, on: bool) -> Self — Whether the object throws shadows (default yes).
  • fn occludes(self, on: bool) -> Self — Whether the object darkens the ambient light around it (contact shadow; default yes).
  • fn reflected(self, on: bool) -> Self — Whether the object shows in a floor's reflection (default yes).
  • fn ground(size: f64, y: f64) -> Object3d — A ground plane: size square, takes the theme's floor material, throws no shadow and darkens nothing.

Trait implementations: Clone

structaster_blueprint::ui::fx::Parallax

pub struct Parallax { /* see fields */ }

Layers that shift with the pointer (and optionally a scroll position) at different rates.

Methods

  • fn layer(self, el: El, depth: f64) -> Self
  • fn amount(self, px: f64) -> Self — Largest pointer shift in px at depth 1.
  • fn scroll(self, key: &str, rate: f64) -> Self — Also shift vertically with the store scalar key (a scroll offset in px) at rate * depth px per px (use .offset or <scroll id>.top).
  • fn el(self) -> El

Trait implementations: Clone, Debug, From<Parallax>

structaster_blueprint::ui::fx::Particles

pub struct Particles { /* see fields */ }

A particle system description. Build with a preset and chain the knobs.

Public fields

fieldtype
seedu64
countusize
emitterEmitter
life(f64, f64)Lifetime range in seconds.
speed(f64, f64)Launch speed range in px/s.
dir(f64, f64)Launch direction: centre and spread in degrees (0 = right, -90 = up).
gravity[f64; 2]Constant acceleration in px/s^2 (positive y = down).
dragf64Linear drag per second.
swirlf64Swirl sway amplitude in px (a curl-like wander around the ballistic path).
size(f64, f64)Diameter in px at birth and at death.
size_jitterf64Per-particle size variation 0..1.
colorsVec<ui::el::Col>Colour over life.
opacityf64Peak opacity 0..1.
fade(f64, f64)Fractions of life spent fading in and out.
twinklef64Twinkle depth 0..1 (stars).
hotf64Whitening of the core 0..1.
halof64Extra large faint halo 0..1.
hardf64Edge hardness of dots 0..1.
trailusizeTrailing copies behind the head (sparks), each fainter.
shapeShape
stepf64Ambient fields redraw every step seconds (0 = every frame). Slow drifts look the same at 20 fps and cost a third; staggered by seed so fields do not all redraw on one frame.
by_particleboolEach particle takes one of the colors for its whole life instead of cooling through them (confetti).
blendaster_ui::BlendModeHow the sprites combine with what is beneath: Add makes sparks, embers and star halos light up their surroundings (the presets that glow choose it); SourceOver is ordinary paint.

Methods

  • fn dust() -> Self — Slow, tiny motes drifting upward through the light.
  • fn stars() -> Self — Fixed stars that twinkle.
  • fn embers() -> Self — Glowing embers rising from the bottom edge and cooling from yellow to red.
  • fn sparks() -> Self — A quick radial spray with trails; meant for [Burst].
  • fn confetti() -> Self — Tumbling confetti falling from a burst point.
  • fn seed(self, seed: u64) -> Self
  • fn count(self, n: usize) -> Self
  • fn emitter(self, e: Emitter) -> Self
  • fn life(self, min: f64, max: f64) -> Self
  • fn speed(self, min: f64, max: f64) -> Self
  • fn dir(self, centre_deg: f64, spread_deg: f64) -> Self
  • fn gravity(self, gx: f64, gy: f64) -> Self
  • fn drag(self, k: f64) -> Self
  • fn swirl(self, px: f64) -> Self
  • fn size(self, start: f64, end: f64) -> Self
  • fn colors(self, cols: impl IntoIterator<Item = impl Into<Col>>) -> Self — Colours over life (one colour is flat; several cool from the first to the last).
  • fn opacity(self, a: f64) -> Self
  • fn twinkle(self, depth: f64) -> Self
  • fn blend(self, mode: aster_ui::BlendMode) -> Self — Combine the sprites with what is beneath using mode (the glowing presets use Add).
  • fn halo(self, h: f64) -> Self
  • fn palette(self) -> Self — Each particle keeps one colour of colors for life instead of cooling through them.
  • fn step(self, secs: f64) -> Self — Redraw every secs seconds (0 = every frame).
  • fn trail(self, n: usize) -> Self
  • fn key(&self) -> u64 — Hash of every field: the layer cache key.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::Pix

pub struct Pix { /* see fields */ }

An RGBA8 picture, straight (non-premultiplied) alpha, origin top-left.

Public fields

fieldtype
wu32
hu32
rgbaVec<u8>

Methods

  • fn new(w: u32, h: u32) -> Pix — A fully transparent picture.
  • fn from_rgba(w: u32, h: u32, rgba: Vec<u8>) -> Option<Pix>
  • fn get(&self, x: u32, y: u32) -> [u8; 4]
  • fn put(&mut self, x: u32, y: u32, c: [u8; 4])
  • fn round_corners(&mut self, radius: f64) — Multiply alpha by the coverage of a rounded rectangle of radius (device px), antialiased over one pixel: the picture takes the corner shape of the element it fills.
  • fn scale_alpha(&mut self, f: f64) — Multiply every alpha by f (0..=1).
  • fn upscale(&self, w: u32, h: u32) -> Pix — Bilinear resample to w x h (alpha-weighted, so a soft edge does not fringe). This is how smooth layers bake small and still reach the screen at device resolution cheaply: two separable passes, fixed point for opaque pictures.
  • fn to_recording(&self, x: f64, y: f64, scale: f64) -> Result<Arc<Recording>, Error> — Draw the picture 1:1 in device pixels (nearest sampling, straight alpha: the renderer's bulk-copy path) with its top-left at logical (x, y) inside the node, as one image command. scale is the output scale the picture was made for.
  • fn to_recording_blended(&self, x: f64, y: f64, scale: f64, mode: aster_ui::BlendMode) -> Result<Arc<Recording>, Error> — [Pix::to_recording] drawn with mode (an additive glow picture, say).
  • fn to_tiled_recording(&self, x: f64, y: f64, scale: f64) -> Result<Arc<Recording>, Error> — Like [Pix::to_recording], but as a grid of tiles cropped to their ink, with identical tiles shared.
  • fn to_tiled_recording_blended(&self, x: f64, y: f64, scale: f64, mode: aster_ui::BlendMode) -> Result<Arc<Recording>, Error> — [Pix::to_tiled_recording] drawn with mode (transparent tiles add nothing, so the result matches the single image).
  • fn to_image(&self) -> Result<ImageResource, Error> — The picture as an immutable straight-alpha image resource.

Trait implementations: Clone, Debug, Eq, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::PointLight

pub struct PointLight { /* see fields */ }

A glowing element's light (see [DepthExt::casts_light]).

Methods

  • fn new() -> Self
  • fn color(self, c: impl Into<Col>) -> Self — Light colour (alpha scales the intensity).
  • fn intensity(self, v: f64) -> Self — Strength 0..=2.
  • fn radius(self, px: f64) -> Self — Reach in px: the light falls off to nothing at this distance from the element's centre.
  • fn quality(self, q: f64) -> Self — Working resolution 0.15..=0.5 of the screen (lower is cheaper and softer).
  • fn sky(self, backdrop: &El) -> Self — The scene without any element on top of it: whatever differs from it blocks the light (default: guessed from the colour of the screen border, which suits a flat background).

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::fx::Post

pub struct Post { /* see fields */ }

A post-processing stack. Post::new() does nothing; add effects with the builder methods, or start from [Post::film] / [Post::for_theme].

Public fields

fieldtype
bloomOption<PostBloom>
halationOption<Halation>
streaksOption<Streaks>
dirtf32Lens dirt 0..=1: the bloom and streaks light up a procedural smudge texture.
gradeOption<super::post_color::Grade>
lutOption<std::sync::Arc<super::post_color::Lut3>>
vignetteOption<Vignette>
chromaf32Chromatic aberration: the red/blue offset at the corners, logical px.
distortionf32Barrel distortion -1..1 (corners fixed).
grainOption<Grain>
ditherbool
sharpenf32CAS sharpening 0..=1.
dofOption<Dof>
motionOption<MotionBlur>
autoboolResolve to the default preset of the theme the screen uses when built (see [Post::for_theme]).

Methods

  • fn new() -> Post — Nothing: [Post::apply] returns the picture unchanged.
  • fn auto() -> Post — The default preset of whatever theme the screen is drawn with, chosen when the element is built.
  • fn bloom(self, v: impl Into<Option<PostBloom>>) -> Self
  • fn halation(self, v: impl Into<Option<Halation>>) -> Self
  • fn streaks(self, v: impl Into<Option<Streaks>>) -> Self
  • fn grade(self, v: impl Into<Option<Grade>>) -> Self
  • fn vignette(self, v: impl Into<Option<Vignette>>) -> Self
  • fn grain(self, v: impl Into<Option<Grain>>) -> Self
  • fn dof(self, v: impl Into<Option<Dof>>) -> Self
  • fn motion(self, v: impl Into<Option<MotionBlur>>) -> Self
  • fn dirt(self, v: f64) -> Self
  • fn chroma(self, px: f64) -> Self
  • fn distortion(self, k: f64) -> Self
  • fn dither(self, on: bool) -> Self
  • fn sharpen(self, s: f64) -> Self
  • fn lut(self, lut: impl Into<Option<Arc<Lut3>>>) -> Self — A 3D LUT applied after the grade.
  • fn look(self, look: Look) -> Self — A built-in look as the LUT.
  • fn cube(self, bytes: &[u8]) -> Result<Self, LutError> — A .cube file as the LUT.
  • fn tone(self, tone: Tone, exposure_stops: f64) -> Self — The tone curve and exposure (stops) of the grade.
  • fn white_balance(self, temperature: f64, tint: f64) -> Self
  • fn saturation(self, s: f64) -> Self
  • fn contrast(self, c: f64) -> Self
  • fn split_tone(self, shadows: [f32; 3], s_amount: f64, highlights: [f32; 3], h_amount: f64) -> Self — Split toning: shadows and highlights tinted (sRGB colours) by amount each.
  • fn without(self, effect: &str) -> Self — Turn an effect off by name: bloom, halation, streaks, dirt, grade, lut, vignette, chroma, distortion, grain, dither, sharpen, dof, motion.
  • fn effects(&self) -> Vec<&'static str> — The names of the effects that are on.
  • fn is_identity(&self) -> bool — True when [Post::apply] leaves every byte alone.
  • fn key(&self) -> u64 — A hash of every parameter.
  • fn film() -> Post — The house look for a dark UI: a gentle filmic shoulder with a touch of contrast, teal shadows and warm highlights, a soft bloom on emissive things, a little halation, a vignette, static grain, blue-noise dithering and light sharpening.
  • fn film_light() -> Post — The default for a light theme: no bloom (a white page would glow), a lighter vignette, warm grade.
  • fn for_theme(theme: &Theme) -> Post — The default preset of a theme. High-contrast themes (promise of 7:1 text) get nothing; only dithering would not change their flat colours, so they get a plain identity.
  • fn blockbuster() -> Post — The Teal & Orange look on top of [Post::film].
  • fn apply(&self, w: u32, h: u32, rgba: &[u8], env: &PostEnv) -> Vec<u8> — Run the pipeline on an RGBA8 picture (straight alpha, w x h). A picture that is not [Post::is_identity] is returned changed; an identity returns the same bytes.
  • fn apply_pix(&self, src: Pix, env: &PostEnv) -> Pix
  • fn apply_owned(&self, w: u32, h: u32, rgba: Vec<u8>, env: &PostEnv) -> Vec<u8>

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::PostEnv

pub struct PostEnv { /* see fields */ }

What the pipeline needs beyond the picture and the parameters.

Public fields

fieldtype
scalef32Device pixels per logical pixel.
frameu32Grain frame (0 = the still pattern). Only used when the grain animates.
reduced_motionbool
focusOption<[f32; 4]>Focus rectangle in device px of the picture.
motionVec<([f32; 4], [f32; 2])>Motion boxes in device px of the picture, with device px per frame.
depthVec<([f32; 4], f32)>Element depths in device px of the picture, nearest last: [x, y, w, h] and z (the depth registry, for Focus::Z).

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::Scene3d

pub struct Scene3d { /* see fields */ }

A scene: camera, objects, lights, environment, fog and finishing. Build it, then scene3d(scene).

Methods

  • fn new() -> Scene3d — An empty scene: a camera 6 units back looking at the origin, no lights (add some, or use [Scene3d::studio]).
  • fn studio() -> Scene3d — A product-shot studio that takes its colours from the theme: a warm shadow-casting key light, a cool fill, an accent-tinted rim light from behind, and a sky with two softboxes for the reflections. Add objects and a camera.
  • fn camera(self, c: Camera3d) -> Self
  • fn object(self, o: Object3d) -> Self
  • fn objects(self, os: impl IntoIterator<Item = Object3d>) -> Self
  • fn light(self, l: Light3d) -> Self
  • fn clear_lights(self) -> Self — Drop the studio's lights (and softboxes) and start from yours.
  • fn sky(self, top: impl Into<Col>, horizon: impl Into<Col>, ground: impl Into<Col>) -> Self — Sky gradient (zenith, horizon) and the ground colour bounced back up: the hemisphere light and what glossy surfaces reflect.
  • fn softbox(self, from: Vec3, w_deg: f64, h_deg: f64, color: impl Into<Col>, intensity: f64) -> Self — A softbox (a bright rectangle in the sky) that glossy surfaces reflect: it lights nothing but their highlights.
  • fn ambient(self, k: f64) -> Self — Strength of the ambient (hemisphere and reflection) light.
  • fn occlusion(self, k: f64) -> Self — Contact darkening from the objects' bulk (0 off, 1 strong).
  • fn fog(self, f: Fog3d) -> Self
  • fn backdrop(self, b: Backdrop3d) -> Self
  • fn exposure(self, e: f64) -> Self — Exposure multiplier before tone mapping.
  • fn bloom(self, k: f64) -> Self — A soft glow around the brightest parts.
  • fn feather(self, f: f64) -> Self — Fade the picture's alpha to nothing over this fraction (0..0.5) of its size at the edges, so fog and glow composite into the page without a visible box.
  • fn quality(self, q: Quality3d) -> Self
  • fn at_time(self, t: f64) -> Self — The scene's time in seconds for spins, orbits and fog drift (a still frame; an animated element adds the screen's clock).
  • fn orbit(self, deg_per_s: f64) -> Self — Orbit the camera around its target about the up axis at deg_per_s.
  • fn fps(self, fps: f64) -> Self — Frame rate of an animated scene (default 12, at most 60): a new picture per tick, never more.
  • fn animation_pixels(self, px: usize) -> Self — Largest picture (pixels) an animated scene renders; the painter stretches it to the element (default 160 000).
  • fn aspect(self, a: f64) -> Self — Width / height the element takes when only one side is sized (default 1.6).
  • fn refract_ui(self, on: bool) -> Self — Let glass look through to the page beneath the picture (cards, text, images painted earlier): the element then reads the screen below it, as glass_below does, and re-renders when that changes. Without it glass sees the scene and its backdrop only.
  • fn pointer_orbit(self, id: impl Into<String>, yaw_deg: f64, pitch_deg: f64) -> Self — Make the scene interactive: the camera orbits its target as the pointer moves over the element called id (yaw_deg left and right, pitch_deg up and down at the edges). While the camera moves the scene renders cheaply (a third of the resolution, one sample per pixel, coarse shadows and fog, upscaled by the renderer); about 150 ms after it settles it refines to half resolution and then to full quality, and the settled frame is byte-identical to a still render at that camera.
  • fn live_cell(self, n: usize) -> Self — Size in pixels (2..=4, default 3) of the cells an interactive frame shades once per surface: bigger is faster and softer inside surfaces (edges stay crisp).
  • fn progressive(self, on: bool) -> Self — false turns the cheap moving frames off (every frame at full quality: the measuring baseline).
  • fn alt(self, text: impl Into<String>) -> Self — Name the picture for assistive tech. Without it the scene is decorative.
  • fn is_animated(&self) -> bool — Whether anything in the scene changes with time.
  • fn key(&self) -> u64 — Hash of everything that decides the picture (at the scene's own time).
  • fn render(&self, th: &Theme, w: u32, h: u32) -> Pix — Render without a screen: w x h pixels of straight-alpha RGBA8 at the scene's own time. Extruded text is skipped (it needs a screen's fonts).
  • fn render_live_preview(&self, th: &Theme, w: u32, h: u32, div: usize) -> Pix — An interactive frame (see [Scene3d::pointer_orbit]) rendered without a screen: full-resolution visibility, shading once per surface per div x div cell (2..=4), the cheap shadow, reflection and fog paths.
  • fn render_live_lowres(&self, th: &Theme, w: u32, h: u32) -> Pix — An interactive frame the way the first version drew it: the whole scene at w x h with the cheap paths (for comparison; stretch it over the element yourself).
  • fn render_hdr(&self, th: &Theme, w: u32, h: u32) -> Vec<[f32; 4]> — The same render as a linear HDR buffer (premultiplied RGBA), for tests and tools.

Trait implementations: Clone, Default

structaster_blueprint::ui::fx::SceneLight

pub struct SceneLight { /* see fields */ }

A directional light for a whole scene (the sun, a window, a key light). Put it on the root with [DepthExt::scene_light].

Methods

  • fn directional(azimuth_deg: f64, elevation_deg: f64) -> Self — A light that travels across the screen in direction azimuth_deg (the screen's axes, as [super::LightShafts::direction]: 0 right, 90 down, 180 left, 270 up) and stands elevation_deg above the surface (90 overhead: tight shadows under the element; low: long shadows). Shadows fall the way the light travels.
  • fn color(self, c: impl Into<Col>) -> Self — Light colour (alpha scales the intensity).
  • fn intensity(self, v: f64) -> Self — Strength 0..=2; 0 switches the scene light off (elements keep the theme's own elevation).
  • fn ambient(self, v: f64) -> Self — Fill light 0..=1: how much of the shade and shadow darkness is filled back in (default 0.25).
  • fn softness(self, v: f64) -> Self — Penumbra scale 0.2..=3 (default 1): a big soft source or a hard sun.
  • fn follow_pointer(self) -> Self — The light becomes a lamp that follows the pointer: highlights, glints and shadow directions of every element follow it (springs; static under reduced motion, where the directional light stays).
  • fn parallax(self, px: f64) -> Self — Pointer parallax: an element with .depth(z) shifts by up to px * z / 50 px as the pointer crosses the screen (nearer layers move the opposite way, far layers with negative z the same way). Off under reduced motion.
  • fn scroll_parallax(self, key: impl Into<String>, gain: f64) -> Self — Scroll parallax: the store integer key (a scroll offset in px that the app keeps) shifts elements with a depth vertically by -key * gain * z / 100 px.
  • fn level_height(self, px: f64) -> Self — Px of height one theme elevation level stands for (default 5).
  • fn azimuth_deg(&self) -> f64 — The azimuth in degrees.
  • fn elevation_deg(&self) -> f64 — The elevation in degrees.
  • fn shadow_offset(&self, z: f64) -> [f64; 2] — Where the shadow of an element z px above the surface falls, relative to the element.

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::Shock

pub struct Shock { /* see fields */ }

An expanding refractive ring.

Public fields

fieldtype
ampf64Peak displacement in logical px.
widthf64Half width of the ring in logical px.
speedf64Expansion in logical px per second.
lifef64Seconds until the ring has faded out.
fringef64Chromatic fringe 0..1 (0 = none).

Methods

  • fn new() -> Self
  • fn amp(self, px: f64) -> Self
  • fn width(self, px: f64) -> Self
  • fn speed(self, px_per_s: f64) -> Self
  • fn life(self, seconds: f64) -> Self
  • fn fringe(self, f: f64) -> Self

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::Sky

pub struct Sky { /* see fields */ }

The living part of a backdrop: layers, grain and how fast it refreshes. Backdrop::new(..).sky(Sky::new()..).

Methods

  • fn new() -> Sky — A sky with no layers yet: refreshed at most 8 times a second, 150 000 device pixels per frame at most.
  • fn layer(self, l: SkyLayer) -> Sky — Add a layer (they are composed in the order added, over the base).
  • fn grain(self, strength: f64) -> Sky — Film grain of strength (0.05 is the usual) from four pre-baked tiles that are cycled and shifted each time a tile refreshes: it flickers at the refresh rate. (The backdrop's own picture should have none.)
  • fn rate(self, hz: f64) -> Sky — Refresh each visible tile at most hz times a second (1..=60, default 8; NaN is the default).
  • fn budget(self, px: usize) -> Sky — At most px device pixels of tiles are composed in a frame (default 150 000: about 2-3 ms at 1080p). When more are stale the stalest go first and the rest wait for the next frame: the sky slows down, no frame does.

Trait implementations: Clone, Default

structaster_blueprint::ui::fx::SkyLayer

pub struct SkyLayer { /* see fields */ }

One translucent layer of the sky: a scene rendered once, then moved and faded by the clock.

SkyLayer::new("clouds", || noise_fill(..)).sway(60., 20., 90.).breathe(0.3, 11.)

Methods

  • fn new(name: impl AsRef<str>, scene: impl Fn() -> El + 'static) -> SkyLayer — A layer named name (hashed: change it when scene changes) whose picture scene makes on a transparent ground. It is laid out in a box the size of the screen plus the sway margin and rendered at a quarter of the size; build it from soft things (noise, aurora, glows). It is rendered once per size, scale and theme.
  • fn sway(self, ax: f64, ay: f64, period: f64) -> SkyLayer — Travel ax, ay logical px each way over period seconds (a slow back-and-forth, so no seam ever shows).
  • fn morph(self, other: impl Fn() -> El + 'static, period: f64) -> SkyLayer — Cross-fade to other and back over period seconds (a second shape of the same cloud or aurora: nothing is generated at run time, two pictures are blended).
  • fn breathe(self, depth: f64, period: f64) -> SkyLayer — Fade between full strength and 1 - depth of it over period seconds.
  • fn additive(self) -> SkyLayer — Add the layer's light to the sky instead of laying it over (glows, shafts).
  • fn opacity(self, a: f64) -> SkyLayer — Show the layer at a times its strength (0..=1).
  • fn phase(self, seconds: f64) -> SkyLayer — Seconds to start the layer's motion at (so two layers do not move in step).
  • fn res(self, r: f64) -> SkyLayer — The layer is rendered at this fraction of the logical size (0.25..=1, default 0.25).

Trait implementations: Clone

structaster_blueprint::ui::fx::TiltCard

pub struct TiltCard { /* see fields */ }

Tilt card settings.

Public fields

fieldtype
max_degf64Largest rotation in degrees at the card edge.
perspectivef64Camera distance in px (smaller = stronger perspective).
shadef64Depth shading 0..1: the side tilting away darkens, the near side lightens.
sheenf64Specular sheen strength 0..1 (a soft white glare under the pointer).
liftf64Scale-up while hovered.
springui::hx::SpringCfg

Methods

  • fn new() -> Self
  • fn max_deg(self, d: f64) -> Self
  • fn perspective(self, px: f64) -> Self
  • fn shade(self, s: f64) -> Self
  • fn sheen(self, s: f64) -> Self
  • fn lift(self, k: f64) -> Self

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::atmosphere::Bloom

pub struct Bloom { /* see fields */ }

Bloom: bright parts of source glow outward. source is the backdrop element (the same one you draw at the bottom of the screen).

Public fields

fieldtype
sourceui::el::El
thresholdf64Luma above which pixels bloom 0..1.
radiusf64Blur radius in logical px.
strengthf64
blendaster_ui::BlendModeAdditive by default: bloom is light added to what is beneath.

Methods

  • fn threshold(self, t: f64) -> Self
  • fn radius(self, r: f64) -> Self
  • fn strength(self, s: f64) -> Self
  • fn blend(self, mode: aster_ui::BlendMode) -> Self — Blend mode of the glow (default Add).
  • fn el(self) -> El

Trait implementations: Clone, Debug, From<Bloom>

structaster_blueprint::ui::fx::atmosphere::LightLeak

pub struct LightLeak { /* see fields */ }

A warm wash bleeding in from a screen edge or corner, like light leaking into a lens.

Public fields

fieldtype
colorui::el::Col
at[f64; 2]Where it enters, as fractions of the box (0, 0 = top-left corner).
sizef64Reach as a fraction of the box diagonal.
strengthf64
breathef64Slow breathing in cycles per second (0 = still).
blendaster_ui::BlendModeAdditive by default: the leak lights what it covers instead of tinting it.

Methods

  • fn size(self, s: f64) -> Self
  • fn strength(self, s: f64) -> Self
  • fn blend(self, mode: aster_ui::BlendMode) -> Self — Blend mode of the wash (default Add; SourceOver tints instead of lighting).
  • fn breathe(self, cycles_per_s: f64) -> Self
  • fn el(self) -> El

Trait implementations: Clone, Copy, Debug, From<LightLeak>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::atmosphere::Parallax

pub struct Parallax { /* see fields */ }

Layers that shift with the pointer (and optionally a scroll position) at different rates.

Methods

  • fn layer(self, el: El, depth: f64) -> Self
  • fn amount(self, px: f64) -> Self — Largest pointer shift in px at depth 1.
  • fn scroll(self, key: &str, rate: f64) -> Self — Also shift vertically with the store scalar key (a scroll offset in px) at rate * depth px per px (use .offset or <scroll id>.top).
  • fn el(self) -> El

Trait implementations: Clone, Debug, From<Parallax>

structaster_blueprint::ui::fx::atmosphere::ParallaxLayer

pub struct ParallaxLayer { /* see fields */ }

One layer of a [Parallax] stack.

Public fields

fieldtype
elui::el::El
depthf64Depth -1..1: 0 does not move, positive layers (background) move against the pointer, negative ones (foreground) with it, by depth * amount px.

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::backdrop::Backdrop

pub struct Backdrop { /* see fields */ }

A scene drawn once. Backdrop::new("dusk", || sky_stack()), then backdrop.el() at the bottom of the root overlay and backdrop.glass(panel, Glass::new()) for the panels.

Methods

  • fn new(key: impl AsRef<str>, build: impl Fn() -> El + 'static) -> Backdrop — A backdrop named key (hashed) whose scene build makes. build runs on a miss only: the first frame, a resize, a scale or theme change, or a new key.
  • fn glass_from(self, scene: impl Fn() -> El + 'static) -> Backdrop — Frost the glass from scene instead of from the picture: usually the sky alone, without the light, the grain and the vignette that are laid over it (the glass then looks through to the sky, as .glass(&sky) does). It is rendered at a quarter of the size, the way GlassExt::glass renders its backdrop, so the frosted pictures are those of .glass(&scene, ..) with the scene at rest. Without it the glass frosts a quarter-size copy of the picture.
  • fn sky(self, sky: Sky) -> Backdrop — Give the picture a living sky: [Sky] layers (clouds that drift, an aurora that breathes, grain) composed over it by the clock in small tiles, so that a frame costs the tiles it refreshes and not the screen. Glass still frosts the picture at rest. Opt-in: without it the backdrop is a still, as before. See docs/CINEMATIC.md.
  • fn progressive(self) -> Backdrop — Paint the first frame fast: a soft stand-in (the sky of [Backdrop::glass_from] stretched from its quarter-size render, 40 ms at 1080p, which the glass needs anyway; without one, the scene at a quarter of the size, which costs about as much as the full render) and the full picture replaces it on the next frame (a hitch of the full render's cost). The screen must present that next frame (an animation, a tick or any input does). Opt-in: pixels of the first frame differ (they are soft, and the grain is coarse).
  • fn el(&self) -> El — The full-bleed element that shows the picture (put it first in the root overlay, .cover()ed by default). One image copy per repaint; an unchanged frame is a cache hit.
  • fn glass(&self, panel: El, g: Glass) -> El — Frost panel over this backdrop: a blurred, tinted copy of the picture behind it (like GlassExt::glass), baked once per panel rectangle and parameters, not once per frame.

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::depth::DepthSpec

pub struct DepthSpec { /* see fields */ }

What an element declares about depth and light (El::s.fdn().depth). Read by the scene pass and by the layers.

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::fx::depth::PointLight

pub struct PointLight { /* see fields */ }

A glowing element's light (see [DepthExt::casts_light]).

Methods

  • fn new() -> Self
  • fn color(self, c: impl Into<Col>) -> Self — Light colour (alpha scales the intensity).
  • fn intensity(self, v: f64) -> Self — Strength 0..=2.
  • fn radius(self, px: f64) -> Self — Reach in px: the light falls off to nothing at this distance from the element's centre.
  • fn quality(self, q: f64) -> Self — Working resolution 0.15..=0.5 of the screen (lower is cheaper and softer).
  • fn sky(self, backdrop: &El) -> Self — The scene without any element on top of it: whatever differs from it blocks the light (default: guessed from the colour of the screen border, which suits a flat background).

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::fx::depth::SceneLight

pub struct SceneLight { /* see fields */ }

A directional light for a whole scene (the sun, a window, a key light). Put it on the root with [DepthExt::scene_light].

Methods

  • fn directional(azimuth_deg: f64, elevation_deg: f64) -> Self — A light that travels across the screen in direction azimuth_deg (the screen's axes, as [super::LightShafts::direction]: 0 right, 90 down, 180 left, 270 up) and stands elevation_deg above the surface (90 overhead: tight shadows under the element; low: long shadows). Shadows fall the way the light travels.
  • fn color(self, c: impl Into<Col>) -> Self — Light colour (alpha scales the intensity).
  • fn intensity(self, v: f64) -> Self — Strength 0..=2; 0 switches the scene light off (elements keep the theme's own elevation).
  • fn ambient(self, v: f64) -> Self — Fill light 0..=1: how much of the shade and shadow darkness is filled back in (default 0.25).
  • fn softness(self, v: f64) -> Self — Penumbra scale 0.2..=3 (default 1): a big soft source or a hard sun.
  • fn follow_pointer(self) -> Self — The light becomes a lamp that follows the pointer: highlights, glints and shadow directions of every element follow it (springs; static under reduced motion, where the directional light stays).
  • fn parallax(self, px: f64) -> Self — Pointer parallax: an element with .depth(z) shifts by up to px * z / 50 px as the pointer crosses the screen (nearer layers move the opposite way, far layers with negative z the same way). Off under reduced motion.
  • fn scroll_parallax(self, key: impl Into<String>, gain: f64) -> Self — Scroll parallax: the store integer key (a scroll offset in px that the app keeps) shifts elements with a depth vertically by -key * gain * z / 100 px.
  • fn level_height(self, px: f64) -> Self — Px of height one theme elevation level stands for (default 5).
  • fn azimuth_deg(&self) -> f64 — The azimuth in degrees.
  • fn elevation_deg(&self) -> f64 — The elevation in degrees.
  • fn shadow_offset(&self, z: f64) -> [f64; 2] — Where the shadow of an element z px above the surface falls, relative to the element.

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::distort::Block

pub struct Block { /* see fields */ }

A rectangle (device px) whose pixels are fetched from (dx, dy) away and optionally recoloured.

Public fields

fieldtype
rect[f32; 4]
shift[f32; 2]
opBlockOp

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::distort::Chroma

pub struct Chroma { /* see fields */ }

RGB split.

Public fields

fieldtype
pxf64Split in logical px (at the corners when radial).
degOption<f64>None: radial (grows from the centre); Some(deg): one direction.

Methods

  • fn radial(px: f64) -> Self
  • fn directional(px: f64, deg: f64) -> Self

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::distort::Distort

pub struct Distort { /* see fields */ }

Shockwave, haze and chromatic aberration for .distort(..) / [distort_below].

Public fields

fieldtype
shockOption<Shock>
hazeOption<Haze>
chromaOption<Chroma>
onOption<String>Store counter that fires the shockwave (default: a click on the element).
atOption<[f64; 2]>Fixed ring origin as fractions of the box (default: the pointer when it fired).
seedu64

Methods

  • fn shockwave_on_click() -> Self — A ring from the click point (needs .id() on an element; for an overlay name a counter with .on(..)).
  • fn shockwave() -> Self — The same ring, meant to be fired with [Distort::on].
  • fn haze() -> Self — Heat shimmer.
  • fn underwater() -> Self — Underwater wobble.
  • fn chromatic() -> Self — A static radial RGB split.
  • fn shock(self, s: Shock) -> Self
  • fn haze_with(self, h: Haze) -> Self
  • fn chroma(self, c: Chroma) -> Self
  • fn on(self, key: &str) -> Self — Fire the shockwave when the store counter key changes (instead of on click).
  • fn at(self, fx: f64, fy: f64) -> Self — Always start the ring at these fractions of the box.
  • fn seed(self, seed: u64) -> Self

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::distort::Field

pub struct Field { /* see fields */ }

A coarse displacement grid (device px), sampled bilinearly.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::distort::Glitch

pub struct Glitch { /* see fields */ }

Seeded slice offsets, RGB split and block corruption.

Public fields

fieldtype
seedu64
slicesu32Horizontal slices at full strength.
shiftf64Largest slice offset in logical px.
rgbf64RGB split in logical px.
blocksu32Corrupted blocks at full strength.
ratef64Glitch pictures per second.
durationf64Seconds a burst or a flicker lasts.
everyf64Mean seconds between ambient flickers (0 = none).
burstboolFires on a click / counter.
strengthf64
onOption<String>

Methods

  • fn burst() -> Self — A glitch burst on every click of the element (or .on(key)).
  • fn ambient() -> Self — An occasional ambient flicker, no trigger needed.
  • fn seed(self, seed: u64) -> Self
  • fn slices(self, n: u32) -> Self
  • fn shift(self, px: f64) -> Self
  • fn rgb(self, px: f64) -> Self
  • fn blocks(self, n: u32) -> Self
  • fn rate(self, fps: f64) -> Self
  • fn duration(self, seconds: f64) -> Self
  • fn every(self, seconds: f64) -> Self — Also flicker on its own about every seconds.
  • fn strength(self, s: f64) -> Self
  • fn on(self, key: &str) -> Self — Fire when the store counter key changes (instead of on click).

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::distort::Haze

pub struct Haze { /* see fields */ }

Noise-driven displacement.

Public fields

fieldtype
ampf64Peak displacement in logical px.
scalef64Feature size in logical px.
speedf64Noise time per second.
heatboolHeat shimmer: mostly sideways, rising, strongest toward the bottom. Otherwise a slow wobble in both axes.

Methods

  • fn heat() -> Self
  • fn water() -> Self
  • fn amp(self, px: f64) -> Self
  • fn scale(self, px: f64) -> Self
  • fn speed(self, s: f64) -> Self

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::distort::Hologram

pub struct Hologram { /* see fields */ }

Scanlines, flicker and a slight barrel curve.

Public fields

fieldtype
curvef64Barrel curve (0 = flat, 0.06 = a CRT).
scanf64Scanline darkness 0..1 and spacing in logical px.
spacingf64
flickerf64Brightness flicker 0..1.
rollf64Rolling bright bar, screens per second (0 = none).
tintui::el::Col
tint_amountf64How much of the picture's luma is recoloured toward the tint 0..1.
chromaf64RGB split in logical px at the corners.
vignettef64Corner darkening 0..1.
seedu64

Methods

  • fn new() -> Self
  • fn curve(self, k: f64) -> Self
  • fn scanlines(self, darkness: f64, spacing_px: f64) -> Self
  • fn flicker(self, f: f64) -> Self
  • fn roll(self, screens_per_s: f64) -> Self
  • fn tint(self, c: impl Into<Col>, amount: f64) -> Self
  • fn chroma(self, px: f64) -> Self
  • fn vignette(self, v: f64) -> Self
  • fn seed(self, seed: u64) -> Self

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::distort::NodeDistort

pub struct NodeDistort { /* see fields */ }

Inputs of the distort graph node, all in logical px / seconds.

Public fields

fieldtype
timef64
shock_agef64Seconds since the shockwave started (negative: none) and its origin as fractions of the box.
at[f64; 2]
shockShock
hazef64
chromaf64
glitchf64
seedu64

Trait implementations: Clone, Copy, Debug

structaster_blueprint::ui::fx::distort::NodeHolo

pub struct NodeHolo { /* see fields */ }

Inputs of the hologram graph node.

Public fields

fieldtype
timef64
holoHologram
tint[u8; 4]

Trait implementations: Clone, Copy, Debug

structaster_blueprint::ui::fx::distort::Plan

pub struct Plan { /* see fields */ }

Everything [warp] does to a picture, in device px.

Public fields

fieldtype
edgeEdge
ringsVec<Ring>
fieldOption<std::sync::Arc<Field>>
chroma_radialf32RGB split: radial px at the picture corners growing from the centre, plus a constant dir.
chroma_dir[f32; 2]
row_dxVec<f32>Glitch: per row horizontal offset and RGB split (px), empty when off.
row_rgbVec<f32>
blocksVec<Block>
barrelf32Barrel curve: samples 1 + barrel r^2 times further from the centre (r = 1 at the edge middles).
bezel[u8; 4]Pixels the curve pulls from outside the picture.
tintOption<([f32; 3], f32)>Tint colour (0..=1 channels) and amount: luma recoloured toward it.
row_gainVec<f32>Brightness per row (scanlines, roll bar, flicker), empty when off.
vignettef32Darkening at the corners 0..1.

Methods

  • fn new(edge: Edge) -> Plan
  • fn is_identity(&self) -> bool
  • fn source_at(&self, fx: f32, fy: f32, wf: f32, hf: f32) -> (f32, f32) — The source pixel the output pixel at (fx, fy) reads: the same arithmetic as the warp itself (barrel, slice offset, block shift, haze and rings), so a pointer can be carried back to the content it shows.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::distort::Ring

pub struct Ring { /* see fields */ }

One expanding refractive ring (device px).

Public fields

fieldtype
c[f32; 2]
rf32
wf32
ampf32Peak displacement.
fringef32Chromatic fringe 0..1: red is displaced 1 + f times, blue 1 - f times as far as green.

Methods

  • fn new(c: [f32; 2], r: f32, w: f32, amp: f32, fringe: f32) -> Ring

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::distort::Shock

pub struct Shock { /* see fields */ }

An expanding refractive ring.

Public fields

fieldtype
ampf64Peak displacement in logical px.
widthf64Half width of the ring in logical px.
speedf64Expansion in logical px per second.
lifef64Seconds until the ring has faded out.
fringef64Chromatic fringe 0..1 (0 = none).

Methods

  • fn new() -> Self
  • fn amp(self, px: f64) -> Self
  • fn width(self, px: f64) -> Self
  • fn speed(self, px_per_s: f64) -> Self
  • fn life(self, seconds: f64) -> Self
  • fn fringe(self, f: f64) -> Self

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::distort::Warp

pub struct Warp { /* see fields */ }

A distorted picture: the warp that moved it and where it sits, so a pointer on it is carried back to the resting position of the content it shows.

Public fields

fieldtype
kindWarpKind
rect[f64; 4]The screen rect the picture covers (logical px): x, y, w, h.
origin[f64; 2]The picture's (0, 0) on the screen (logical px).
size[u32; 2]The picture's size (device px).
scalef64Device px per logical px.
planstd::sync::Arc<Plan>The warp, in the picture's device px.

Methods

  • fn covers(&self, p: [f64; 2]) -> bool — Whether the screen position p (logical px) is on the picture.
  • fn rest_at(&self, p: [f64; 2]) -> Option<[f64; 2]> — The screen position of the content drawn at p (logical px): the pointer carried back through the warp. None when p is not on the picture.
  • fn drawn_at(&self, p: [f64; 2]) -> [f64; 2] — Where the content at the screen position p (logical px) is drawn: the pointer carried forward through the warp (the inverse of [Warp::rest_at], found by iteration).

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::fog::Fog

pub struct Fog { /* see fields */ }

A fog bank. Build with [Fog::bank] or [Fog::height], turn into an element with [fog].

Methods

  • fn bank() -> Self — A bank of drifting fog that fades out toward the top and bottom of its box.
  • fn height() -> Self — Height fog: thickest at the bottom of its box, thinning upward.
  • fn color(self, c: impl Into<Col>) -> Self — Fog colour (before the scene light tints it).
  • fn density(self, v: f64) -> Self — Peak opacity 0..=1.
  • fn scale(self, px: f64) -> Self — Size of the biggest billows in px.
  • fn drift(self, vx: f64, vy: f64) -> Self — Drift in px per second ((0, 0) bakes once and never changes).
  • fn depth(self, z: f64) -> Self — Depth of the bank in px for the scene's pointer parallax (negative: far, moves less and the other way).
  • fn seed(self, seed: u32) -> Self — Seed of the noise.
  • fn shafts(self, strength: f64) -> Self — Beams of the scene light through the fog, 0..=2 (0, the default, is none). Shadowed behind opaque elements.
  • fn sky(self, backdrop: &El) -> Self — The backdrop alone, for the shafts' occluders ([LightShafts::sky]).
  • fn band(self, top: f64, bottom: f64) -> Self — A bank occupies this band of its box (fractions from the top; default 0.15..0.9).
  • fn rise(self, frac: f64) -> Self — Height fog fills this fraction of its box from the bottom (default 0.5).

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::fog::FogShared

pub struct FogShared { /* see fields */ }

What a fog element shares with the scene pass: its settings and the light the pass last gave it.

Trait implementations: Debug

structaster_blueprint::ui::fx::glass::Glass

pub struct Glass { /* see fields */ }

How the glass looks.

Public fields

fieldtype
blurf64Blur sigma in logical px.
tintui::el::ColTint colour and how strongly it covers 0..1.
tint_alphaf64
saturationf64Saturation of the backdrop (1 = unchanged, 1.4 = vivid).
brightnessf64Brightness multiplier of the backdrop.
edgef64Strength of the 1 px top-left edge highlight 0..1.

Methods

  • fn new() -> Self
  • fn blur(self, sigma: f64) -> Self
  • fn tint(self, c: impl Into<Col>, alpha: f64) -> Self
  • fn saturation(self, s: f64) -> Self
  • fn brightness(self, b: f64) -> Self
  • fn edge(self, e: f64) -> Self

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient::Conic

pub struct Conic { /* see fields */ }

A conic (angular sweep) gradient. conic([..]).spin(30.).el().

Public fields

fieldtype
colsVec<ui::el::Col>
anglef64Start angle in degrees (0 = pointing right, clockwise).
center[f64; 2]Centre as fractions of the box.
spinf64Degrees per second (0 = still).
loopedboolThe sweep wraps back to the first colour (seamless).

Methods

  • fn angle(self, deg: f64) -> Self
  • fn center(self, fx: f64, fy: f64) -> Self
  • fn spin(self, deg_per_s: f64) -> Self
  • fn open(self) -> Self — Do not wrap: the last colour is the end of the sweep.
  • fn el(self) -> El — The gradient as an element that fills its box (.size, .radius, .grow apply).

Trait implementations: Clone, Debug, From<Conic>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient::Flow

pub struct Flow { /* see fields */ }

An animated linear gradient whose bands drift and undulate (hero backgrounds, progress shimmer). Looped, so the motion is seamless.

Public fields

fieldtype
colsVec<ui::el::Col>
anglef64Direction in degrees (0 = left to right).
speedf64Scroll speed in cycles per second (0 = still).
warpf64Undulation of the bands 0..1.
stepf64The picture is rebuilt every step seconds (0 = every frame).

Methods

  • fn angle(self, deg: f64) -> Self
  • fn speed(self, cycles_per_s: f64) -> Self
  • fn warp(self, w: f64) -> Self
  • fn step(self, secs: f64) -> Self — Rebuild the picture every secs seconds (default 0.2; 0 = every frame).
  • fn el(self) -> El

Trait implementations: Clone, Debug, From<Flow>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient::Mesh

pub struct Mesh { /* see fields */ }

A mesh (multi-point) gradient: colour blobs blended smoothly, optionally drifting.

Public fields

fieldtype
pointsVec<(f64, f64, ui::el::Col)>(x, y, colour) with x, y as fractions of the box.
sharpnessf64Falloff sharpness (1 = very soft, 4 = distinct blobs).
driftf64Orbit radius of each point as a fraction of the box (0 = still).
speedf64Orbit speed in turns per second.
stepf64The picture is rebuilt every step seconds (0 = every frame).

Methods

  • fn sharpness(self, s: f64) -> Self
  • fn step(self, secs: f64) -> Self — Rebuild the picture every secs seconds (default 0.2; 0 = every frame).
  • fn drift(self, radius: f64, speed: f64) -> Self — Each point wanders on a small loop of radius (box fraction) at speed turns/s.
  • fn el(self) -> El

Trait implementations: Clone, Debug, From<Mesh>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient2::CoonsMesh

pub struct CoonsMesh { /* see fields */ }

A grid of cols x rows nodes (row-major), (cols - 1) x (rows - 1) patches.

Public fields

fieldtype
colsusize
rowsusize
nodesVec<MeshNode>
spacesuper::color::Space
colorMeshColor

Methods

  • fn grid(cols: usize, rows: usize, col: impl Fn(usize, usize) -> Col) -> CoonsMesh — A regular grid with straight edges, coloured by col(i, j) (i across, j down).
  • fn node(&self, i: usize, j: usize) -> &MeshNode
  • fn node_mut(&mut self, i: usize, j: usize) -> &mut MeshNode
  • fn at(self, i: usize, j: usize, x: f64, y: f64) -> CoonsMesh — Move a node (box fractions).
  • fn col(self, i: usize, j: usize, c: impl Into<Col>) -> CoonsMesh
  • fn handle(self, i: usize, j: usize, which: usize, d: [f64; 2]) -> CoonsMesh — Set one handle (EAST, WEST, SOUTH, NORTH) of a node.
  • fn space(self, s: Space) -> CoonsMesh
  • fn color_mode(self, c: MeshColor) -> CoonsMesh
  • fn straight_handles(&mut self) — Handles a third of the way to each neighbour: straight edges.
  • fn smooth_handles(self) -> CoonsMesh — Catmull-Rom handles: each grid line becomes a smooth curve through its nodes.
  • fn twist(self, i: usize, j: usize, deg: f64, scale: f64) -> CoonsMesh — Rotate and scale the handles of node (i, j) (a swirl), keeping east/west and north/south opposite.
  • fn prepare(&self, f: impl Fn(Col) -> [u8; 4]) -> MeshPrep — Resolve colours (f: a colour to sRGB bytes) into mixing coordinates and derivatives.
  • fn drifted(&self, t: f64, seed: u64, pull: Option<[f64; 2]>) -> CoonsMesh — The mesh t seconds into a slow drift: interior nodes wander on Lissajous paths (periods of 9 to 23 s, at most 13 % of a cell) and their handles turn a little; edge nodes slide along their edge; corners stay, so the outline is always the box. pull (box fractions): nodes near it lean towards it (a pointer's gravity). Deterministic in t and seed.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient2::Freeform

pub struct Freeform { /* see fields */ }

Public fields

fieldtype
pinsVec<Pin>
linesVec<Line>
blendBlend
spacesuper::color::Space

Methods

  • fn new() -> Freeform
  • fn point(self, x: f64, y: f64, col: impl Into<Col>) -> Freeform
  • fn point_spread(self, x: f64, y: f64, col: impl Into<Col>, spread: f64) -> Freeform — A point with its own reach.
  • fn line(self, pts: impl IntoIterator<Item = ([f64; 2], Col)>, spread: f64) -> Freeform
  • fn blend(self, b: Blend) -> Freeform
  • fn space(self, s: Space) -> Freeform
  • fn render(&self, w: usize, h: usize, aspect: f64, f: impl Fn(Col) -> [u8; 4]) -> Field — Evaluate on a w x h grid for a box of aspect w_box / h_box.

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient2::Grad

pub struct Grad { /* see fields */ }

A gradient. Build with a constructor ([Grad::linear], [Grad::mesh], [Grad::aurora] ...), adjust with the modifiers, then use it as a fill (.grad_fill(g) or g.el()), a border, text, a glow or a gradient map.

Public fields

fieldtype
sourceSource
stopsStops
spreadSpread
repeatf64t is multiplied by this (repeating bands with Spread::Repeat/Reflect).
offsetf64Added to t (and to the conic angle as turns).
ditherDither
glowOption<(f64, f64)>Halo: (strength 0..=2, radius logical px).
speedf64Animation speed: ramp cycles per second for t fields (turns per second for conics), time scale for procedural fields. 0 = still.
timef64Start time in seconds (a still frame of an animated field).
scalef64Feature size of procedural fields (logical px per noise unit).
seedu32
view[f64; 2]Where the viewer / light is (box fractions): iridescence and metal highlights.
followboolThe view follows the pointer over the element (needs an .id).
qualityf64Resolution of coarse-evaluated fields (1 = default; 2 = four times the samples).
min_contrastOption<(ui::el::Col, f64)>Every resolved colour is fitted to keep this contrast against a background (gradient text).
vignettef64Darken towards the edges by this much (0..=1; see [Grad::vignette]).
fpsf64Pictures per second an animated gradient is rebuilt at (see [Grad::fps]).
bandsu32Horizontal bands an animated backdrop is re-baked in, one band per frame (see [Grad::bands]).

Methods

  • fn linear(angle: f64, stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Straight bands at angle degrees (0 = left to right, 90 = top to bottom).
  • fn radial(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Circles from the centre to the farthest corner (.ellipse, .focal, .center adjust).
  • fn conic(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — An angular sweep (seamless: the ramp wraps unless .open()).
  • fn diamond(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad
  • fn boxed(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Nested boxes (Illustrator's "square"/Photoshop's "box" shape).
  • fn spiral(arms: f64, twist: f64, stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — A spiral of arms ramps per turn and twist ramps from the centre to the edge (reflects).
  • fn path(pts: Vec<[f64; 2]>, curved: bool, closed: bool, map: PathMap, stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Distance in from the element's rounded edge (0 on the edge, 1 at depth px in). t along a path (pts box fractions; cubic Bézier chains p0, c1, c2, p1, .. with curved): the arc length of the nearest point on it ([PathMap::Along]) or the distance to it ([PathMap::Distance]). closed joins the end back to the start. Fills, borders and shapes take it like any gradient; .animate(speed) makes the bands flow along the path.
  • fn shape_burst(depth: f64, stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Distance in from the element's rounded edge (on a text: from the glyph outlines).
  • fn mesh(m: CoonsMesh) -> Grad
  • fn freeform(f: Freeform) -> Grad
  • fn lush(cols: impl IntoIterator<Item = impl Into<Col>>, seed: u64) -> Grad — A lush organic mesh from 3-6 colours (the first is the ground) and a seed.
  • fn warp(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Inigo Quilez's domain-warped flow through the ramp.
  • fn aurora(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Northern lights: the first stop is the night sky, the rest the curtains' colours.
  • fn silk(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Satin folds, gradient-mapped (dark fold to sheen).
  • fn liquid_metal(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Liquid chrome; the ramp tints the reflection (shadow to highlight).
  • fn iridescent(tint: f64, stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Thin-film interference (holographic foil); the ramp tints it by tint (0..=1).
  • fn named(t: GradToken) -> Grad — A gradient from the theme's palette.
  • fn center(self, x: f64, y: f64) -> Grad — Centre of a radial, conic, diamond, box or spiral (box fractions).
  • fn ellipse(self, rx: f64, ry: f64) -> Grad — Radial: radii as fractions of the box width and height.
  • fn focal(self, x: f64, y: f64) -> Grad — Radial: where t = 0 is (box fractions), inside the circle.
  • fn angle(self, deg: f64) -> Grad — Linear direction / conic start angle in degrees.
  • fn open(self, seam: f64) -> Grad — Conic: do not wrap the ramp; blend the last colour back into the first over seam degrees.
  • fn size(self, s: f64) -> Grad — Diamond / box size (1 = reaches the sides).
  • fn space(self, s: Space) -> Grad
  • fn hue(self, path: HuePath) -> Grad — Mix in OKLCH along path.
  • fn smooth(self, s: f64) -> Grad — 0 piecewise linear, 1 a smooth monotone spline through the stops.
  • fn stops(self, s: Stops) -> Grad
  • fn spread(self, s: Spread) -> Grad
  • fn repeat(self, n: f64) -> Grad
  • fn offset(self, o: f64) -> Grad
  • fn dither(self, d: Dither) -> Grad
  • fn glow(self, strength: f64, radius: f64) -> Grad — A halo of the gradient's own colours around the element: strength 0..=2, radius px.
  • fn animate(self, speed: f64) -> Grad — Animate: cycles (or turns, or time scale) per second. Freezes under reduced motion.
  • fn time(self, secs: f64) -> Grad
  • fn scale(self, px: f64) -> Grad
  • fn seed(self, s: u32) -> Grad
  • fn view(self, x: f64, y: f64) -> Grad
  • fn follow_pointer(self) -> Grad — The view (iridescence, metal highlight) follows the pointer. The element needs an .id.
  • fn quality(self, q: f64) -> Grad
  • fn min_contrast(self, bg: impl Into<Col>, ratio: f64) -> Grad — Fit every colour so it keeps ratio contrast against bg (text filled with this gradient).
  • ...and 13 more

Trait implementations: Clone, Debug, From<Grad>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient2::Lut

pub struct Lut { /* see fields */ }

A baked ramp: n sRGB-encoded float colours (0..=255, straight alpha), the glow at each, and the darkest and lightest relative luminance it reaches (the a11y audit's range).

Public fields

fieldtype
rgbaVec<[f32; 4]>
glowVec<f32>Empty when nothing glows.
lum[f64; 2]

Methods

  • fn at(&self, t: f32) -> [f32; 4] — Colour at t (0..=1, clamped), linearly interpolated between entries.
  • fn glow_at(&self, t: f32) -> f32
  • fn has_jumps(&self) -> bool — Whether the ramp jumps somewhere (a hard stop, a Steps curve): its lookups need filtering over the pixel's footprint or the edges alias.
  • fn ends_differ(&self) -> bool — Whether the last colour differs from the first (a repeat or a conic seam shows an edge).

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient2::Stop

pub struct Stop { /* see fields */ }

One colour stop. Build with [stop] or from a colour / (position, colour) pair.

Public fields

fieldtype
atOption<f64>Position 0..=1 along the gradient (None: spread evenly between its neighbours).
colui::el::Col
midf64Where between this stop and the next the colours are half and half (0.5 = halfway).
curveCurveThe shape of the segment from this stop to the next.
glowf64Light above white this stop emits (0 = none; 1 = twice as bright). Rolled off to white in the colour, and handed to the glow halo (see Grad::glow).

Methods

  • fn even(col: impl Into<Col>) -> Stop — An evenly spread stop.
  • fn mid(self, m: f64) -> Stop — Midpoint of the segment after this stop (0.02..=0.98).
  • fn curve(self, c: Curve) -> Stop
  • fn glow(self, g: f64) -> Stop

Trait implementations: Clone, Copy, Debug, From<(f64, C)>, From<Col>, From<Role>, From<Srgb8>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient2::Stops

pub struct Stops { /* see fields */ }

A gradient's colour ramp: stops plus how they mix.

Public fields

fieldtype
stopsVec<Stop>
spacesuper::color::Space
smoothf640 = piecewise linear between stops, 1 = a smooth monotone spline through them.
premulboolMix premultiplied by alpha (correct transparency, the default).
loopedboolThe ramp wraps: the first stop is repeated at the end (seamless conics, flows).

Methods

  • fn new(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Stops
  • fn space(self, s: Space) -> Stops
  • fn smooth(self, s: f64) -> Stops
  • fn looped(self, on: bool) -> Stops
  • fn straight_alpha(self) -> Stops — Straight-alpha mixing (what naive toolkits do; here for comparisons).
  • fn resolve(&self, th: &Theme) -> Ramp — Resolve the colours against a theme and lay the stops out.
  • fn resolve_with(&self, f: impl Fn(Col) -> [u8; 4]) -> Ramp — Resolve with a colour lookup (tests and offline tools: |c| c.resolve(&theme).channels()).

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient2::field::Field

pub struct Field { /* see fields */ }

A float picture: sRGB-encoded 0..=255 channels, straight alpha 0..=255.

Public fields

fieldtype
wusize
husize
pxVec<[f32; 4]>

Methods

  • fn new(w: usize, h: usize) -> Field
  • fn row(&self, y: usize) -> &[[f32; 4]]

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient2::freeform::Freeform

pub struct Freeform { /* see fields */ }

Public fields

fieldtype
pinsVec<Pin>
linesVec<Line>
blendBlend
spacesuper::color::Space

Methods

  • fn new() -> Freeform
  • fn point(self, x: f64, y: f64, col: impl Into<Col>) -> Freeform
  • fn point_spread(self, x: f64, y: f64, col: impl Into<Col>, spread: f64) -> Freeform — A point with its own reach.
  • fn line(self, pts: impl IntoIterator<Item = ([f64; 2], Col)>, spread: f64) -> Freeform
  • fn blend(self, b: Blend) -> Freeform
  • fn space(self, s: Space) -> Freeform
  • fn render(&self, w: usize, h: usize, aspect: f64, f: impl Fn(Col) -> [u8; 4]) -> Field — Evaluate on a w x h grid for a box of aspect w_box / h_box.

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient2::freeform::Line

pub struct Line { /* see fields */ }

A line stop: colours along a polyline (box fractions), interpolated along it.

Public fields

fieldtype
ptsVec<([f64; 2], ui::el::Col)>
spreadf64

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient2::freeform::Pin

pub struct Pin { /* see fields */ }

A colour pinned at a point (box fractions); spread scales how far it reaches (1 = normal).

Public fields

fieldtype
at[f64; 2]
colui::el::Col
spreadf64

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient2::mesh::CoonsMesh

pub struct CoonsMesh { /* see fields */ }

A grid of cols x rows nodes (row-major), (cols - 1) x (rows - 1) patches.

Public fields

fieldtype
colsusize
rowsusize
nodesVec<MeshNode>
spacesuper::color::Space
colorMeshColor

Methods

  • fn grid(cols: usize, rows: usize, col: impl Fn(usize, usize) -> Col) -> CoonsMesh — A regular grid with straight edges, coloured by col(i, j) (i across, j down).
  • fn node(&self, i: usize, j: usize) -> &MeshNode
  • fn node_mut(&mut self, i: usize, j: usize) -> &mut MeshNode
  • fn at(self, i: usize, j: usize, x: f64, y: f64) -> CoonsMesh — Move a node (box fractions).
  • fn col(self, i: usize, j: usize, c: impl Into<Col>) -> CoonsMesh
  • fn handle(self, i: usize, j: usize, which: usize, d: [f64; 2]) -> CoonsMesh — Set one handle (EAST, WEST, SOUTH, NORTH) of a node.
  • fn space(self, s: Space) -> CoonsMesh
  • fn color_mode(self, c: MeshColor) -> CoonsMesh
  • fn straight_handles(&mut self) — Handles a third of the way to each neighbour: straight edges.
  • fn smooth_handles(self) -> CoonsMesh — Catmull-Rom handles: each grid line becomes a smooth curve through its nodes.
  • fn twist(self, i: usize, j: usize, deg: f64, scale: f64) -> CoonsMesh — Rotate and scale the handles of node (i, j) (a swirl), keeping east/west and north/south opposite.
  • fn prepare(&self, f: impl Fn(Col) -> [u8; 4]) -> MeshPrep — Resolve colours (f: a colour to sRGB bytes) into mixing coordinates and derivatives.
  • fn drifted(&self, t: f64, seed: u64, pull: Option<[f64; 2]>) -> CoonsMesh — The mesh t seconds into a slow drift: interior nodes wander on Lissajous paths (periods of 9 to 23 s, at most 13 % of a cell) and their handles turn a little; edge nodes slide along their edge; corners stay, so the outline is always the box. pull (box fractions): nodes near it lean towards it (a pointer's gravity). Deterministic in t and seed.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient2::mesh::MeshNode

pub struct MeshNode { /* see fields */ }

One control point. Handles are offsets (box fractions) towards the east, west, south and north neighbours: [east, west, south, north].

Public fields

fieldtype
at[f64; 2]
colui::el::Col
handles[[f64; 2]; 4]

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient2::mesh::MeshPrep

pub struct MeshPrep { /* see fields */ }

A mesh ready to evaluate: positions, handles, colours in mixing coordinates (premultiplied), and colour derivatives per node.

Methods

  • fn patches(&self) -> (usize, usize)
  • fn edge(&self, i: usize, j: usize, horizontal: bool, t: f64) -> [f64; 2] — The edge curve from node a to its east (horizontal) or south neighbour at t.
  • fn point(&self, i: usize, j: usize, u: f64, v: f64) -> [f64; 2] — The point of patch (i, j) at (u, v): the Coons patch of its four edges. On an edge it is that edge's curve exactly (so neighbouring patches meet without a crack).
  • fn colour(&self, i: usize, j: usize, u: f64, v: f64) -> [f64; 4] — Colour coordinates (premultiplied, the mesh's space) of patch (i, j) at (u, v).
  • fn render(&self, w: usize, h: usize) -> Field — Rasterise into a w x h field of float sRGB colours.

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::gradient2::procedural::Spec

pub struct Spec { /* see fields */ }

A procedural field's parameters.

Public fields

fieldtype
kindKind
scalef64Logical px per noise unit (bigger = larger features).
seedu32
timef64Seconds (animated fields).
view[f64; 2]Viewer / light position as box fractions (iridescence, metal highlights).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient2::ramp::Lut

pub struct Lut { /* see fields */ }

A baked ramp: n sRGB-encoded float colours (0..=255, straight alpha), the glow at each, and the darkest and lightest relative luminance it reaches (the a11y audit's range).

Public fields

fieldtype
rgbaVec<[f32; 4]>
glowVec<f32>Empty when nothing glows.
lum[f64; 2]

Methods

  • fn at(&self, t: f32) -> [f32; 4] — Colour at t (0..=1, clamped), linearly interpolated between entries.
  • fn glow_at(&self, t: f32) -> f32
  • fn has_jumps(&self) -> bool — Whether the ramp jumps somewhere (a hard stop, a Steps curve): its lookups need filtering over the pixel's footprint or the edges alias.
  • fn ends_differ(&self) -> bool — Whether the last colour differs from the first (a repeat or a conic seam shows an edge).

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient2::ramp::Prefilter

pub struct Prefilter { /* see fields */ }

Box-filtered lookups of a ramp: its premultiplied running integral, so the mean colour over any t interval (past the ends too, by the spread) costs two lookups. This is what antialiases hard stops, Steps curves and repeat seams: each pixel shows the mean of the ramp over the stretch of t it covers.

Methods

  • fn new(lut: &Lut, spread: super::geom::Spread) -> Prefilter
  • fn mean(&self, u: f64, w: f64) -> [f32; 4] — The mean straight colour (sRGB-encoded 0..=255, alpha 0..=255) of the spread ramp over [u - w / 2, u + w / 2]; w at most a few px of t is all a pixel ever covers.

structaster_blueprint::ui::fx::gradient2::ramp::Ramp

pub struct Ramp { /* see fields */ }

A resolved ramp: stops laid out, colours in mixing coordinates.

Methods

  • fn space(&self) -> Space
  • fn eval(&self, t: f64) -> ([f64; 3], f64, f64) — Linear-light colour (in gamut), alpha 0..=1 and glow at t.
  • fn srgb8(&self, t: f64) -> [u8; 4] — The ramp as an sRGB byte colour at t (no glow, no dither).
  • fn lut(&self, n: usize) -> Lut — Bake n entries.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient2::ramp::Stop

pub struct Stop { /* see fields */ }

One colour stop. Build with [stop] or from a colour / (position, colour) pair.

Public fields

fieldtype
atOption<f64>Position 0..=1 along the gradient (None: spread evenly between its neighbours).
colui::el::Col
midf64Where between this stop and the next the colours are half and half (0.5 = halfway).
curveCurveThe shape of the segment from this stop to the next.
glowf64Light above white this stop emits (0 = none; 1 = twice as bright). Rolled off to white in the colour, and handed to the glow halo (see Grad::glow).

Methods

  • fn even(col: impl Into<Col>) -> Stop — An evenly spread stop.
  • fn mid(self, m: f64) -> Stop — Midpoint of the segment after this stop (0.02..=0.98).
  • fn curve(self, c: Curve) -> Stop
  • fn glow(self, g: f64) -> Stop

Trait implementations: Clone, Copy, Debug, From<(f64, C)>, From<Col>, From<Role>, From<Srgb8>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::gradient2::ramp::Stops

pub struct Stops { /* see fields */ }

A gradient's colour ramp: stops plus how they mix.

Public fields

fieldtype
stopsVec<Stop>
spacesuper::color::Space
smoothf640 = piecewise linear between stops, 1 = a smooth monotone spline through them.
premulboolMix premultiplied by alpha (correct transparency, the default).
loopedboolThe ramp wraps: the first stop is repeated at the end (seamless conics, flows).

Methods

  • fn new(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Stops
  • fn space(self, s: Space) -> Stops
  • fn smooth(self, s: f64) -> Stops
  • fn looped(self, on: bool) -> Stops
  • fn straight_alpha(self) -> Stops — Straight-alpha mixing (what naive toolkits do; here for comparisons).
  • fn resolve(&self, th: &Theme) -> Ramp — Resolve the colours against a theme and lay the stops out.
  • fn resolve_with(&self, f: impl Fn(Col) -> [u8; 4]) -> Ramp — Resolve with a colour lookup (tests and offline tools: |c| c.resolve(&theme).channels()).

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::kinetic::Flicker

pub struct Flicker { /* see fields */ }

A looped glitch flicker over finished text: every every seconds a burst of burst seconds shifts slices sideways, splits the colour channels and dims the text.

Public fields

fieldtype
everyf64
burstf64
amountf64

Methods

  • fn new() -> Self
  • fn every(self, secs: f64) -> Self
  • fn burst(self, secs: f64) -> Self
  • fn amount(self, a: f64) -> Self — Displacement and dimming strength, 0..=2.

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::kinetic::Kinetic

pub struct Kinetic { /* see fields */ }

A kinetic reveal. Start from [Kinetic::decode], [Kinetic::typewriter] or [Kinetic::stagger] and chain.

Public fields

fieldtype
modeMode
orderReveal
seedu64
durationf64Seconds from the first to the last glyph settling.
cpsOption<f64>Typewriter speed in glyphs per second (overrides duration).
delayf64Seconds to wait before starting.
glyphsGlyphs
caretbool
glowOption<ui::el::Col>Colour of the glow trail on newly revealed glyphs (None: no glow).
glow_secsf64
accentui::el::ColColour of scramble glyphs and freshly revealed ones; they cool into the text colour.
flickerOption<Flicker>
exitboolPlay in reverse: the text is shown, then leaves.
holdOption<f64>Reveal, stay for this long, then leave (one shot).
replayOption<String>Play again whenever this store counter changes.
tick_hzf64Scramble glyphs change this many times a second.

Methods

  • fn decode() -> Self — Random glyphs settle into the text.
  • fn typewriter() -> Self — One glyph at a time (.caret() adds a blinking caret, .cps(..) sets the speed).
  • fn stagger() -> Self — Glyphs fade, slide and scale in on a spring with overshoot.
  • fn seed(self, seed: u64) -> Self
  • fn duration(self, secs: f64) -> Self
  • fn cps(self, glyphs_per_sec: f64) -> Self
  • fn delay(self, secs: f64) -> Self
  • fn order(self, o: Reveal) -> Self
  • fn glyphs(self, g: Glyphs) -> Self
  • fn caret(self) -> Self — A blinking caret after the last typed glyph (typewriter), lingering about a second at the end.
  • fn glow(self, c: impl Into<Col>) -> Self — A glow trail on glyphs as they land, fading over glow_secs.
  • fn glow_secs(self, secs: f64) -> Self
  • fn accent(self, c: impl Into<Col>) -> Self
  • fn tick_hz(self, hz: f64) -> Self — How many times a second scramble glyphs change (default 30).
  • fn flicker(self, f: Flicker) -> Self — Looped glitch flicker once the text is on screen.
  • fn exit(self) -> Self — The exit reveal: the text is shown, then decodes/types/staggers away.
  • fn hold(self, secs: f64) -> Self — Reveal, hold secs, then play out. Under reduced motion the text stays.
  • fn replay_on(self, key: impl AsRef<str>) -> Self — Restart whenever the store counter key changes (Action::inc(key, 1)).
  • fn total(&self, n: usize) -> f64 — Seconds from the start to the last pixel of the reveal changing: duration plus the pop, cooling and glow tails (for a text of n glyphs; a typewriter's cps sets the duration).

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::light::Flare

pub struct Flare { /* see fields */ }

Lens flare: lens_flare(Flare::new().follow_pointer()). A hot core, an anamorphic horizontal streak, ghost rings and hexagonal bokeh along the axis through the screen centre; fades as the light nears the screen edge.

Public fields

fieldtype
at[f64; 2]Light position as fractions of the screen.
colorui::el::Col
intensityf64
streakf64
ghostsusize
bokehbool
fade_fromf64Fraction of the way to the edge where the fade starts.
followbool
orbitf64Cycles per second of an animated Lissajous path around at (0 = fixed).
blendaster_ui::BlendMode

Methods

  • fn new() -> Self
  • fn at(self, x: f64, y: f64) -> Self
  • fn color(self, c: impl Into<Col>) -> Self
  • fn intensity(self, v: f64) -> Self
  • fn streak(self, v: f64) -> Self — Length of the horizontal streak 0..=2 (0 = none).
  • fn ghosts(self, n: usize) -> Self — Number of ghosts 0..=7.
  • fn bokeh(self, on: bool) -> Self — Hexagonal bokeh on every other ghost (false: rings only).
  • fn fade_from(self, v: f64) -> Self — Fade begins this far (0..1) from the centre toward the edge.
  • fn follow_pointer(self) -> Self — The light follows the pointer (static at at without one and under reduced motion).
  • fn orbit(self, cps: f64) -> Self — The light drifts on a slow path around at, cps cycles per second (static under reduced motion).
  • fn blend(self, mode: BlendMode) -> Self
  • fn spec(&self, at: [f64; 2], rgb: [u8; 3], alpha: f64, size: [f64; 2]) -> FlareSpec — The spec for a w x h picture with the light at fractions at (edge falloff applied).
  • fn el(self) -> El

Trait implementations: Clone, Copy, Debug, Default, From<Flare>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::light::FlareSpec

pub struct FlareSpec { /* see fields */ }

Parameters of the flare kernel. Positions and lengths are in output pixels.

Public fields

fieldtype
light[f64; 2]
size[f64; 2]
color[u8; 3]
intensityf64Already includes the edge falloff.
streakf64Length of the anamorphic streak as a fraction of the width (0 = none).
ghostsusize
bokehboolHexagonal bokeh on every other ghost (rings otherwise).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::light::LightShafts

pub struct LightShafts { /* see fields */ }

Volumetric light shafts: light_shafts(LightShafts::from(0.7, 0.2).color(..)). Put it last in the root overlay (it sees everything painted before it).

Public fields

fieldtype
colorui::el::Col
intensityf64
densityf64
decayf64
reachf64Reach as a fraction of the screen diagonal.
raysf64
shimmerf64
coref64
followbool
skyOption<ui::el::El>
qualityf64
blendaster_ui::BlendModeAdditive by default: the shafts light what they cross.
directionOption<f64>The direction of the rays in degrees (0 = right, 90 = down): None radiates from the light (a sunburst), a direction makes the rays travel in parallel.
spreadf64The width of the ray fan in degrees (0 = parallel rays; the rays fan out within half of it).

Methods

  • fn from(x: f64, y: f64) -> Self — A point light at fractions (x, y) of the screen (0, 0 = top-left; may lie outside).
  • fn element(el: &El) -> Self — The light is el (a bright shape in a screen-sized box, e.g. a sun disc or a window); rays stream from its brightness.
  • fn from_el(el: &El) -> Self — The light is el: the rays stream from its brightness. Same as [LightShafts::element].
  • fn resting_at(&self) -> [f64; 2] — Where the light rests: fractions of the screen (an element light is found by its shape).
  • fn color(self, c: impl Into<Col>) -> Self
  • fn intensity(self, v: f64) -> Self
  • fn density(self, v: f64) -> Self — How dark occluders make the rays behind them 0..=2.
  • fn decay(self, v: f64) -> Self — 0.9..1: lower weighs occluders near the lit pixel more (short, local shadows).
  • fn reach(self, v: f64) -> Self
  • fn rays(self, v: f64) -> Self — Contrast of the angular streaks 0..1.
  • fn shimmer(self, rate: f64) -> Self — Slow noise shimmer in ray cells per second (0 = still: a static light is a cache hit).
  • fn core(self, v: f64) -> Self
  • fn follow_pointer(self) -> Self — The light follows the pointer (a point light moves to it, an element is carried along); without a pointer, or under reduced motion, it rests at its own place.
  • fn sky(self, backdrop: &El) -> Self — The backdrop alone (the full-bleed background, as for GlassExt::glass): whatever differs from it counts as an occluder. Without it the screen's border colour is the sky.
  • fn quality(self, lo: f64) -> Self — Working resolution as a fraction of the screen (0.25..=0.5; default 0.25).
  • fn blend(self, mode: BlendMode) -> Self
  • fn direction(self, angle_deg: f64) -> Self — The rays leave the light in this direction (degrees: 0 = right, 90 = down) and travel in parallel: a window casts a beam instead of a sunburst, and the occluders cast parallel shadows. Without a direction the light radiates as before.
  • fn spread(self, deg: f64) -> Self — The rays fan out within half this angle (degrees) of the direction (0 = parallel rays, up to 180: a half-plane).
  • fn directional(self, angle_deg: f64, spread_deg: f64) -> Self — The rays leave the light in this direction (degrees) and fan out within it.
  • fn el(self) -> El

Trait implementations: Clone, Debug, From<LightShafts>

structaster_blueprint::ui::fx::light::Mask

pub struct Mask { /* see fields */ }

A single-channel picture (occlusion or emission 0..1).

Public fields

fieldtype
wusize
husize
vVec<f32>

Methods

  • fn new(w: usize, h: usize) -> Mask

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::light::ShaftGeo

pub struct ShaftGeo { /* see fields */ }

The time-independent part of a shaft picture: per pixel [pre, own, theta, core] (own is NaN where nothing is lit), so a shimmering light with a still silhouette only reshades.

structaster_blueprint::ui::fx::light::ShaftSpec

pub struct ShaftSpec { /* see fields */ }

Parameters of the shaft kernel. Lengths are in mask pixels.

Public fields

fieldtype
light[f64; 2]
color[u8; 3]
intensityf64
densityf64How strongly occluders darken the rays behind them (0..=2).
decayf64Per-ray weight kept at the far end of a ray is decay^32: 1 counts occluders anywhere along it.
reachf64Distance at which the light has faded out.
raysf64Contrast of the angular ray streaks 0..1.
shimmerf64Ray drift in cells per second (0 = frozen) at clock time.
timef64
coref64Strength of the hot core around the light.
litf64Light that still lands on the occluders themselves 0..1.
stepsusize
seedu64
dirOption<[f64; 2]>The rays travel in this direction (a unit vector) instead of radiating from the light: None is the radial sunburst.
spreadf64The half-angle of the ray fan in radians (0 = parallel rays).

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::math::Lab

pub struct Lab { /* see fields */ }

A colour in Oklab plus alpha 0..=1: gradients interpolate here, so mid-points of two saturated colours stay clean instead of going muddy.

Public fields

fieldtype
lf64
af64
bf64
alphaf64

Methods

  • fn from_srgb(c: [u8; 4]) -> Lab
  • fn to_srgb(self) -> [u8; 4]
  • fn mix(self, o: Lab, t: f64) -> Lab

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::math::Ramp

pub struct Ramp { /* see fields */ }

Colour stops along 0..1 (positions sorted, equally spaced by default), sampled in Oklab.

Methods

  • fn even(cols: &[[u8; 4]]) -> Ramp — Equally spaced stops; one colour gives a flat ramp, none a transparent one.
  • fn looped(cols: &[[u8; 4]]) -> Ramp — Same, but the ramp wraps: the last stop is the first again (conic gradients).
  • fn at(&self, t: f64) -> Lab

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::neu::Aurora

pub struct Aurora { /* see fields */ }

The colours the aurora is made of, taken from a theme once: a plain copyable value the contrast audit keeps beside a paint, so it can measure a text against the backdrop under its own box.

Methods

  • fn of(th: &design::Theme, view: [f64; 2]) -> Aurora — The aurora of a theme: its page colour (a shade deeper under the soft-UI material, so a raised surface can throw a light shadow) and its accent, info and secondary colours.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::neu::Local

pub struct Local { /* see fields */ }

What the contrast audit may know about an aurora picture: the colours it can show under a given box. The audit keeps one beside the paint and asks it for the text's own box, so a text is measured against the backdrop under it, not against the brightest colour anywhere on the page.

Methods

  • fn range(&self, r: [f64; 4], panel: [f64; 4]) -> [Srgb8; 2] — The darkest and the lightest colour the picture shows under r ([x, y, w, h] on the screen); panel is the box of the picture itself (the frosted panel: its specular band and its edge glow count near its edges).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::particles::Burst

pub struct Burst(..)

What a click throws: a [Particles] system fired at the pointer.

Public fields

fieldtype
0Particles

Methods

  • fn sparks() -> Self
  • fn confetti() -> Self
  • fn pulse() -> Self — A soft ring of dots that expands and fades (a ripple of light).
  • fn seed(self, seed: u64) -> Self
  • fn count(self, n: usize) -> Self
  • fn colors(self, cols: impl IntoIterator<Item = impl Into<Col>>) -> Self
  • fn duration(&self) -> f64 — Longest time any particle of a burst lives, in seconds.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::particles::Dot

pub struct Dot { /* see fields */ }

One particle at one instant.

Public fields

fieldtype
xf64
yf64
sizef64Diameter in px.
rgb[u8; 3]
alphaf64
squashf64Width factor 0..1 (flip of a flake).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::particles::LifeAt

pub struct LifeAt(..)

How a particle system is timed (see [eval]).

Methods

  • fn cycle(t: f64) -> Self — Endless field at clock t seconds.
  • fn once(n: u64, age: f64, origin: [f64; 2]) -> Self — Burst number n born at element-local origin, age seconds ago.

Trait implementations: Clone, Copy, Debug

structaster_blueprint::ui::fx::particles::Particles

pub struct Particles { /* see fields */ }

A particle system description. Build with a preset and chain the knobs.

Public fields

fieldtype
seedu64
countusize
emitterEmitter
life(f64, f64)Lifetime range in seconds.
speed(f64, f64)Launch speed range in px/s.
dir(f64, f64)Launch direction: centre and spread in degrees (0 = right, -90 = up).
gravity[f64; 2]Constant acceleration in px/s^2 (positive y = down).
dragf64Linear drag per second.
swirlf64Swirl sway amplitude in px (a curl-like wander around the ballistic path).
size(f64, f64)Diameter in px at birth and at death.
size_jitterf64Per-particle size variation 0..1.
colorsVec<ui::el::Col>Colour over life.
opacityf64Peak opacity 0..1.
fade(f64, f64)Fractions of life spent fading in and out.
twinklef64Twinkle depth 0..1 (stars).
hotf64Whitening of the core 0..1.
halof64Extra large faint halo 0..1.
hardf64Edge hardness of dots 0..1.
trailusizeTrailing copies behind the head (sparks), each fainter.
shapeShape
stepf64Ambient fields redraw every step seconds (0 = every frame). Slow drifts look the same at 20 fps and cost a third; staggered by seed so fields do not all redraw on one frame.
by_particleboolEach particle takes one of the colors for its whole life instead of cooling through them (confetti).
blendaster_ui::BlendModeHow the sprites combine with what is beneath: Add makes sparks, embers and star halos light up their surroundings (the presets that glow choose it); SourceOver is ordinary paint.

Methods

  • fn dust() -> Self — Slow, tiny motes drifting upward through the light.
  • fn stars() -> Self — Fixed stars that twinkle.
  • fn embers() -> Self — Glowing embers rising from the bottom edge and cooling from yellow to red.
  • fn sparks() -> Self — A quick radial spray with trails; meant for [Burst].
  • fn confetti() -> Self — Tumbling confetti falling from a burst point.
  • fn seed(self, seed: u64) -> Self
  • fn count(self, n: usize) -> Self
  • fn emitter(self, e: Emitter) -> Self
  • fn life(self, min: f64, max: f64) -> Self
  • fn speed(self, min: f64, max: f64) -> Self
  • fn dir(self, centre_deg: f64, spread_deg: f64) -> Self
  • fn gravity(self, gx: f64, gy: f64) -> Self
  • fn drag(self, k: f64) -> Self
  • fn swirl(self, px: f64) -> Self
  • fn size(self, start: f64, end: f64) -> Self
  • fn colors(self, cols: impl IntoIterator<Item = impl Into<Col>>) -> Self — Colours over life (one colour is flat; several cool from the first to the last).
  • fn opacity(self, a: f64) -> Self
  • fn twinkle(self, depth: f64) -> Self
  • fn blend(self, mode: aster_ui::BlendMode) -> Self — Combine the sprites with what is beneath using mode (the glowing presets use Add).
  • fn halo(self, h: f64) -> Self
  • fn palette(self) -> Self — Each particle keeps one colour of colors for life instead of cooling through them.
  • fn step(self, secs: f64) -> Self — Redraw every secs seconds (0 = every frame).
  • fn trail(self, n: usize) -> Self
  • fn key(&self) -> u64 — Hash of every field: the layer cache key.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::pool::Job

pub struct Job<T> { /* see fields */ }

A job that runs on the pool's workers and is joined later.

The thread that submits it goes on with its own work: the job overlaps with it. The job runs on a worker, never on the submitting thread, unless it is still queued when it is joined. Dropping the job without joining it cancels it if it has not started, else lets it run out; the pool's bookkeeping is cleaned up when it has.

Methods

  • fn join(self) -> Option<T> — Wait for the job and take its value. A job that has not started yet (every worker is busy, or none could be started) is run here by the caller instead of waited for: a join never blocks on a queue, so it cannot starve or deadlock, even on a pool worker.

Trait implementations: Drop

structaster_blueprint::ui::fx::pool::Shared

pub struct Shared<T> { /* see fields */ }

A picture the pool's workers fill in parallel.

Methods

  • fn new(len: usize) -> Shared<T> where T: Default + Clone — A buffer of len elements.
  • fn from_vec(v: Vec<T>) -> Shared<T> — Take over a buffer the caller already has.
  • fn into_vec(self) -> Vec<T> — The buffer back (the pool is done with it).
  • fn len(&self) -> usize — How many elements the picture has.
  • fn is_empty(&self) -> bool — Whether the picture is empty.
  • fn get(&self) -> std::sync::MutexGuard<'_, Vec<T>> — The buffer, to read it (the workers are done by then).

Trait implementations: Clone

structaster_blueprint::ui::fx::post::ColorGrade

pub struct ColorGrade { /* see fields */ }

A colour grade. The default is the identity (Grade::default().is_identity()).

Public fields

fieldtype
exposuref32Exposure in stops (linear light multiplied by 2^exposure).
temperaturef32White balance: temperature -1 (cool) ..= 1 (warm), tint -1 (green) ..= 1 (magenta).
tintf32
toneTone
tone_strengthf32How much of the tone curve to apply 0..=1 (mixes with a plain clip).
contrastf32S-curve contrast -1..=1; endpoints (black, white) stay put.
lift[f32; 3]ASC-CDL-like display-space lift (offset), gamma and gain per channel.
gamma[f32; 3]
gain[f32; 3]
saturationf32Saturation multiplier (1 = unchanged) and vibrance -1..=1 (saturation that favours dull colours).
vibrancef32
shadows[f32; 3]Split toning: tints for shadows and highlights (sRGB 0..1), strength each 0..=1, balance -1..=1 (toward shadows..highlights).
shadow_amountf32
highlights[f32; 3]
highlight_amountf32
balancef32

Methods

  • fn is_identity(&self) -> bool

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::post::Dof

pub struct Dof { /* see fields */ }

Depth of field by distance from the focus: sharp inside it, blurred up to blur logical px of sigma at range px away, with disc-shaped bokeh highlights.

Public fields

fieldtype
focusFocus
rangef32
blurf32
bokehf32Strength of bokeh highlights 0..=2 (0 = none), the luminance they start at, and their radius in logical px.
bokeh_thresholdf32
bokeh_radiusf32

Methods

  • fn rect(r: [f64; 4]) -> Dof
  • fn focus_z(z: f64) -> Dof — Focus on depth z: the circle of confusion of every pixel comes from the .depth(z) of the element painted there (the base plane is depth 0). range defaults to 60 depth units.
  • fn id(id: impl Into<String>) -> Dof
  • fn range(self, px: f64) -> Self
  • fn blur(self, sigma: f64) -> Self
  • fn bokeh(self, strength: f64) -> Self

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::post::Grain

pub struct Grain { /* see fields */ }

Film grain: luminance-weighted, deterministic. Static unless animate (24 steps a second, never under reduced motion).

Public fields

fieldtype
strengthf32Standard deviation as a fraction of full scale, at the mid-tones.
sizef32Grain cell in logical px.
animatebool
seedu64

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::post::Halation

pub struct Halation { /* see fields */ }

Halation: the red-orange glow film makes around highlights (light bounces off the film base).

Public fields

fieldtype
thresholdf32
radiusf32Logical px.
strengthf32
tint[f32; 3]

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::post::MotionBlur

pub struct MotionBlur { /* see fields */ }

Motion blur along per-frame motion: a screen-wide vector and/or boxes that moved (logical px per frame).

Public fields

fieldtype
shutterf32Fraction of the frame the shutter is open 0..=1.
global[f32; 2]Everything moves by this (camera pan).
regionsVec<([f64; 4], [f64; 2])>[x, y, w, h] boxes with their motion [dx, dy] in logical px per frame.
tracksVec<String>Element ids whose box the post tracks frame to frame (the motion pass moves them): their delta is the vector.
bodiesboolFollow every body of the kinetic physics world: each blurs along its own velocity (kine::body_states()).
fpsf32Frames per second the velocities are turned into per-frame motion with (the clock of the screen).

Methods

  • fn global(dx: f64, dy: f64) -> Self
  • fn bodies() -> Self — Every kinetic-physics body blurs along its own velocity (px/s from kine::body_states() over fps).
  • fn fps(self, fps: f64) -> Self
  • fn track(id: impl Into<String>) -> Self
  • fn region(self, rect: [f64; 4], delta: [f64; 2]) -> Self
  • fn shutter(self, s: f64) -> Self

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::post::Post

pub struct Post { /* see fields */ }

A post-processing stack. Post::new() does nothing; add effects with the builder methods, or start from [Post::film] / [Post::for_theme].

Public fields

fieldtype
bloomOption<PostBloom>
halationOption<Halation>
streaksOption<Streaks>
dirtf32Lens dirt 0..=1: the bloom and streaks light up a procedural smudge texture.
gradeOption<super::post_color::Grade>
lutOption<std::sync::Arc<super::post_color::Lut3>>
vignetteOption<Vignette>
chromaf32Chromatic aberration: the red/blue offset at the corners, logical px.
distortionf32Barrel distortion -1..1 (corners fixed).
grainOption<Grain>
ditherbool
sharpenf32CAS sharpening 0..=1.
dofOption<Dof>
motionOption<MotionBlur>
autoboolResolve to the default preset of the theme the screen uses when built (see [Post::for_theme]).

Methods

  • fn new() -> Post — Nothing: [Post::apply] returns the picture unchanged.
  • fn auto() -> Post — The default preset of whatever theme the screen is drawn with, chosen when the element is built.
  • fn bloom(self, v: impl Into<Option<PostBloom>>) -> Self
  • fn halation(self, v: impl Into<Option<Halation>>) -> Self
  • fn streaks(self, v: impl Into<Option<Streaks>>) -> Self
  • fn grade(self, v: impl Into<Option<Grade>>) -> Self
  • fn vignette(self, v: impl Into<Option<Vignette>>) -> Self
  • fn grain(self, v: impl Into<Option<Grain>>) -> Self
  • fn dof(self, v: impl Into<Option<Dof>>) -> Self
  • fn motion(self, v: impl Into<Option<MotionBlur>>) -> Self
  • fn dirt(self, v: f64) -> Self
  • fn chroma(self, px: f64) -> Self
  • fn distortion(self, k: f64) -> Self
  • fn dither(self, on: bool) -> Self
  • fn sharpen(self, s: f64) -> Self
  • fn lut(self, lut: impl Into<Option<Arc<Lut3>>>) -> Self — A 3D LUT applied after the grade.
  • fn look(self, look: Look) -> Self — A built-in look as the LUT.
  • fn cube(self, bytes: &[u8]) -> Result<Self, LutError> — A .cube file as the LUT.
  • fn tone(self, tone: Tone, exposure_stops: f64) -> Self — The tone curve and exposure (stops) of the grade.
  • fn white_balance(self, temperature: f64, tint: f64) -> Self
  • fn saturation(self, s: f64) -> Self
  • fn contrast(self, c: f64) -> Self
  • fn split_tone(self, shadows: [f32; 3], s_amount: f64, highlights: [f32; 3], h_amount: f64) -> Self — Split toning: shadows and highlights tinted (sRGB colours) by amount each.
  • fn without(self, effect: &str) -> Self — Turn an effect off by name: bloom, halation, streaks, dirt, grade, lut, vignette, chroma, distortion, grain, dither, sharpen, dof, motion.
  • fn effects(&self) -> Vec<&'static str> — The names of the effects that are on.
  • fn is_identity(&self) -> bool — True when [Post::apply] leaves every byte alone.
  • fn key(&self) -> u64 — A hash of every parameter.
  • fn film() -> Post — The house look for a dark UI: a gentle filmic shoulder with a touch of contrast, teal shadows and warm highlights, a soft bloom on emissive things, a little halation, a vignette, static grain, blue-noise dithering and light sharpening.
  • fn film_light() -> Post — The default for a light theme: no bloom (a white page would glow), a lighter vignette, warm grade.
  • fn for_theme(theme: &Theme) -> Post — The default preset of a theme. High-contrast themes (promise of 7:1 text) get nothing; only dithering would not change their flat colours, so they get a plain identity.
  • fn blockbuster() -> Post — The Teal & Orange look on top of [Post::film].
  • fn apply(&self, w: u32, h: u32, rgba: &[u8], env: &PostEnv) -> Vec<u8> — Run the pipeline on an RGBA8 picture (straight alpha, w x h). A picture that is not [Post::is_identity] is returned changed; an identity returns the same bytes.
  • fn apply_pix(&self, src: Pix, env: &PostEnv) -> Pix
  • fn apply_owned(&self, w: u32, h: u32, rgba: Vec<u8>, env: &PostEnv) -> Vec<u8>

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::post::PostBloom

pub struct PostBloom { /* see fields */ }

Bloom: light above a threshold glows. Thresholded on a half-resolution copy, so thin strokes (text) do not bloom and blobs of light (emissive buttons, light shafts, glows) do.

Public fields

fieldtype
thresholdf32Linear luminance above which light blooms (UI white is 1.0).
kneef32Soft knee 0..1: the transition below the threshold, as a fraction of it.
strengthf32Fraction of the above-threshold light that is re-emitted into the glow 0..=2.
spreadf32Weight of each coarser mip level in the recombination 0..1 (more: a wider, softer glow).
levelsu8
tint[f32; 3]Multiplied into the glow (white = the source's own colour).

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::post::PostEnv

pub struct PostEnv { /* see fields */ }

What the pipeline needs beyond the picture and the parameters.

Public fields

fieldtype
scalef32Device pixels per logical pixel.
frameu32Grain frame (0 = the still pattern). Only used when the grain animates.
reduced_motionbool
focusOption<[f32; 4]>Focus rectangle in device px of the picture.
motionVec<([f32; 4], [f32; 2])>Motion boxes in device px of the picture, with device px per frame.
depthVec<([f32; 4], f32)>Element depths in device px of the picture, nearest last: [x, y, w, h] and z (the depth registry, for Focus::Z).

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::post::PostLut

pub struct PostLut { /* see fields */ }

A 3D colour lookup table over display-referred 0..=1 RGB, n^3 entries, red varying fastest (the .cube order).

Public fields

fieldtype
nusize
dataVec<[f32; 3]>
titleString
keyu64Content hash.

Methods

  • fn identity(n: usize) -> Lut3 — The identity table of size n.
  • fn from_fn(n: usize, f: impl Fn([f32; 3]) -> [f32; 3]) -> Lut3 — Bake f (display RGB 0..1 in and out) on an n^3 grid.
  • fn parse_cube(bytes: &[u8]) -> Result<Lut3, LutError> — Parse an Adobe/Resolve .cube 3D LUT: TITLE, LUT_3D_SIZE n, DOMAIN_MIN/MAX (rescaled to 0..1), then n^3 rows of three floats.
  • fn to_cube(&self) -> String — Write the table as .cube text.
  • fn sample(&self, c: [f32; 3]) -> [f32; 3] — Tetrahedral interpolation (what grading tools use: exact on the grey diagonal, no trilinear colour casts).
  • fn sample_trilinear(&self, c: [f32; 3]) -> [f32; 3] — Trilinear interpolation (reference; the tests compare it with [Lut3::sample]).

Trait implementations: Clone, Debug, PartialEq

structaster_blueprint::ui::fx::post::Streaks

pub struct Streaks { /* see fields */ }

Anamorphic streaks: bright points smear into horizontal blue lines.

Public fields

fieldtype
thresholdf32
lengthf32Half length in logical px.
strengthf32
tint[f32; 3]

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::post::Vignette

pub struct Vignette { /* see fields */ }

Vignette: the corners fall away. size is where it starts (fraction of the corner distance), roundness 0 follows the screen rectangle, 1 is a circle; smoothness widens the falloff.

Public fields

fieldtype
strengthf32
sizef32
roundnessf32
smoothnessf32

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::post_color::Baked

pub struct Baked { /* see fields */ }

A [Grade] baked for the per-pixel loop.

Public fields

fieldtype
lutOption<std::sync::Arc<Lut3>>
keyu64
byteVec<[f32; 3]>Display colour of every input byte through the per-channel tables (the fast path for 8-bit sources).

Methods

  • fn new(g: &Grade, lut: Option<Arc<Lut3>>) -> Baked
  • fn apply(&self, lin: [f32; 3]) -> [f32; 3] — Linear scene colour -> display colour 0..=1.
  • fn has_cross(&self) -> bool — True when [Baked::cross_over] does anything.
  • fn cross_over(&self, c: [f32; 3]) -> [f32; 3] — The cross-channel part of the grade (saturation, vibrance, split toning, 3D LUT) on a display colour.
  • fn is_plain(&self) -> bool — True when [Baked::apply] is only the sRGB round trip (no grade, no LUT, no tone).

structaster_blueprint::ui::fx::post_color::Grade

pub struct Grade { /* see fields */ }

A colour grade. The default is the identity (Grade::default().is_identity()).

Public fields

fieldtype
exposuref32Exposure in stops (linear light multiplied by 2^exposure).
temperaturef32White balance: temperature -1 (cool) ..= 1 (warm), tint -1 (green) ..= 1 (magenta).
tintf32
toneTone
tone_strengthf32How much of the tone curve to apply 0..=1 (mixes with a plain clip).
contrastf32S-curve contrast -1..=1; endpoints (black, white) stay put.
lift[f32; 3]ASC-CDL-like display-space lift (offset), gamma and gain per channel.
gamma[f32; 3]
gain[f32; 3]
saturationf32Saturation multiplier (1 = unchanged) and vibrance -1..=1 (saturation that favours dull colours).
vibrancef32
shadows[f32; 3]Split toning: tints for shadows and highlights (sRGB 0..1), strength each 0..=1, balance -1..=1 (toward shadows..highlights).
shadow_amountf32
highlights[f32; 3]
highlight_amountf32
balancef32

Methods

  • fn is_identity(&self) -> bool

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::post_color::Lut3

pub struct Lut3 { /* see fields */ }

A 3D colour lookup table over display-referred 0..=1 RGB, n^3 entries, red varying fastest (the .cube order).

Public fields

fieldtype
nusize
dataVec<[f32; 3]>
titleString
keyu64Content hash.

Methods

  • fn identity(n: usize) -> Lut3 — The identity table of size n.
  • fn from_fn(n: usize, f: impl Fn([f32; 3]) -> [f32; 3]) -> Lut3 — Bake f (display RGB 0..1 in and out) on an n^3 grid.
  • fn parse_cube(bytes: &[u8]) -> Result<Lut3, LutError> — Parse an Adobe/Resolve .cube 3D LUT: TITLE, LUT_3D_SIZE n, DOMAIN_MIN/MAX (rescaled to 0..1), then n^3 rows of three floats.
  • fn to_cube(&self) -> String — Write the table as .cube text.
  • fn sample(&self, c: [f32; 3]) -> [f32; 3] — Tetrahedral interpolation (what grading tools use: exact on the grey diagonal, no trilinear colour casts).
  • fn sample_trilinear(&self, c: [f32; 3]) -> [f32; 3] — Trilinear interpolation (reference; the tests compare it with [Lut3::sample]).

Trait implementations: Clone, Debug, PartialEq

structaster_blueprint::ui::fx::post_lens::DCache

pub struct DCache { /* see fields */ }

Per 8x8 cell: how much fine detail (text strokes, hairlines) the source has there 0..=1, and the hashes that let the next frame keep the cell rows whose source rows did not change.

Public fields

fieldtype
wusize
husize
hashesVec<u64>
dVec<f32>

Trait implementations: Clone, Default

structaster_blueprint::ui::fx::post_lens::DofParams

pub struct DofParams { /* see fields */ }

Depth of field on a full-resolution linear image: blends the sharp image with two half-resolution blurs by the circle of confusion. Bokeh: bright pixels in out-of-focus areas are gathered over a disc (a quarter-resolution pass) and added.

Public fields

fieldtype
focus[f32; 4]
rangef32
max_sigmaf32
bokehf32
bokeh_thresholdf32
bokeh_radiusf32
mapOption<(Vec<f32>, usize, usize)>Circle of confusion 0..=1 per quarter-resolution cell (w/4 x h/4), when it comes from element depth instead of a rectangle.

structaster_blueprint::ui::fx::post_lens::Lo

pub struct Lo { /* see fields */ }

A linear-light RGB image.

Public fields

fieldtype
wusize
husize
dVec<[f32; 3]>

Methods

  • fn new(w: usize, h: usize) -> Lo
  • fn energy(&self) -> f64 — Total light (sum of all channels).
  • fn get(&self, x: i64, y: i64) -> [f32; 3]
  • fn bilinear(&self, fx: f32, fy: f32) -> [f32; 3] — Bilinear sample at the continuous position (fx, fy) where pixel centres are at integers.

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::fx::post_lens::QCache

pub struct QCache { /* see fields */ }

The quarter-resolution linear copy of a picture and the hash of each of its rows, so the next frame can keep the rows whose source rows did not change.

Public fields

fieldtype
wusize
husize
hashesVec<u64>
qLo

Trait implementations: Clone, Default

structaster_blueprint::ui::fx::scene3d::Camera3d

pub struct Camera3d { /* see fields */ }

Where the scene is looked at from.

Public fields

fieldtype
eyeVec3
targetVec3
upVec3
fovf64Vertical field of view in degrees (perspective).
orthoOption<f64>Some(height): orthographic, height world units tall.
nearf64
farf64

Methods

  • fn perspective(eye: Vec3, target: Vec3, fov: f64) -> Camera3d
  • fn orthographic(eye: Vec3, target: Vec3, height: f64) -> Camera3d
  • fn look_at(self, eye: Vec3, target: Vec3) -> Camera3d
  • fn fov(self, deg: f64) -> Camera3d
  • fn up(self, up: Vec3) -> Camera3d
  • fn clip(self, near: f64, far: f64) -> Camera3d
  • fn matrices(&self, aspect: f64) -> (M4, M4) — The matrices a point goes through: (view, projection) for a picture of aspect (w / h).
  • fn project(&self, p: Vec3, w: f64, h: f64) -> Option<(f64, f64, f64)> — A world point on the screen: (x, y) in 0..w x 0..h pixels (y down) and its depth in view units; None behind the camera.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::scene3d::Extrusion3d

pub struct Extrusion3d { /* see fields */ }

A 2D outline pushed into a solid: a path, a polygon or the glyphs of a text.

let logo = Extrusion3d::path(shape_commands).height(2.0).depth(0.5).bevel(0.05);
Object3d::new(logo).material(Material3d::glossy(hex(0xff7a30)))

Methods

  • fn path(cmds: impl IntoIterator<Item = ui::vector::VectorCommand>) -> Extrusion3d — The closed sub-paths of cmds (curves are flattened; sub-paths nest by even-odd, so a counter is a hole). The path's own units are scaled to height tall once .height(..) is given.
  • fn polygon(points: &[[f64; 2]]) -> Extrusion3d — A polygon (counter-clockwise or clockwise; y down like a path).
  • fn text(el: El, w: f64, h: f64) -> Extrusion3d — The glyphs of el (a text element with the font and weight you want; it is drawn white on transparent at w x h logical pixels and its outline is traced). Needs fonts, so it appears only when the scene is drawn by a screen.
  • fn height(self, h: f64) -> Self — World height of the finished outline (default 1).
  • fn depth(self, d: f64) -> Self — Thickness along z (default 0.25).
  • fn bevel(self, b: f64) -> Self — Chamfer on both faces (default 0.02): the bevel is what catches the light on an edge.
  • fn tracking(self, t: f64) -> Self — Extra space between the glyphs of an extruded text, as a fraction of its height (default 0.05): the letters of a tight font touch once they have depth.
  • fn bulge(self, b: f64) -> Self — Lean the face normals outward from the middle (0.3 a gentle dome): a flat face then sweeps its reflection across the studio like polished metal instead of showing one flat colour.
  • fn geometry(self) -> Geometry3d

Trait implementations: Clone, From<Extrusion3d>

structaster_blueprint::ui::fx::scene3d::Fog3d

pub struct Fog3d { /* see fields */ }

Volumetric fog: exponential depth fog, optional height fog, light scattered through the shadow map (god rays), noise.

Public fields

fieldtype
colorui::el::Col
densityf64
height_fallofff64
base_heightf64
scatterf64
anisotropyf64
noiseOption<FogNoise3d>
stepsusize
max_distancef64
ambientf64
motesf64

Methods

  • fn new(density: f64) -> Fog3d — Fog3d of extinction density per world unit (0.02 thin haze, 0.08 thick).
  • fn color(self, c: impl Into<Col>) -> Self
  • fn height(self, falloff: f64, base: f64) -> Self — Thin out above base: density falls by e every 1 / falloff units.
  • fn scatter(self, s: f64) -> Self — Brightness of the scattered light.
  • fn anisotropy(self, g: f64) -> Self — Phase function asymmetry -1..1 (Henyey-Greenstein): above 0 the light piles up when you look toward it.
  • fn noise(self, n: FogNoise3d) -> Self
  • fn steps(self, n: usize) -> Self — Samples per view ray (more is smoother and slower).
  • fn max_distance(self, d: f64) -> Self
  • fn motes(self, k: f64) -> Self — Dust motes that glint where the beams are (0 none, 1 subtle, 3 snowy). They drift with the scene's time.
  • fn ambient(self, a: f64) -> Self — How much the ambient light tints the fog.

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::scene3d::FogNoise3d

pub struct FogNoise3d { /* see fields */ }

Noise that makes the fog patchy and, with drift, move.

Public fields

fieldtype
scalef64Size of a cloud in world units.
strengthf640..1: how far the density swings around its mean.
driftVec3World units per second the pattern travels.
seedu32

Methods

  • fn new(scale: f64, strength: f64) -> FogNoise3d
  • fn drift(self, d: Vec3) -> Self
  • fn seed(self, s: u32) -> Self

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::scene3d::Geometry3d

pub struct Geometry3d { /* see fields */ }

What an object is made of.

Methods

  • fn cube(w: f64, h: f64, d: f64) -> Geometry3d — A box w wide, h tall, d deep.
  • fn rounded_box(w: f64, h: f64, d: f64, radius: f64) -> Geometry3d — A box with rounded edges (radius is clamped to half the smallest side).
  • fn sphere(radius: f64) -> Geometry3d
  • fn torus(major: f64, minor: f64) -> Geometry3d — A torus lying flat: ring radius major, tube radius minor.
  • fn cylinder(radius: f64, height: f64) -> Geometry3d — A capped cylinder along y.
  • fn capsule(radius: f64, length: f64) -> Geometry3d — A capsule along y: length is the straight part between the two hemispheres.
  • fn plane(w: f64, d: f64) -> Geometry3d — A flat ground plane facing up, w by d.
  • fn from_mesh(m: Mesh) -> Geometry3d — Any mesh; the scene hash covers every vertex.
  • fn from_obj(bytes: &[u8]) -> Option<Geometry3d> — A Wavefront OBJ file (v, vn, f; polygons are fanned). None when it has no face.
  • fn mesh_ref(&self) -> Option<&Mesh> — The mesh behind a geometry (None for text, which exists once the scene is drawn).

Trait implementations: Clone, From<Extrusion3d>, From<Mesh>

structaster_blueprint::ui::fx::scene3d::Light3d

pub struct Light3d { /* see fields */ }

A light: directional (a sun, with shadows), point or spot.

Public fields

fieldtype
colorui::el::Col
intensityf64
shadowbool
softnessf64
rangef64
fogf64
specularf64

Methods

  • fn directional(from: Vec3) -> Light3d — A sun shining from the direction from (a vector pointing at the light from the scene's centre). Casts shadows.
  • fn point(pos: Vec3) -> Light3d — A point light at pos; intensity is the radiant power seen at one unit.
  • fn spot(pos: Vec3, target: Vec3, inner_deg: f64, outer_deg: f64) -> Light3d — A spot light at pos aimed at target, full inside inner_deg and gone at outer_deg from the axis.
  • fn color(self, c: impl Into<Col>) -> Self
  • fn intensity(self, i: f64) -> Self
  • fn shadows(self, on: bool) -> Self — Shadow map on or off (directional lights only).
  • fn softness(self, s: f64) -> Self — Angular radius of the light as a tangent: how fast the shadow softens away from the contact (0.02 sharp, 0.12 very soft).
  • fn range(self, r: f64) -> Self — Distance at which a point or spot light is gone.
  • fn specular(self, k: f64) -> Self — Strength of this light's specular highlights (0 = diffuse only).
  • fn fog_scatter(self, k: f64) -> Self — How much of this light the fog scatters (0 hides it from the fog).

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::scene3d::Material3d

pub struct Material3d { /* see fields */ }

PBR-lite material: base colour, roughness, metalness, emissive, rim.

Public fields

fieldtype
baseui::el::Col
roughf64
metalf64
emissiveOption<(ui::el::Col, f64)>
rimf64
rim_colorOption<ui::el::Col>
double_sidedbool
receive_shadowbool
patternPattern3d
fadeOption<(f64, f64)>
reflectf64
coatf64
catcherf64
reflect_reachf64
glassf64
refractionf64
frostf64
thicknessf64
causticsf64

Methods

  • fn new(base: impl Into<Col>) -> Material3d
  • fn accent() -> Material3d — The theme's accent colour, satin.
  • fn glossy(base: impl Into<Col>) -> Material3d — Glossy with a clear coat: lacquered plastic or car paint.
  • fn matte(base: impl Into<Col>) -> Material3d
  • fn metal(base: impl Into<Col>) -> Material3d
  • fn emissive(color: impl Into<Col>, strength: f64) -> Material3d — A light source's body: shows color at strength regardless of lighting.
  • fn glass(tint: impl Into<Col>, radius: f64) -> Material3d — Transmissive glass tinted by tint (white is clear): the view through it is the rest of the scene and, when the scene has [Scene3d::refract_ui], the page beneath, bent by the surface normal like a lens, with a little chromatic spread, a Fresnel reflection of the studio and absorption that deepens toward the rim. radius is the body's size in world units (it scales the bend).
  • fn refraction(self, k: f64) -> Self — How strongly glass bends the view (default 1.6, a ball lens that inverts the view; 0 is a flat pane).
  • fn frosted(self, k: f64) -> Self — Frosted glass: blur the view through it by k (0 clear, 1 milky).
  • fn caustics(self, k: f64) -> Self — Show the bright caustic spot that glass bodies focus into their shadow on this surface (floors and shadow catchers).
  • fn shadow_catcher(strength: f64) -> Material3d — An invisible plane that only shows what the scene does to it: the shadows and contact darkening of the objects and their mirror image (reflect), composited over whatever is beneath the picture (a card, a page). strength is how dark a full shadow is.
  • fn floor() -> Material3d — A floor that takes its look from the theme: a slightly raised surface, rough, fading out at the edge, with a mirror sheen.
  • fn roughness(self, r: f64) -> Self
  • fn metallic(self, m: f64) -> Self
  • fn emission(self, color: impl Into<Col>, strength: f64) -> Self
  • fn rim(self, strength: f64, color: impl Into<Col>) -> Self — Fresnel rim light of strength (tinted by color, default the base colour brightened).
  • fn double_sided(self) -> Self
  • fn no_shadow_receive(self) -> Self
  • fn pattern(self, p: Pattern3d) -> Self
  • fn fade(self, inner: f64, outer: f64) -> Self — Fade the surface out radially (world units from the object's origin): a floor that dissolves into the page.
  • fn reflect(self, k: f64) -> Self — Show the scene's mirror image on this surface (a floor): 0..1.
  • fn reflect_reach(self, h: f64) -> Self — The mirror image fades out within h world units of height above the surface (default: a smooth exponential).
  • fn coat(self, k: f64) -> Self — A thin gloss layer over the base: reflections of the studio on top of the colour.

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::scene3d::Mesh

pub struct Mesh { /* see fields */ }

An indexed triangle mesh (counter-clockwise front faces).

Public fields

fieldtype
posVec<V3>
nrmVec<V3>
idxVec<[u32; 3]>

Methods

  • fn is_empty(&self) -> bool
  • fn triangles(&self) -> usize
  • fn bounds(&self) -> (V3, V3) — Axis-aligned bounds (min, max); a degenerate box at the origin for an empty mesh.
  • fn transform(&mut self, m: &M4) — Apply m to positions and its normal matrix to normals.
  • fn merge(&mut self, o: &Mesh)
  • fn signed_volume(&self) -> f32 — Signed volume (positive when triangles wind counter-clockwise seen from outside).
  • fn content_hash(&self) -> u64 — A key for the scene hash: depends on every vertex and index.
  • fn smooth_normals(&mut self, crease_deg: f32) — Recompute smooth normals: face normals are averaged over the faces that share a position, but only across angles below crease_deg, so a cube keeps its edges and a sphere stays round.

Trait implementations: Clone, Debug, Default, From<Mesh>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::scene3d::Object3d

pub struct Object3d { /* see fields */ }

A geometry with a transform and a material. Transform calls compose in reading order: the first one is applied to the object first, so .rotate_y(30).at(1, 0, 0) rotates in place and then moves, while .at(..).rotate_y(30) orbits.

Methods

  • fn new(geom: impl Into<Geometry3d>) -> Object3d
  • fn material(self, m: Material3d) -> Self
  • fn at(self, x: f64, y: f64, z: f64) -> Self — Move to (x, y, z).
  • fn rotate_x(self, deg: f64) -> Self
  • fn rotate_y(self, deg: f64) -> Self
  • fn rotate_z(self, deg: f64) -> Self
  • fn scale(self, s: f64) -> Self
  • fn scale_xyz(self, x: f64, y: f64, z: f64) -> Self
  • fn spin(self, deg_per_s: f64) -> Self — Turn about the object's own up axis at deg_per_s (an animated scene; a still frame shows the angle at its time).
  • fn casts_shadow(self, on: bool) -> Self — Whether the object throws shadows (default yes).
  • fn occludes(self, on: bool) -> Self — Whether the object darkens the ambient light around it (contact shadow; default yes).
  • fn reflected(self, on: bool) -> Self — Whether the object shows in a floor's reflection (default yes).
  • fn ground(size: f64, y: f64) -> Object3d — A ground plane: size square, takes the theme's floor material, throws no shadow and darkens nothing.

Trait implementations: Clone

structaster_blueprint::ui::fx::scene3d::Scene3d

pub struct Scene3d { /* see fields */ }

A scene: camera, objects, lights, environment, fog and finishing. Build it, then scene3d(scene).

Methods

  • fn new() -> Scene3d — An empty scene: a camera 6 units back looking at the origin, no lights (add some, or use [Scene3d::studio]).
  • fn studio() -> Scene3d — A product-shot studio that takes its colours from the theme: a warm shadow-casting key light, a cool fill, an accent-tinted rim light from behind, and a sky with two softboxes for the reflections. Add objects and a camera.
  • fn camera(self, c: Camera3d) -> Self
  • fn object(self, o: Object3d) -> Self
  • fn objects(self, os: impl IntoIterator<Item = Object3d>) -> Self
  • fn light(self, l: Light3d) -> Self
  • fn clear_lights(self) -> Self — Drop the studio's lights (and softboxes) and start from yours.
  • fn sky(self, top: impl Into<Col>, horizon: impl Into<Col>, ground: impl Into<Col>) -> Self — Sky gradient (zenith, horizon) and the ground colour bounced back up: the hemisphere light and what glossy surfaces reflect.
  • fn softbox(self, from: Vec3, w_deg: f64, h_deg: f64, color: impl Into<Col>, intensity: f64) -> Self — A softbox (a bright rectangle in the sky) that glossy surfaces reflect: it lights nothing but their highlights.
  • fn ambient(self, k: f64) -> Self — Strength of the ambient (hemisphere and reflection) light.
  • fn occlusion(self, k: f64) -> Self — Contact darkening from the objects' bulk (0 off, 1 strong).
  • fn fog(self, f: Fog3d) -> Self
  • fn backdrop(self, b: Backdrop3d) -> Self
  • fn exposure(self, e: f64) -> Self — Exposure multiplier before tone mapping.
  • fn bloom(self, k: f64) -> Self — A soft glow around the brightest parts.
  • fn feather(self, f: f64) -> Self — Fade the picture's alpha to nothing over this fraction (0..0.5) of its size at the edges, so fog and glow composite into the page without a visible box.
  • fn quality(self, q: Quality3d) -> Self
  • fn at_time(self, t: f64) -> Self — The scene's time in seconds for spins, orbits and fog drift (a still frame; an animated element adds the screen's clock).
  • fn orbit(self, deg_per_s: f64) -> Self — Orbit the camera around its target about the up axis at deg_per_s.
  • fn fps(self, fps: f64) -> Self — Frame rate of an animated scene (default 12, at most 60): a new picture per tick, never more.
  • fn animation_pixels(self, px: usize) -> Self — Largest picture (pixels) an animated scene renders; the painter stretches it to the element (default 160 000).
  • fn aspect(self, a: f64) -> Self — Width / height the element takes when only one side is sized (default 1.6).
  • fn refract_ui(self, on: bool) -> Self — Let glass look through to the page beneath the picture (cards, text, images painted earlier): the element then reads the screen below it, as glass_below does, and re-renders when that changes. Without it glass sees the scene and its backdrop only.
  • fn pointer_orbit(self, id: impl Into<String>, yaw_deg: f64, pitch_deg: f64) -> Self — Make the scene interactive: the camera orbits its target as the pointer moves over the element called id (yaw_deg left and right, pitch_deg up and down at the edges). While the camera moves the scene renders cheaply (a third of the resolution, one sample per pixel, coarse shadows and fog, upscaled by the renderer); about 150 ms after it settles it refines to half resolution and then to full quality, and the settled frame is byte-identical to a still render at that camera.
  • fn live_cell(self, n: usize) -> Self — Size in pixels (2..=4, default 3) of the cells an interactive frame shades once per surface: bigger is faster and softer inside surfaces (edges stay crisp).
  • fn progressive(self, on: bool) -> Self — false turns the cheap moving frames off (every frame at full quality: the measuring baseline).
  • fn alt(self, text: impl Into<String>) -> Self — Name the picture for assistive tech. Without it the scene is decorative.
  • fn is_animated(&self) -> bool — Whether anything in the scene changes with time.
  • fn key(&self) -> u64 — Hash of everything that decides the picture (at the scene's own time).
  • fn render(&self, th: &Theme, w: u32, h: u32) -> Pix — Render without a screen: w x h pixels of straight-alpha RGBA8 at the scene's own time. Extruded text is skipped (it needs a screen's fonts).
  • fn render_live_preview(&self, th: &Theme, w: u32, h: u32, div: usize) -> Pix — An interactive frame (see [Scene3d::pointer_orbit]) rendered without a screen: full-resolution visibility, shading once per surface per div x div cell (2..=4), the cheap shadow, reflection and fog paths.
  • fn render_live_lowres(&self, th: &Theme, w: u32, h: u32) -> Pix — An interactive frame the way the first version drew it: the whole scene at w x h with the cheap paths (for comparison; stretch it over the element yourself).
  • fn render_hdr(&self, th: &Theme, w: u32, h: u32) -> Vec<[f32; 4]> — The same render as a linear HDR buffer (premultiplied RGBA), for tests and tools.

Trait implementations: Clone, Default

structaster_blueprint::ui::fx::scene3d::mesh::Mesh

pub struct Mesh { /* see fields */ }

An indexed triangle mesh (counter-clockwise front faces).

Public fields

fieldtype
posVec<V3>
nrmVec<V3>
idxVec<[u32; 3]>

Methods

  • fn is_empty(&self) -> bool
  • fn triangles(&self) -> usize
  • fn bounds(&self) -> (V3, V3) — Axis-aligned bounds (min, max); a degenerate box at the origin for an empty mesh.
  • fn transform(&mut self, m: &M4) — Apply m to positions and its normal matrix to normals.
  • fn merge(&mut self, o: &Mesh)
  • fn signed_volume(&self) -> f32 — Signed volume (positive when triangles wind counter-clockwise seen from outside).
  • fn content_hash(&self) -> u64 — A key for the scene hash: depends on every vertex and index.
  • fn smooth_normals(&mut self, crease_deg: f32) — Recompute smooth normals: face normals are averaged over the faces that share a position, but only across angles below crease_deg, so a cube keeps its edges and a sphere stays round.

Trait implementations: Clone, Debug, Default, From<Mesh>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::scene3d::render::RCam

pub struct RCam { /* see fields */ }

Public fields

fieldtype
eyeV3
viewM4
projM4
orthobool
forwardV3

Trait implementations: Clone

structaster_blueprint::ui::fx::scene3d::render::RFog

pub struct RFog { /* see fields */ }

Public fields

fieldtype
colorV3
densityf32Extinction per world unit at the base height.
height_fallofff32
base_heightf32
scatterf32In-scatter brightness of the lights.
gf32
noiseOption<RNoise>
stepsusize
max_distf32
ambientf32Contribution of the ambient light to the fog's colour.
motesf32Strength of the dust motes that glint in the beams (0 = none).

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::scene3d::render::RLight

pub struct RLight { /* see fields */ }

Public fields

fieldtype
kindLKind
colorV3Linear colour times intensity.
shadowbool
softnessf32Tangent of the light's angular radius (penumbra growth).
rangef32Range window for point and spot lights (0 = none).
fogf32Fog scattering of this light relative to its surface strength.
specf32Strength of this light's specular highlight (a rim light that should not glare off floors).

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::scene3d::render::RMat

pub struct RMat { /* see fields */ }

Public fields

fieldtype
baseV3
roughf32
metalf32
emissiveV3
rimf32Fresnel rim strength and colour.
rim_colorV3
double_sidedbool
receive_shadowbool
patternPattern
fadeOption<(f32, f32)>Radial fade (inner, outer) around the object's world origin on x/z: coverage goes to zero between them.
reflectf32Mirror strength of a floor (0 = none): this object shows the scene's reflection.
coatf32Clear-coat gloss on top of the base layer (0..1).
reflect_reachf32Height (world units) above the floor at which the mirror image has faded out (0 = a smooth exponential fade).
glassf32Transmissive glass (0 = opaque): what is behind is seen through the surface, bent by the normal.
refractf32How far the view through glass is bent, as a fraction of the object's radius in pixels.
frostf32Blur of the view through the glass (frosted), as a fraction of the bend.
thicknessf32Effective radius of the glass body in world units (scales the bend).
causticf32Strength of the caustic spot this (floor) surface shows under glass objects.
catcherf32A shadow catcher: shows only shadow and reflection, with this much shadow strength (0 = an ordinary surface).

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::scene3d::render::RNoise

pub struct RNoise { /* see fields */ }

Public fields

fieldtype
seedu32
scalef32
strengthf32
driftV3
timef32

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::scene3d::render::RObj

pub struct RObj { /* see fields */ }

Public fields

fieldtype
meshstd::sync::Arc<super::mesh::Mesh>
xfM4
matRMat
castbool
occludeboolOccludes ambient light on other surfaces (contact darkening).
mirroredboolAppears in the floor reflection.

Trait implementations: Clone

structaster_blueprint::ui::fx::scene3d::render::RScene

pub struct RScene { /* see fields */ }

Public fields

fieldtype
camRCam
objsVec<RObj>
lightsVec<RLight>
sky_topV3
sky_horizonV3
groundV3
boxesVec<SoftBox>
envf32
aof32
fogOption<RFog>
bgBg
exposuref32
bloomf32
featherf32
ssusize
shadow_resusize
floor_yf32Plane height of the mirror floor.
underOption<std::sync::Arc<Vec<V3>>>What the page looks like beneath the picture (linear RGB, under_dims wide and tall): seen through glass.
under_dims[usize; 2]
static_keyu64Hash of everything but the camera (0 = do not cache): an interactive scene reuses its shadow maps and world triangles.
noise_eyeV3The camera position the fog noise grid is fitted around (so the grid does not move with an orbiting camera).
liveboolInteractive frame: cheaper shadow filtering, a cheaper floor reflection and coarser fog.

Trait implementations: Clone

structaster_blueprint::ui::fx::scene3d::render::SoftBox

pub struct SoftBox { /* see fields */ }

Public fields

fieldtype
dirV3
rightV3
upV3
half[f32; 2]
colorV3

Trait implementations: Clone, Debug

structaster_blueprint::ui::fx::sky::Sky

pub struct Sky { /* see fields */ }

The living part of a backdrop: layers, grain and how fast it refreshes. Backdrop::new(..).sky(Sky::new()..).

Methods

  • fn new() -> Sky — A sky with no layers yet: refreshed at most 8 times a second, 150 000 device pixels per frame at most.
  • fn layer(self, l: SkyLayer) -> Sky — Add a layer (they are composed in the order added, over the base).
  • fn grain(self, strength: f64) -> Sky — Film grain of strength (0.05 is the usual) from four pre-baked tiles that are cycled and shifted each time a tile refreshes: it flickers at the refresh rate. (The backdrop's own picture should have none.)
  • fn rate(self, hz: f64) -> Sky — Refresh each visible tile at most hz times a second (1..=60, default 8; NaN is the default).
  • fn budget(self, px: usize) -> Sky — At most px device pixels of tiles are composed in a frame (default 150 000: about 2-3 ms at 1080p). When more are stale the stalest go first and the rest wait for the next frame: the sky slows down, no frame does.

Trait implementations: Clone, Default

structaster_blueprint::ui::fx::sky::SkyLayer

pub struct SkyLayer { /* see fields */ }

One translucent layer of the sky: a scene rendered once, then moved and faded by the clock.

SkyLayer::new("clouds", || noise_fill(..)).sway(60., 20., 90.).breathe(0.3, 11.)

Methods

  • fn new(name: impl AsRef<str>, scene: impl Fn() -> El + 'static) -> SkyLayer — A layer named name (hashed: change it when scene changes) whose picture scene makes on a transparent ground. It is laid out in a box the size of the screen plus the sway margin and rendered at a quarter of the size; build it from soft things (noise, aurora, glows). It is rendered once per size, scale and theme.
  • fn sway(self, ax: f64, ay: f64, period: f64) -> SkyLayer — Travel ax, ay logical px each way over period seconds (a slow back-and-forth, so no seam ever shows).
  • fn morph(self, other: impl Fn() -> El + 'static, period: f64) -> SkyLayer — Cross-fade to other and back over period seconds (a second shape of the same cloud or aurora: nothing is generated at run time, two pictures are blended).
  • fn breathe(self, depth: f64, period: f64) -> SkyLayer — Fade between full strength and 1 - depth of it over period seconds.
  • fn additive(self) -> SkyLayer — Add the layer's light to the sky instead of laying it over (glows, shafts).
  • fn opacity(self, a: f64) -> SkyLayer — Show the layer at a times its strength (0..=1).
  • fn phase(self, seconds: f64) -> SkyLayer — Seconds to start the layer's motion at (so two layers do not move in step).
  • fn res(self, r: f64) -> SkyLayer — The layer is rendered at this fraction of the logical size (0.25..=1, default 0.25).

Trait implementations: Clone

structaster_blueprint::ui::fx::surface::TiltCard

pub struct TiltCard { /* see fields */ }

Tilt card settings.

Public fields

fieldtype
max_degf64Largest rotation in degrees at the card edge.
perspectivef64Camera distance in px (smaller = stronger perspective).
shadef64Depth shading 0..1: the side tilting away darkens, the near side lightens.
sheenf64Specular sheen strength 0..1 (a soft white glare under the pointer).
liftf64Scale-up while hovered.
springui::hx::SpringCfg

Methods

  • fn new() -> Self
  • fn max_deg(self, d: f64) -> Self
  • fn perspective(self, px: f64) -> Self
  • fn shade(self, s: f64) -> Self
  • fn sheen(self, s: f64) -> Self
  • fn lift(self, k: f64) -> Self

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::fx::surface::Warp

pub struct Warp { /* see fields */ }

One perspective tilt: rotation about X and Y (degrees), camera distance (device px), scale, depth shading, sheen strength and the pointer position on the card (0..1).

Public fields

fieldtype
rx_degf64
ry_degf64
persp_pxf64
liftf64
shadef64
sheenf64
fxf64
fyf64

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::hx::Hx

pub struct Hx<'a> { /* see fields */ }

What a [reactive] builder can see and drive. See the module docs.

Methods

  • fn seconds(&self) -> f64 — Clock in seconds (frozen at [STILL_SECONDS] under reduced motion).
  • fn seconds_stepped(&self, step: f64, salt: u64) -> f64 — The clock held on a grid of step seconds (0 = every frame), with the grid offset by a hash of salt so several slow layers do not all change on the same frame. Slow drifts (nebulae, light leaks) use this so their picture is rebuilt a few times a second, not every frame: the steps are far below what the eye can see on a smooth gradient.
  • fn age_ms(&mut self) -> u64 — Milliseconds since this element was first built (a one-shot reveal starts here). A tree resolved outside the app's motion pass has no history: it is always 0.
  • fn now_ms(&self) -> u64 — Clock in ms as the app counts it (not frozen).
  • fn reduced_motion(&self) -> bool — The user prefers reduced motion: skip travel, keep a static composed frame.
  • fn store(&self) -> &Store
  • fn theme(&self) -> &Theme
  • fn rect(&self) -> Option<[f64; 4]> — This element's box last frame as [x, y, w, h] in screen px (None on the first frame or without an .id).
  • fn rect_of(&self, id: &str) -> Option<[f64; 4]> — Box of the element with .id(id) last frame as [x, y, w, h].
  • fn pointer(&mut self) -> Option<[f64; 2]> — Hover pointer in element-local px (None when outside the element). Asking makes the app re-render on pointer moves while this element is on screen.
  • fn pointer_in(&mut self, id: &str) -> Option<[f64; 2]> — Like [Hx::pointer] for the element with .id(id) (a wrapper watching its child).
  • fn pointer_frac(&mut self) -> Option<[f64; 2]> — Hover pointer as 0..=1 fractions of the element (None when outside).
  • fn pointer_frac_in(&mut self, id: &str) -> Option<[f64; 2]> — Like [Hx::pointer_frac] for the element with .id(id).
  • fn pointer_screen(&mut self) -> Option<[f64; 2]> — Pointer in screen px regardless of the element (None when the pointer left the window).
  • fn animate_forever(&mut self) — Declare ambient (endless) motion: the host keeps presenting frames while this is on screen. Not recorded under reduced motion.
  • fn spring(&mut self, name: &str, target: [f64; 4], cfg: SpringCfg) -> [f64; 4] — A spring toward target (four lanes; unused lanes stay 0). Starts at the first target it sees, so there is no flight on the first frame.
  • fn count(&mut self, name: &str, key: &str) -> &[HxEvent] — Watch the store counter key (an Action::inc(key, 1) bumped by a click). Returns the events recorded so far for name, newest last; a new one is recorded on the frame the counter changed, at the pointer position local to this element. The first frame only learns the current value (a restored counter does not replay old bursts).
  • fn count_in(&mut self, name: &str, key: &str, id: &str) -> &[HxEvent] — Like [Hx::count], positioned inside the element with .id(id).
  • fn count_screen(&mut self, name: &str, key: &str) -> &[HxEvent] — Like [Hx::count], with the pointer position in screen px (for screen overlays without an id).

structaster_blueprint::ui::hx::HxEvent

pub struct HxEvent { /* see fields */ }

One event remembered by [Hx::count]: when (ms) and where (element-local px).

Public fields

fieldtype
at_msu64
xf64
yf64
nu641-based index of the event for this name (a stable per-event random seed).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::hx::SpringCfg

pub struct SpringCfg { /* see fields */ }

Damped spring parameters (per second): a = k (target - x) - c v.

Public fields

fieldtype
stiffnessf64
dampingf64

Methods

  • const SNAPPY: SpringCfg — Quick with a little overshoot (hover tilt, magnetic pull).
  • const SOFT: SpringCfg — Slower and softer (parallax, spotlight drift).
  • const BOUNCY: SpringCfg — Visible wobble (press feedback).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::icons::IconEl

pub struct IconEl { /* see fields */ }

An icon being configured. Chain .size(px), .color(..), .stroke(units), .filled(), then use it as a child (row([..]).child(icon) / .children) or call .el() / .into() to get an [El] for row([...]).

Methods

  • fn size(self, px: impl Into<f64>) -> Self — Side length in logical px (default 20). The stroke scales with it.
  • fn color(self, c: impl Into<Col>) -> Self — Ink colour: a Role, Role::X.tint(a), or hex(..).
  • fn stroke(self, units: impl Into<f64>) -> Self — Stroke width in grid units (default 2, i.e. size / 12 px).
  • fn filled(self) -> Self — Fill the path instead of stroking it (for user SVG paths drawn as solid shapes).
  • fn mirror_in_rtl(self) -> Self — Mirror this icon in a right-to-left subtree: a directional icon (an arrow, a chevron, a "back" mark) turns the other way, the way the reader expects. An icon that is not directional is left alone, so only the marks that mean a direction are mirrored.
  • fn id(self, id: impl AsRef<str>) -> Self — Stable element id for the UiTree.
  • fn el(self) -> El — The element (same as .into()).

Trait implementations: Clone, From<IconEl>

structaster_blueprint::ui::image::Picture

pub struct Picture(..)

An immutable decoded picture (straight-alpha RGBA8). Cheap to clone and share; build it once, draw it with [image].

Methods

  • fn rgba(w: u32, h: u32, pixels: &[u8]) -> Result<Picture, PictureError> — A picture from straight-alpha RGBA8 pixels, row after row, w * h * 4 bytes.
  • fn png(bytes: &[u8]) -> Result<Picture, PictureError> — A picture from PNG bytes (8-bit or 16-bit gray, gray+alpha, RGB, RGBA or palette; not interlaced).
  • fn size(&self) -> (u32, u32) — Width and height in pixels.
  • fn pixels(&self) -> &[u8] — The straight-alpha RGBA8 pixels.
  • fn id(&self) -> u64 — A process-local identity: two clones share it, a new picture has a new one (a new frame of a stream).

Trait implementations: Clone, Debug, PartialEq

structaster_blueprint::ui::image::PictureError

pub struct PictureError(..)

Why a picture could not be made.

Public fields

fieldtype
0String

Trait implementations: Clone, Debug, Display, Eq, Error, PartialEq, StructuralPartialEq

structaster_blueprint::ui::inputs::DatePicker

pub struct DatePicker { /* see fields */ }

Builder for [date_picker].

Methods

  • fn min(self, d: Ymd) -> Self — Earliest selectable date.
  • fn max(self, d: Ymd) -> Self — Latest selectable date.
  • fn placeholder(self, p: impl AsRef<str>) -> Self
  • fn week_start(self, d: Weekday) -> Self — The first column of the calendar (default Monday; Weekday::Sunday for the US, Saturday for much of the Middle East).
  • fn month_names(self, names: [&str; 12]) -> Self — Month names, January first (default English). The field shows the first three characters.
  • fn weekday_names(self, names: [&str; 7]) -> Self — Weekday headers, Monday first whatever [DatePicker::week_start] is (default Mo Tu We ..).
  • fn build(self) -> El

Trait implementations: From<DatePicker>

structaster_blueprint::ui::kine::Body

pub struct Body { /* see fields */ }

The physical description of a body. Build with the chained setters; every value has a good default.

Public fields

fieldtype
massOption<f64>Explicit mass; None derives it from the area (area / 10 000 * density).
densityf64
stiffnessf64Home spring: natural frequency squared (s^-2). Default 150 (about 0.5 s to come home).
dampingf64Damping ratio of the home spring (1 = critically damped, the default).
frictionf64Coulomb friction between bodies (the pair uses the geometric mean) and bounciness.
restitutionf64
layeri32Bodies collide only within a layer; higher is in front.
fixedboolA fixed body never moves (a header the others hang from) but still collides and anchors joints.
collidebool
max_offsetf64The farthest the centre may be pushed from home, px.
draggableboolThe pointer can grab it, drag it with a spring and throw it.
squashf64Stretch along the direction of motion: scale = 1 +- squash * speed / 1000 (0 = off).
gravityf64Constant downward acceleration, px/s^2 (a hanging chain; 0 = none).
dragf64Linear and angular velocity damping, 1/s (air drag; adds to the home spring's damping).
impactf64Squash on impact: a hit at 1000 px/s flattens the body by impact * 0.4 along the contact normal (0 = off).
liftf64Soft shadow depth in px while the body moves fast or is held (0 = none): the card lifts off the page.
flipboolFLIP layout: when the layout moves this element's slot (a list reflows) the body stays where it was drawn and flies to the new slot with the home spring (and collisions); at rest it is exactly where the layout puts it.

Methods

  • fn new() -> Body
  • fn fixed() -> Body — A body that never moves.
  • fn mass(self, m: f64) -> Self
  • fn density(self, d: f64) -> Self
  • fn stiffness(self, k: f64) -> Self — Home spring natural frequency squared, s^-2.
  • fn damping(self, ratio: f64) -> Self — Damping ratio of the home spring: 1 critically damped, 0.5 a lively overshoot, 0.2 wobbly.
  • fn home(self, stiffness: f64, damping_ratio: f64) -> Self — Stiffness and damping ratio together.
  • fn friction(self, f: f64) -> Self
  • fn restitution(self, e: f64) -> Self
  • fn layer(self, l: i32) -> Self
  • fn collide(self, on: bool) -> Self
  • fn max_offset(self, px: f64) -> Self
  • fn draggable(self) -> Self
  • fn gravity(self, g: f64) -> Self — Constant downward acceleration (px/s^2). With .home(0., 0.) and joints this makes a pendulum.
  • fn drag(self, c: f64) -> Self — Velocity damping (1/s), independent of the home spring.
  • fn impact(self, k: f64) -> Self — Squash on impact (see [Body::impact] field): 1 is a clear squash, 0 off.
  • fn lift(self, px: f64) -> Self — Shadow depth in px at full speed (about 700 px/s) or while held; 0 = no shadow.
  • fn pusher() -> Body — A fixed body that carries the velocity of its element: where the element moves (a shard, a cursor, a panel) it shoves bodies with real momentum. Put it on any element with an id: El::pusher().
  • fn flip(self) -> Self — Fly to new layout slots instead of jumping (list insert / remove / reorder), see [Body::flip] field.
  • fn squash(self, k: f64) -> Self

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::kine::BodyState

pub struct BodyState { /* see fields */ }

The state of one body this frame, as the world publishes it. Read-only to fields, renderers and couplings.

Public fields

fieldtype
home[f64; 4]The element's laid-out rectangle [x, y, w, h] (its home: a body springs back to it).
posV2Displacement of the centre from home, px.
velV2Velocity, px/s.
anglef64Rotation, radians (clockwise on screen), and its rate, rad/s.
spinf64
scaleV2Non-uniform scale (1 = rest): squash and stretch.
massf64Mass (area-derived by default) and the inverse; inv_mass == 0 is a fixed body.
inv_massf64
layeri32Depth layer: bodies collide only within a layer; higher is in front.
asleepboolTrue while the body is at rest at home (an idle body asks for no frames).

Methods

  • fn at_rest(home: [f64; 4]) -> BodyState — A body at rest at home.
  • fn centre(&self) -> V2 — The centre of the body on screen now.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::kine::Emitted

pub struct Emitted { /* see fields */ }

A field emitted into the world at a clock time.

Public fields

fieldtype
at_msu64Screen clock time of emission, ms.
fieldstd::rc::Rc<dyn Field>

Trait implementations: Clone

structaster_blueprint::ui::kine::Joint

pub struct Joint { /* see fields */ }

A joint between two element ids. Each end is a body (it moves) or any other element (a fixed point at the centre of its laid-out rectangle, e.g. a header). Anchors are offsets in px from the centre of the element, in its own frame (rotating with it).

Public fields

fieldtype
aString
bString
kindJointKind
a_anchorsuper::V2
b_anchorsuper::V2
softnessf64Softness of the constraint (0 = stiff, larger = springier), 1/s.

Methods

  • fn hinge(a: &str, b: &str) -> Joint — A pin between a and b; set where on each with [Joint::anchors].
  • fn spring(a: &str, b: &str, rest: f64, stiffness: f64, damping_ratio: f64) -> Joint
  • fn distance(a: &str, b: &str, len: f64) -> Joint
  • fn rope(a: &str, b: &str, max_len: f64) -> Joint
  • fn slider(a: &str, b: &str, axis: V2) -> Joint — A rail: b slides along axis (in a's frame) relative to a; add stops with [Joint::limits].
  • fn limits(self, lo: f64, hi: f64) -> Self — Stops of a slider: B's anchor stays between min and max px along the rail from A's anchor.
  • fn anchors(self, a: V2, b: V2) -> Self — Where on each element the joint attaches (px from its centre, in its own frame).
  • fn softness(self, s: f64) -> Self
  • fn key(&self) -> String — A stable key (the joint is replaced, not duplicated, when declared again).

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::kine::V2

pub struct V2 { /* see fields */ }

A 2D vector in screen px (y down).

Public fields

fieldtype
xf64
yf64

Methods

  • const ZERO: V2
  • const fn new(x: f64, y: f64) -> V2
  • fn dot(self, o: V2) -> f64
  • fn cross(self, o: V2) -> f64
  • fn len(self) -> f64
  • fn norm(self) -> V2 — The unit vector, or zero for a zero vector.
  • fn rot(self, a: f64) -> V2 — Rotated by a radians.
  • fn perp(self) -> V2 — Perpendicular (rotated +90°).

Trait implementations: Add, AddAssign, Clone, Copy, Debug, Default, Mul<f64>, Neg, PartialEq, StructuralPartialEq, Sub, SubAssign

structaster_blueprint::ui::kine::body::Body

pub struct Body { /* see fields */ }

The physical description of a body. Build with the chained setters; every value has a good default.

Public fields

fieldtype
massOption<f64>Explicit mass; None derives it from the area (area / 10 000 * density).
densityf64
stiffnessf64Home spring: natural frequency squared (s^-2). Default 150 (about 0.5 s to come home).
dampingf64Damping ratio of the home spring (1 = critically damped, the default).
frictionf64Coulomb friction between bodies (the pair uses the geometric mean) and bounciness.
restitutionf64
layeri32Bodies collide only within a layer; higher is in front.
fixedboolA fixed body never moves (a header the others hang from) but still collides and anchors joints.
collidebool
max_offsetf64The farthest the centre may be pushed from home, px.
draggableboolThe pointer can grab it, drag it with a spring and throw it.
squashf64Stretch along the direction of motion: scale = 1 +- squash * speed / 1000 (0 = off).
gravityf64Constant downward acceleration, px/s^2 (a hanging chain; 0 = none).
dragf64Linear and angular velocity damping, 1/s (air drag; adds to the home spring's damping).
impactf64Squash on impact: a hit at 1000 px/s flattens the body by impact * 0.4 along the contact normal (0 = off).
liftf64Soft shadow depth in px while the body moves fast or is held (0 = none): the card lifts off the page.
flipboolFLIP layout: when the layout moves this element's slot (a list reflows) the body stays where it was drawn and flies to the new slot with the home spring (and collisions); at rest it is exactly where the layout puts it.

Methods

  • fn new() -> Body
  • fn fixed() -> Body — A body that never moves.
  • fn mass(self, m: f64) -> Self
  • fn density(self, d: f64) -> Self
  • fn stiffness(self, k: f64) -> Self — Home spring natural frequency squared, s^-2.
  • fn damping(self, ratio: f64) -> Self — Damping ratio of the home spring: 1 critically damped, 0.5 a lively overshoot, 0.2 wobbly.
  • fn home(self, stiffness: f64, damping_ratio: f64) -> Self — Stiffness and damping ratio together.
  • fn friction(self, f: f64) -> Self
  • fn restitution(self, e: f64) -> Self
  • fn layer(self, l: i32) -> Self
  • fn collide(self, on: bool) -> Self
  • fn max_offset(self, px: f64) -> Self
  • fn draggable(self) -> Self
  • fn gravity(self, g: f64) -> Self — Constant downward acceleration (px/s^2). With .home(0., 0.) and joints this makes a pendulum.
  • fn drag(self, c: f64) -> Self — Velocity damping (1/s), independent of the home spring.
  • fn impact(self, k: f64) -> Self — Squash on impact (see [Body::impact] field): 1 is a clear squash, 0 off.
  • fn lift(self, px: f64) -> Self — Shadow depth in px at full speed (about 700 px/s) or while held; 0 = no shadow.
  • fn pusher() -> Body — A fixed body that carries the velocity of its element: where the element moves (a shard, a cursor, a panel) it shoves bodies with real momentum. Put it on any element with an id: El::pusher().
  • fn flip(self) -> Self — Fly to new layout slots instead of jumping (list insert / remove / reorder), see [Body::flip] field.
  • fn squash(self, k: f64) -> Self

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::kine::body::Joint

pub struct Joint { /* see fields */ }

A joint between two element ids. Each end is a body (it moves) or any other element (a fixed point at the centre of its laid-out rectangle, e.g. a header). Anchors are offsets in px from the centre of the element, in its own frame (rotating with it).

Public fields

fieldtype
aString
bString
kindJointKind
a_anchorsuper::V2
b_anchorsuper::V2
softnessf64Softness of the constraint (0 = stiff, larger = springier), 1/s.

Methods

  • fn hinge(a: &str, b: &str) -> Joint — A pin between a and b; set where on each with [Joint::anchors].
  • fn spring(a: &str, b: &str, rest: f64, stiffness: f64, damping_ratio: f64) -> Joint
  • fn distance(a: &str, b: &str, len: f64) -> Joint
  • fn rope(a: &str, b: &str, max_len: f64) -> Joint
  • fn slider(a: &str, b: &str, axis: V2) -> Joint — A rail: b slides along axis (in a's frame) relative to a; add stops with [Joint::limits].
  • fn limits(self, lo: f64, hi: f64) -> Self — Stops of a slider: B's anchor stays between min and max px along the rail from A's anchor.
  • fn anchors(self, a: V2, b: V2) -> Self — Where on each element the joint attaches (px from its centre, in its own frame).
  • fn softness(self, s: f64) -> Self
  • fn key(&self) -> String — A stable key (the joint is replaced, not duplicated, when declared again).

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::kine::couple::FlowField

pub struct FlowField { /* see fields */ }

The fluid's velocity as a field and a particle flow. Positions are screen px.

Public fields

fieldtype
body_gainf64How hard bodies are dragged toward the flow, 1/s.
particle_gainf64Push on a particle sampled through the plain Field interface, 1/s (0: particles ride the flow through the swarm's Flow instead).

Methods

  • fn flow_at(&self, at: V2) -> Option<V2> — Fluid velocity at a screen point, px/s (None outside the layer).

Trait implementations: Field, Flow

structaster_blueprint::ui::kine::couple::StirredFluid

pub struct StirredFluid { /* see fields */ }

Builder: a fluid layer the page stirs.

Methods

  • fn cols(self, n: usize) -> Self — Grid width in cells (the height follows the screen aspect).
  • fn config(self, c: FluidConfig) -> Self
  • fn style(self, s: FluidStyle) -> Self
  • fn emitters(self, e: impl IntoIterator<Item = Emitter>) -> Self
  • fn stir(self, k: f32) -> Self — Velocity injected along a moving element (60 = the fluid moves as fast as the element).
  • fn dye(self, amount: f32) -> Self — Dye laid along the wake.
  • fn tint(self, rgb: [f32; 3]) -> Self
  • fn calm_after(self, ms: u64) -> Self — Stop stepping and asking for frames this long after the last stir (ms).
  • fn only_prefix(self, p: &str) -> Self — Only elements whose id starts with this stir and obstruct.
  • fn obstacles(self, on: bool) -> Self
  • fn gains(self, body: f64, particle: f64) -> Self — Pull of the flow on bodies and particles (1/s).
  • fn peak(self, a: f32) -> Self — Peak opacity of the smoke (themed look), 0.1..=0.9.
  • fn el(self) -> El

Trait implementations: Clone

structaster_blueprint::ui::kine::deform::Cloth

pub struct Cloth { /* see fields */ }

A banner hanging from its top edge: a 2.5D position-based cloth (it also swings in depth, which shows as foreshortening and as light and shade in its folds), blown by fields and an optional steady breeze.

Public fields

fieldtype
nxusize
nyusize
gravityf64
breezef64Steady breeze: peak acceleration (px/s²) along x, and its gust frequency (Hz).
gustf64
dampingf64
field_gainf64
shadef64Shading strength of the folds.
fieldsVec<std::rc::Rc<dyn Field>>

Methods

  • fn new() -> Cloth
  • fn grid(self, nx: usize, ny: usize) -> Self
  • fn breeze(self, accel: f64, hz: f64) -> Self — A steady breeze of this peak acceleration (px/s²) that gusts at hz.
  • fn shade(self, s: f64) -> Self
  • fn field(self, f: Rc<dyn Field>) -> Self

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::kine::deform::Jelly

pub struct Jelly { /* see fields */ }

A soft body: a mass-spring lattice over the element's picture. It lags the body's acceleration, feels fields sampled at its nodes, and is poked by the pointer (a click dents it; a stroke drags it).

Public fields

fieldtype
nxusize
nyusize
stiffnessf64Spring of a node to its place (1/s²), damping (1/s), coupling to neighbours (1/s²).
dampingf64
couplingf64
coref64How much stiffer the middle is than the rim (a jelly wobbles at its edges).
inertiaf64Inertia: share of the body's acceleration felt by the nodes.
field_gainf64Field gain.
pokef64A click pushes the nearby nodes away by about this many px.
radiusf64Radius of a poke or stroke, px.
hoverf64Pointer stroke: acceleration per px/s of pointer speed (0 = off).
onOption<String>
fieldsVec<std::rc::Rc<dyn Field>>

Methods

  • fn new() -> Jelly
  • fn grid(self, nx: usize, ny: usize) -> Self
  • fn stiffness(self, k: f64) -> Self
  • fn damping(self, c: f64) -> Self
  • fn poke(self, px: f64) -> Self
  • fn hover(self, g: f64) -> Self
  • fn inertia(self, g: f64) -> Self
  • fn on(self, key: &str) -> Self — Poke on a store counter (Action::inc(key, 1)) instead of a click on the element itself.
  • fn field(self, f: Rc<dyn Field>) -> Self — A field this jelly always feels (published fields are felt too).

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::kine::deform::Lattice

pub struct Lattice { /* see fields */ }

A displacement lattice over the element's box: nx * ny nodes at an even grid, displacements in logical px.

Public fields

fieldtype
nxusize
nyusize
dispVec<super::V2>
smoothboolCatmull-Rom smooth between nodes (jelly, cloth) rather than bilinear (an affine squash is exact).
shadeOption<Vec<f32>>Optional brightness per node (cloth folds), 1 = unchanged.

Methods

  • fn zero(nx: usize, ny: usize, smooth: bool) -> Lattice
  • fn eval(&self, u: f64, v: f64) -> V2 — Displacement at box fractions (u, v) in 0..=1.
  • fn is_zero(&self) -> bool

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::kine::deform::Squash

pub struct Squash { /* see fields */ }

Squash and stretch from a body's velocity: the picture elongates along its velocity and squashes on impact (a sudden change of velocity), volume preserved (area is conserved: the stretch along one axis is the inverse of the other), with a spring that wobbles it back.

Public fields

fieldtype
stretchf64Largest speed stretch as a log factor (0.16 = 17 % longer along the velocity).
v_reff64Speed (px/s) at which the stretch is about 76 % of the maximum (tanh).
impactf64Impact gain: strain rate kicked per v_ref of velocity change.
a_minf64Acceleration (px/s²) above which a velocity change counts as an impact.
stiffnessf64Spring stiffness (1/s²) and damping (1/s) of the strain.
dampingf64
maxf64Hard limit of the log strain.

Methods

  • fn new() -> Squash
  • fn subtle() -> Squash — Barely there: for UI that should feel alive but calm.
  • fn cartoon() -> Squash — A cartoon: long stretch, deep squash, a long wobble.
  • fn stretch(self, s: f64) -> Self
  • fn impact(self, g: f64) -> Self
  • fn spring(self, stiffness: f64, damping: f64) -> Self

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::kine::effect::Emission

pub struct Emission { /* see fields */ }

A field to emit, with the visible part that travels with it and where it starts.

Methods

  • fn new(s: impl Spawn + 'static) -> Emission
  • fn visual(self, v: Visual) -> Self — Replace the default visible part.
  • fn no_visual(self) -> Self — The field alone, with nothing drawn.
  • fn at_pointer(self) -> Self — Start at the pointer even from [El::on_click_emit].
  • fn at_centre(self) -> Self — Start at the carrier element's centre.
  • fn field_at(&self, at: V2) -> Rc<dyn Field> — The field started at at.

Trait implementations: Clone, From<S>

structaster_blueprint::ui::kine::effect::KineFx

pub struct KineFx { /* see fields */ }

The effect layer: turns click and ambient emissions into fields and draws their visible part. Put it last in the root overlay.

Methods

  • fn new() -> KineFx
  • fn wake(self) -> Self — Emit a [PointerWake] while the pointer moves faster than 160 px/s.
  • fn no_field_visuals(self) -> Self — Draw only what comes through emissions (click, ambient): not swirls, lenses, streaks or rings of fields sent with a bare kine::emit.
  • fn wake_with(self, radius: f64, drag: f64) -> Self — A wake with its radius (px) and drag (1/s).
  • fn el(self) -> El

Trait implementations: Clone, Copy, Debug, Default, From<KineFx>

structaster_blueprint::ui::kine::effect::Visual

pub struct Visual { /* see fields */ }

The visible part of an effect: a distortion ring, an additive glow at the front and a flash at the origin.

Public fields

fieldtype
speedf64Front speed, px/s (match the field's).
widthf64Half width of the front, px.
lifef64Seconds the ring lives.
distortf64Peak displacement of the distortion ring, px (0 = none).
fringef64Prismatic fringe 0..1 on the distortion and on the glow edge.
glowf64Brightness of the glow at the front 0..1 (0 = none).
flashf64Brightness of the flash at the origin 0..1 (0 = none).
colorui::el::Col

Methods

  • fn none() -> Visual — Nothing visible.
  • fn shockwave(w: &Shockwave) -> Visual — The ring that travels with a [Shockwave].
  • fn ripple(r: &Ripple) -> Visual — A ring that travels with a [Ripple] (gentler, no flash).
  • fn flash(intensity: f64) -> Visual — Only a flash at the origin.
  • fn distort(self, px: f64) -> Self
  • fn glow(self, k: f64) -> Self
  • fn flash_level(self, k: f64) -> Self
  • fn fringe(self, k: f64) -> Self
  • fn color(self, c: impl Into<Col>) -> Self

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::kine::field::Attractor

pub struct Attractor { /* see fields */ }

A pull toward (or, with a negative strength, a push away from) a point.

Public fields

fieldtype
atsuper::V2
strengthf64Acceleration at the centre of the falloff, px/s²; negative repels.
radiusf64Where the falloff reaches its end, px.
falloffFalloff
softenf64Inside this distance the force stops growing (no singularity at the centre), px.
swirlf64Sideways acceleration (a spiral), as a fraction of the radial one.
lifef64
attackf64
releasef64

Methods

  • fn new(at: V2) -> Attractor — A pull toward at.
  • fn repulsor(at: V2) -> Attractor — A push away from at.
  • fn strength(self, accel: f64) -> Self
  • fn radius(self, px: f64) -> Self
  • fn falloff(self, f: Falloff) -> Self
  • fn swirl(self, k: f64) -> Self
  • fn life(self, seconds: f64) -> Self
  • fn fade(self, attack: f64, release: f64) -> Self
  • fn at(self, at: V2) -> Self

Trait implementations: Clone, Copy, Debug, Field, PartialEq, Spawn, StructuralPartialEq

structaster_blueprint::ui::kine::field::GravityWell

pub struct GravityWell { /* see fields */ }

A gravity well: softened inverse-square attraction gm / (d² + soften²) toward a point, with an event horizon (inside it the pull stops growing) and a smooth outer cut-off at reach.

Public fields

fieldtype
atsuper::V2
gmf64Strength G·M, px³/s². The pull at distance d is about gm / d².
softenf64Softening length, px.
reachf64Nothing is felt beyond this distance, px.
lifef64
attackf64
releasef64

Methods

  • fn new(at: V2) -> GravityWell
  • fn gm(self, gm: f64) -> Self
  • fn reach(self, px: f64) -> Self
  • fn soften(self, px: f64) -> Self
  • fn life(self, seconds: f64) -> Self
  • fn at(self, at: V2) -> Self

Trait implementations: Clone, Copy, Debug, Field, PartialEq, Spawn, StructuralPartialEq

structaster_blueprint::ui::kine::field::PointerWake

pub struct PointerWake { /* see fields */ }

The pointer's wake: whatever the pointer passes is dragged along with it. Emitted every frame the pointer moves (by KineFx::wake); each wake lives a fraction of a second.

Public fields

fieldtype
atsuper::V2
velsuper::V2Pointer velocity, px/s.
radiusf64Radius of influence, px.
dragf64Coupling, 1/s: how quickly a body in the wake adopts the pointer's velocity.
max_accelf64Largest acceleration, px/s².
lifef64

Methods

  • fn new(at: V2, vel: V2) -> PointerWake
  • fn radius(self, px: f64) -> Self
  • fn drag(self, k: f64) -> Self

Trait implementations: Clone, Copy, Debug, Field, PartialEq, StructuralPartialEq

structaster_blueprint::ui::kine::field::Pulse

pub struct Pulse { /* see fields */ }

A short global kick: every body gets the same velocity change kick (px/s), or, from [Pulse::outward], a kick away from a point regardless of distance. Over in duration seconds.

Public fields

fieldtype
dirsuper::V2Direction of the kick (ignored when from is set).
kickf64Velocity change delivered, px/s.
durationf64
fromOption<super::V2>Kick away from this point instead of along dir.
twistf64Angular acceleration given to bodies (rad/s² at the peak, alternating sign by position).

Methods

  • fn new(deg: f64, kick: f64) -> Pulse — A kick toward deg degrees (0 east, 90 down).
  • fn outward(at: V2, kick: f64) -> Pulse — A kick away from at, the same size everywhere.
  • fn duration(self, seconds: f64) -> Self
  • fn twist(self, rad_s2: f64) -> Self

Trait implementations: Clone, Copy, Debug, Field, PartialEq, Spawn, StructuralPartialEq

structaster_blueprint::ui::kine::field::Vortex

pub struct Vortex { /* see fields */ }

A vortex: bodies swirl around at. Inside the core the flow turns like a solid wheel, outside it weakens smoothly to nothing at reach; pull adds an inward spiral.

Public fields

fieldtype
atsuper::V2
strengthf64Peak tangential acceleration (at the core radius), px/s².
coref64Radius of the solid core, px.
reachf64Outer radius beyond which nothing is felt, px.
pullf64Inward acceleration at the core radius, px/s² (0 = a pure swirl, positive spirals inward).
spinf64Angular acceleration of bodies (rad/s²) following the swirl.
clockwiseboolTurn clockwise on screen (otherwise counter-clockwise).
lifef64
attackf64
releasef64

Methods

  • fn new(at: V2) -> Vortex
  • fn strength(self, accel: f64) -> Self
  • fn radii(self, core: f64, reach: f64) -> Self
  • fn pull(self, accel: f64) -> Self
  • fn counter_clockwise(self) -> Self
  • fn life(self, seconds: f64) -> Self
  • fn fade(self, attack: f64, release: f64) -> Self
  • fn at(self, at: V2) -> Self

Trait implementations: Clone, Copy, Debug, Field, PartialEq, Spawn, StructuralPartialEq

structaster_blueprint::ui::kine::field::Wind

pub struct Wind { /* see fields */ }

Wind: a steady push along a direction with gusts that travel across the page, noise turbulence and flutter.

Gusts are a noise field advected along the wind, so a wall of light elements ripples in sequence as each gust reaches it. The whole field fades in and out over attack / release.

Public fields

fieldtype
dirsuper::V2Unit direction the wind blows toward.
strengthf64Base acceleration, px/s².
turbulencef64How much of the push is gust (0 = steady, 1 = gusts from calm to double).
gust_sizef64Feature size of a gust, px.
gust_speedf64How fast gusts travel along the wind, px/s.
flutterf64Angular acceleration a gust adds to a body (rad/s² at full gust): flapping.
lifef64
attackf64
releasef64
seedu32
regionOption<[f64; 4]>Only bodies inside this region feel it (None: the whole page).

Methods

  • fn new(deg: f64) -> Wind — Wind blowing toward deg degrees (0 east, 90 down, 180 west, 270 up).
  • fn strength(self, accel: f64) -> Self
  • fn turbulence(self, k: f64) -> Self
  • fn gusts(self, size_px: f64, speed_px_s: f64) -> Self
  • fn flutter(self, rad_s2: f64) -> Self
  • fn life(self, seconds: f64) -> Self
  • fn fade(self, attack: f64, release: f64) -> Self
  • fn seed(self, seed: u32) -> Self
  • fn region(self, r: [f64; 4]) -> Self
  • fn gust(&self, at: V2, t: f64) -> f64 — The gust level -1..=1 at a point and time (0 is the mean wind).

Trait implementations: Clone, Copy, Debug, Field, PartialEq, Spawn, StructuralPartialEq

structaster_blueprint::ui::kine::shatter::DustParticle

pub struct DustParticle { /* see fields */ }

A particle a disintegrating element hands over: screen px, px/s, the colour of the piece it was.

Public fields

fieldtype
possuper::V2
velsuper::V2
colour[u8; 4]
sizef64Edge length of the piece, px.
spinf64
lifef64Seconds the piece would have lived in the effect's own rendering.
born_msu64Screen clock when the piece let go, ms.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::kine::shatter::Fragment

pub struct Fragment { /* see fields */ }

One piece, in the element's logical px (a convex polygon and its centre).

Public fields

fieldtype
polyVec<super::V2>
centresuper::V2

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::kine::shatter::Shatter

pub struct Shatter { /* see fields */ }

Shatter parameters. Build with [Shatter::shards], [Shatter::glass] or [Shatter::dust].

Public fields

fieldtype
patternShatterPattern
dustbool
seedu64
onOption<String>
speedf64Outward impulse, px/s.
spinf64Peak spin, rad/s.
gravitysuper::V2Gravity (px/s²) and drag (1/s).
dragf64
flyf64Seconds of flight, then seconds held apart.
holdf64
backf64Seconds each fragment takes to come home, and the spread of their start times.
staggerf64
reassembleboolFly back (default) or stay gone.
windsuper::V2Dust: wind (px/s), sweep direction, sweep duration, piece life (s).
sweepsuper::V2
sweep_sf64
lifef64
handoffboolHand dust pieces to the particle lane when they let go (they leave the picture).
fieldsVec<std::rc::Rc<dyn Field>>

Methods

  • fn shards() -> Shatter — Voronoi shards that burst from the click, fall, and fly home.
  • fn glass() -> Shatter — Cracks radiating from the click, like glass.
  • fn dust() -> Shatter — Disintegrate to dust, swept away by a wind, then reform.
  • fn pattern(self, p: ShatterPattern) -> Self
  • fn seed(self, s: u64) -> Self
  • fn speed(self, v: f64) -> Self
  • fn gravity(self, g: V2) -> Self
  • fn wind(self, w: V2) -> Self
  • fn sweep(self, dir: V2, seconds: f64) -> Self
  • fn timing(self, fly: f64, hold: f64, back: f64) -> Self
  • fn reassemble(self, yes: bool) -> Self
  • fn handoff(self, yes: bool) -> Self — Hand dust pieces over as [DustParticle]s (see [drain_dust]).
  • fn on(self, key: &str) -> Self — Break on a store counter instead of a click on the element.
  • fn field(self, f: Rc<dyn Field>) -> Self — A field the fragments always feel (published fields are felt too).

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::kine::solve::Contact

pub struct Contact { /* see fields */ }

Public fields

fieldtype
ausize
busize
nsuper::V2
rasuper::V2
rbsuper::V2
mnf64
mtf64
biasf64
pnf64
ptf64
muf64
e_vnf64
vn0f64Closing speed along the normal when the contact formed (negative = closing), px/s.

structaster_blueprint::ui::kine::solve::ContactParams

pub struct ContactParams { /* see fields */ }

Build the contact constraint for one manifold point. Material and solver constants for [contact].

Public fields

fieldtype
muf64
restf64
dtf64
betaf64
slopf64

Trait implementations: Clone, Copy, Debug

structaster_blueprint::ui::kine::solve::Dyn

pub struct Dyn { /* see fields */ }

The kinematic state the solver needs for a body.

Public fields

fieldtype
csuper::V2
vsuper::V2
angf64
wf64
imf64
iif64

Trait implementations: Clone, Copy, Debug

pub struct Link { /* see fields */ }

Public fields

fieldtype
aEnd
bEnd
lasuper::V2
lbsuper::V2
kindLinkKind
softnessf64

Methods

  • fn impulse(&self) -> V2 — The accumulated impulse (warm start for the next solve of the same joint).
  • fn set_impulse(&mut self, p: V2)
  • fn new(a: End, b: End, la: V2, lb: V2, kind: LinkKind, softness: f64) -> Link

structaster_blueprint::ui::kine::solve::Obb

pub struct Obb { /* see fields */ }

An oriented box: centre, half extents, rotation (radians).

Public fields

fieldtype
csuper::V2
hsuper::V2
angf64

Trait implementations: Clone, Copy, Debug

structaster_blueprint::ui::kine::solve::PairHasher

pub struct PairHasher(..)

A cheap deterministic hasher for the small integer pair keys of the warm-start cache.

Trait implementations: Clone, Copy, Default, Hasher

structaster_blueprint::ui::kine::solve::Pt

pub struct Pt { /* see fields */ }

One contact point of a manifold. normal points from box A to box B; sep is negative when overlapping.

Public fields

fieldtype
possuper::V2
sepf64

Trait implementations: Clone, Copy, Debug, Default

structaster_blueprint::ui::kine::swarm::Blast

pub struct Blast { /* see fields */ }

A blast to apply to a swarm: shoves live particles and tears settled ones off the surfaces near it.

Public fields

fieldtype
atsuper::V2
radiusf64
speedf64Speed given to a grain at the centre, px/s (falling off as (1 - d / radius)^2).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::kine::swarm::Shower

pub struct Shower { /* see fields */ }

A description of particles to throw into the page.

Public fields

fieldtype
kindKind
countusize
seedu64
sourceSource
duration_msu64Particles are born evenly over this many ms (0: all at once).
delay_msu64
speed(f64, f64)
dir(f64, f64)Launch direction (centre, spread) in degrees, 0 = right, -90 = up.
colorsVec<[u8; 3]>
size(f64, f64)Half-length in px (confetti) or radius.
life(f64, f64)
windf64Steady sideways velocity added at birth, px/s.
targetStringThe swarm layer it goes to.

Methods

  • fn confetti() -> Shower — A celebration: rectangles of six colours that flutter down, bounce off buttons and pile on cards.
  • fn sparks() -> Shower — A burst of hot sparks (use [Shower::at] to place it).
  • fn snow() -> Shower — Snow settling on everything.
  • fn dust() -> Shower — Drifting motes of dust.
  • fn sand() -> Shower — Grains that pour and pile.
  • fn droplets() -> Shower — Liquid droplets that flick up and fall.
  • fn count(self, n: usize) -> Self
  • fn seed(self, s: u64) -> Self
  • fn duration(self, ms: u64) -> Self
  • fn delay(self, ms: u64) -> Self
  • fn speed(self, lo: f64, hi: f64) -> Self
  • fn dir(self, centre_deg: f64, spread_deg: f64) -> Self
  • fn colors(self, c: &[[u8; 3]]) -> Self
  • fn size(self, lo: f64, hi: f64) -> Self
  • fn wind(self, px_s: f64) -> Self
  • fn from_top(self) -> Self
  • fn at(self, x: f64, y: f64) -> Self — A burst from a point.
  • fn fountain(self, x: f64, y: f64) -> Self — A jet from a point (spread over the duration).
  • fn area(self, rect: [f64; 4]) -> Self
  • fn on(self, key: &str) -> Self — Send it to the swarm layer with this key.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::kine::swarm::Solid

pub struct Solid { /* see fields */ }

A solid the particles collide with: a rotated rectangle with rounded corners.

Public fields

fieldtype
idString
rect[f64; 4][x, y, w, h] on screen now (the box before rotation; it turns about its centre).
velOption<super::V2>Velocity of the centre, px/s (None: derived from the last frame).
inv_massf64Inverse mass of the body behind it (0: not a body, takes no momentum).
anglef64Rotation, radians (clockwise on screen), and its rate.
spinf64
radiusOption<f64>Corner radius, px (None: the swarm's default).

Methods

  • fn new(id: &str, rect: [f64; 4]) -> Solid
  • fn rotated(self, angle: f64) -> Solid
  • fn rounded(self, r: f64) -> Solid
  • fn from_body(id: &str, b: &BodyState) -> Solid — A solid from a published body state (its box scaled, turned and displaced as the world has it).

Trait implementations: Clone, Debug

structaster_blueprint::ui::kine::swarm::Stats

pub struct Stats { /* see fields */ }

Counters for tests and the doc.

Public fields

fieldtype
activeusize
depositsusize
spawnedu64
releasedu64
contactsu64
dripsu64Drops of liquid that let go of a corner.
slabsu64Slabs torn off steep heaps.

Trait implementations: Clone, Copy, Debug, Default

structaster_blueprint::ui::kine::swarm::Swarm

pub struct Swarm { /* see fields */ }

The particle simulation.

Public fields

fieldtype
cfgSwarmCfg

Methods

  • fn new(cfg: SwarmCfg) -> Swarm
  • fn set_screen(&mut self, w: f64, h: f64)
  • fn screen(&self) -> Option<[f64; 2]>
  • fn last_ms(&self) -> u64 — The clock position the simulation reached, ms.
  • fn slabs_active(&self) -> usize — Slabs sliding now.
  • fn stats(&self) -> Stats
  • fn is_idle(&self) -> bool — Nothing moves and nothing is waiting to be born: a host needs no frames for it.
  • fn positions(&self) -> Vec<(V2, Kind)> — Positions of the live particles.
  • fn deposit_positions(&self) -> Vec<(V2, Kind)> — Screen positions of the settled particles, with their kind.
  • fn deposit_key(&self) -> u64 — A cheap fingerprint of the settled layer: equal while the baked picture would be equal.
  • fn state_key(&self) -> u64 — A fingerprint of the live particles (changes every frame while they move).
  • fn set_fields(&mut self, list: &[(u64, Rc<dyn Field>)]) — The fields alive now (from kine::live_fields()), replacing the previous set.
  • fn add_field(&mut self, at_ms: u64, f: Rc<dyn Field>) — Add a field that pushes particles.
  • fn add_flow(&mut self, f: Rc<dyn Flow>)
  • fn spawn(&mut self, sh: &Shower, start_ms: u64) — Queue a shower starting at start_ms (the clock it begins at).
  • fn take_impulses(&mut self) -> BTreeMap<String, V2> — Take the momentum the particles gave to bodies since the last call: (id, momentum px/s * mass).
  • fn take_impulse_points(&mut self) -> BTreeMap<String, V2> — The impact-weighted average point where those impulses landed (so an off-centre rain of hits spins a card).
  • fn clear(&mut self) — Remove everything (a new App, a reset).
  • fn set_solids(&mut self, ins: &[Solid], frame_dt: f64) — Replace the colliders for the coming frame. frame_dt is the time since the last call, seconds (it derives velocities of plain rectangles and decides which piles are shaken loose).
  • fn advance(&mut self, now_ms: u64) — Advance to the clock time now_ms in fixed sub-steps.
  • fn blast(&mut self, b: &Blast) — Apply a [Blast] now.

structaster_blueprint::ui::kine::swarm::SwarmCfg

pub struct SwarmCfg { /* see fields */ }

Tunables of one swarm.

Public fields

fieldtype
capusizeMost live particles (spawns beyond it are dropped).
max_depositsusizeMost settled particles kept in piles.
floorboolThe bottom of the screen is a solid floor (piles form there).
wallsboolWalls at the left and right of the screen.
gravityf64Gravity multiplier.
pushf64Momentum transfer to bodies (1 = default, 0 = particles never push).
only_prefixVec<String>Collide only with ids starting with one of these (empty: every id).
ignore_prefixVec<String>Never collide with ids starting with one of these.
max_areaf64Ignore rectangles larger than this fraction of the screen (page containers).
windf64Air speed of the ambient wind, px/s (it gusts and varies with height); particles drift toward it.
cornerf64Corner radius of plain rectangles, px.
grainsboolConfetti and sand collide with each other (a 10 px spatial hash).

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::kine::swarm_draw::SwarmLayer

pub struct SwarmLayer { /* see fields */ }

Builder for the swarm layer element.

Methods

  • fn key(self, key: &str) -> Self — Another swarm (several layers on one page); target it with [super::swarm::Shower::on].
  • fn cap(self, n: usize) -> Self
  • fn floor(self, on: bool) -> Self
  • fn walls(self, on: bool) -> Self
  • fn gravity(self, g: f64) -> Self
  • fn push(self, k: f64) -> Self — Momentum transfer to bodies (0 off).
  • fn only_prefix(self, p: &str) -> Self
  • fn ignore_prefix(self, p: &str) -> Self
  • fn max_deposits(self, n: usize) -> Self
  • fn el(self) -> El

Trait implementations: Clone, Debug

structaster_blueprint::ui::kine::wave::Ripple

pub struct Ripple { /* see fields */ }

Damped oscillating rings: a wave train that spreads from a point, pushing bodies out and pulling them back.

Public fields

fieldtype
originsuper::V2
wavelengthf64Distance between crests, px.
speedf64How fast the train travels, px/s.
strengthf64Peak acceleration of the first crest at the origin, px/s².
dampingf64Seconds for the oscillation to damp to 1/e.
decayf64Distance over which the amplitude falls to 1/e, px.
ringsf64Rings behind the front before it is silent (the train length), in wavelengths.
lifef64

Methods

  • fn new(origin: V2) -> Ripple
  • fn wavelength(self, px: f64) -> Self
  • fn speed(self, px_s: f64) -> Self
  • fn strength(self, accel: f64) -> Self
  • fn damping(self, seconds: f64) -> Self
  • fn decay(self, px: f64) -> Self
  • fn rings(self, n: f64) -> Self
  • fn at(self, origin: V2) -> Self
  • fn arrival(&self, p: V2) -> f64 — Seconds after emission at which the front of the train reaches p.

Trait implementations: Clone, Copy, Debug, Field, PartialEq, Spawn, StructuralPartialEq

structaster_blueprint::ui::kine::wave::Shockwave

pub struct Shockwave { /* see fields */ }

An expanding ring front that kicks every body it passes outward.

Public fields

fieldtype
originsuper::V2Where it started, screen px.
speedf64Front speed, px/s.
widthf64Half width of the front (gaussian sigma-like), px.
kickf64Velocity delivered to a body right at the origin as the front passes, px/s.
fallofff64Distance over which the kick halves, px (1 / (1 + d / falloff)).
twistf64Angular acceleration of bodies hit off-centre by the front (rad/s², sign by position).
backdraftf64A gentle suction behind the front (fraction of the kick): bodies are pulled back after the shove.
max_radiusf64Largest radius the front travels to, px.
lifef64Seconds after which the field is dropped whatever the radius.

Methods

  • fn new(origin: V2) -> Shockwave
  • fn speed(self, px_s: f64) -> Self
  • fn width(self, px: f64) -> Self
  • fn kick(self, px_s: f64) -> Self
  • fn falloff(self, px: f64) -> Self
  • fn twist(self, rad_s2: f64) -> Self
  • fn backdraft(self, k: f64) -> Self
  • fn max_radius(self, px: f64) -> Self
  • fn at(self, origin: V2) -> Self
  • fn arrival(&self, p: V2) -> f64 — The seconds after emission at which the front reaches p.
  • fn radius(&self, t: f64) -> f64 — The radius of the front at t.

Trait implementations: Clone, Copy, Debug, Field, PartialEq, Spawn, StructuralPartialEq

structaster_blueprint::ui::kine::world::World

pub struct World { /* see fields */ }

The persistent simulation.

Public fields

fieldtype
stepsu64Number of fixed steps taken since the world began (tests, profiling).

Methods

  • fn awake(&self) -> bool — Something is moving, or a field is still travelling: the host must keep presenting frames.
  • fn len(&self) -> usize
  • fn is_empty(&self) -> bool
  • fn time_ms(&self) -> u64 — Time of the last completed fixed step, ms.
  • fn apply_impulse(&mut self, imp: &super::push::Impulse) — Apply one outside impulse (see kine::push): momentum, divided by mass, with the shape's falloff.
  • fn add(&mut self, id: &str, cfg: Body, home: [f64; 4]) — Add a body at home (tests, tools).
  • fn set_bounds(&mut self, b: Option<[f64; 4]>) — Set the walls bodies stay inside.
  • fn kick(&mut self, id: &str, v: V2) — Give a body a velocity (tests, tools).
  • fn run_to(&mut self, ms: u64) — Run to clock time ms (no pointer).
  • fn push_field(&mut self, at_ms: u64, field: std::rc::Rc<dyn super::Field>) — Emit a field into this world at at_ms.
  • fn body(&self, id: &str) -> Option<BodyState> — The state of a body.
  • fn join(&mut self, j: Joint) — Join bodies (tests, tools); call after every add.

Trait implementations: Default

structaster_blueprint::ui::live::Ix

pub struct Ix { /* see fields */ }

Interaction metadata stored in an element (El::ix).

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::live::Layer

pub struct Layer { /* see fields */ }

An element that floats above the screen instead of taking layout space.

Methods

  • fn new(id: impl AsRef<str>, place: Place) -> Self — A floating layer named id at place.
  • fn anchor(self, id: impl AsRef<str>) -> Self — Position relative to the element with this id.
  • fn scrim(self, fill: Option<Col>, on_click: Option<Action>) -> Self — Full-screen scrim below the body; clicking it runs on_click.
  • fn match_width(self) -> Self — Body is at least as wide as the anchor.

Trait implementations: Clone, Debug

structaster_blueprint::ui::live::Ptr

pub struct Ptr { /* see fields */ }

Pointer position local to the element, with its size (logical px).

Public fields

fieldtype
xf64
yf64
wf64
hf64

Methods

  • fn fx(&self) -> f64 — Horizontal fraction 0..=1.
  • fn fy(&self) -> f64

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::motion::Fx

pub struct Fx { /* see fields */ }

Per-element motion declarations (El::s.fx).

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::motion::Transition

pub struct Transition { /* see fields */ }

How a property moves to a new value: duration, curve and delay.

Methods

  • fn theme(token: MotionToken) -> Self — A theme token pairing: Transition::theme(MotionToken::FAST).
  • fn ms(ms: u32, ease: Ease) -> Self — A literal duration in ms with a theme curve (still instant under reduced motion).
  • fn instant() -> Self — No animation: the value jumps.
  • fn delay(self, ms: u32) -> Self — Start ms after the target changes.
  • fn spring(s: Spring) -> Self — A transition that follows a spring response: Transition::spring(Spring::Snappy). The value overshoots when the spring does and settles when it settles. Under reduced motion the transition is instant (as every other one).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::nav::AccordionItem

pub struct AccordionItem { /* see fields */ }

A section of an [accordion].

Methods

  • fn new(id: impl AsRef<str>, title: impl AsRef<str>, body: El) -> Self

structaster_blueprint::ui::nav::Chord

pub struct Chord { /* see fields */ }

A key chord: the key plus the modifiers held with it (the shortcut key).

A chord reuses the crate's own key ([Key]) and modifier ([KeyModifiers]) types: it is "Ctrl-K", not a new kind of key. Matching compares the modifiers exactly (Ctrl is not Alt), except Shift, which is ignored unless the chord asks for it - so Chord::plain('/') still matches the shifted slash of a US layout. Letters compare case-insensitively, so Ctrl-K matches Ctrl-k.

Methods

  • fn plain(key: Key) -> Self — The chord key with no modifier held.
  • fn ctrl(key: Key) -> Self — The chord key with Control held (Ctrl-K).
  • fn alt(key: Key) -> Self — The chord key with Alt held (Alt-K).
  • fn meta(key: Key) -> Self — The chord key with Meta (Command / Windows) held (Meta-K).
  • fn new(key: Key, mods: KeyModifiers) -> Self — The chord key with exactly these modifiers held.
  • fn key(&self) -> Key — The key of the chord.
  • fn mods(&self) -> KeyModifiers — The modifiers held with the key.
  • fn is_modified(&self) -> bool — Whether the chord holds a modifier other than Shift: such a chord is a shortcut (Ctrl-K) and reaches the app even while a text field has focus.
  • fn matches(&self, key: Key, mods: KeyModifiers) -> bool — Whether the key event key with mods is this chord.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

structaster_blueprint::ui::nav::Command

pub struct Command { /* see fields */ }

A command for the [command_palette].

Methods

  • fn new(id: impl AsRef<str>, title: impl AsRef<str>, action: Action) -> Self
  • fn hint(self, h: impl AsRef<str>) -> Self — A shortcut or category shown on the right ("Ctrl T": split on spaces into key caps).
  • fn icon(self, i: Icon) -> Self

Trait implementations: Clone

structaster_blueprint::ui::nav::TreeNode

pub struct TreeNode { /* see fields */ }

A node of a [tree_view].

Methods

  • fn new(id: impl AsRef<str>, label: impl AsRef<str>) -> Self — id must be unique in the tree (it is stored in the selection).
  • fn icon(self, i: Icon) -> Self
  • fn children(self, kids: impl IntoIterator<Item = TreeNode>) -> Self

Trait implementations: Clone

structaster_blueprint::ui::nav::Wizard

pub struct Wizard { /* see fields */ }

Multi-step form. Int key is the current step (0-based), Bool <key>.done the finished flag. Next runs the current step's form check: if a rule fails it shows every error and focuses the first failing field (focus_first_error) and stays; otherwise it advances, and on the last step sets <key>.done, runs .finish(action) and shows .done_view(el). Back goes one step; finished steps in the header are clickable. Ids <key>.step.<i>, <key>.back, <key>.next. At Compact width the header folds into "Step n of m" with a meter.

Methods

  • fn finish(self, a: Action) -> Self — Action run when the last step passes.
  • fn done_view(self, e: El) -> Self — What to show once finished.
  • fn build(self) -> El

Trait implementations: From<Wizard>

structaster_blueprint::ui::nav::WizardStep

pub struct WizardStep { /* see fields */ }

One step of a [wizard]: its title, the body to show and the [Form] that must pass to leave it.

Methods

  • fn new(title: impl AsRef<str>, body: El) -> Self
  • fn form(self, f: &Form) -> Self — Validate with this form (fields registered via text_input(..).form(&form)) before Next.

structaster_blueprint::ui::noise::NoiseSpec

pub struct NoiseSpec { /* see fields */ }

Builder for a procedural fill. Start from a kind constructor ([NoiseSpec::fbm], [NoiseSpec::aurora], ...), chain modifiers, pass to [noise_fill].

noise_fill(NoiseSpec::fbm().seed(3).scale(140.).ramp([Role::Background, Role::Accent]).animate(0.2).grain(0.08)).h(220)

Methods

  • fn new(kind: SurfaceKind) -> Self — A spec of kind with a surface-to-text ramp.
  • fn value() -> Self — Value noise (blocky-soft blobs).
  • fn perlin() -> Self — Gradient (Perlin) noise.
  • fn simplex() -> Self — Simplex noise.
  • fn cellular() -> Self — Cellular (Worley) F1 distance.
  • fn edges() -> Self — Cellular F2 - F1: bright cell borders.
  • fn fbm() -> Self — Fractal Brownian motion (clouds).
  • fn ridged() -> Self — Ridged noise (crests, veins).
  • fn turbulence() -> Self — Turbulence (smoke).
  • fn warp() -> Self — Domain-warped fBm (marble).
  • fn aurora() -> Self — Noise-distorted gradient (aurora backgrounds).
  • fn seed(self, seed: u32) -> Self — Field seed (any u32): a different seed is a different, equally good field.
  • fn scale(self, px: impl Into<f64>) -> Self — Feature size in logical px (larger = smoother, lower frequency).
  • fn octaves(self, n: u32) -> Self — Octaves summed by fractal kinds (1..=12).
  • fn lacunarity(self, v: f64) -> Self — Frequency multiplier per octave (default 2).
  • fn gain(self, v: f64) -> Self — Amplitude multiplier per octave (default 0.5).
  • fn distort(self, v: f64) -> Self — Warp strength (warp) or gradient distortion (aurora).
  • fn contrast(self, v: f64) -> Self — Contrast about the middle of the ramp (1 = unchanged, 2 = punchy).
  • fn ramp<C: Into<Col>>(self, colors: impl IntoIterator<Item = C>) -> Self — Evenly spaced ramp colours, low to high: .ramp([Role::Background, Role::Accent]).
  • fn stops<C: Into<Col>>(self, stops: impl IntoIterator<Item = (f64, C)>) -> Self — Explicit (position 0..=1, colour) stops.
  • fn animate(self, speed: f64) -> Self — Evolve over time: speed lattice units per second along the time axis (0.1 is a slow drift, 0.5 brisk). Driven by the App clock; static under reduced motion.
  • fn time(self, secs: f64) -> Self — Seconds into the animation (a fixed frame; added to the clock when animated).
  • fn fps(self, fps: u32) -> Self — Frame quantum: time snaps to 1 / fps seconds so frames cache (default 30).
  • fn detail(self, px: f64) -> Self — Internal px per generated sample (default automatic from a sample budget).
  • fn grain(self, amount: f64) -> Self — Film grain over the fill, 0..=1 (about 0.05..0.15 is subtle). It flickers at 24 fps while the fill is animated or [NoiseSpec::live].
  • fn live(self) -> Self — Keep the element animating (grain flicker) even with animate(0.0).
  • fn corner(self, px: f64) -> Self — Rounded corners in px, baked into the image alpha.
  • fn surface(&self, th: &design::Theme) -> Surface — The resolved surface for the given theme (for tests and the graph bridge).

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::A11yIssue

pub struct A11yIssue { /* see fields */ }

One finding.

Public fields

fieldtype
ruleA11yRule
idString
rectuitree::Rect
messageString
fixString

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::A11yReport

pub struct A11yReport { /* see fields */ }

The result of [UiTree::audit_a11y].

Public fields

fieldtype
issuesVec<A11yIssue>
warningsVec<A11yIssue>Findings that do not fail the audit: the backdrop under a text is not fully known.

Methods

  • fn is_clean(&self) -> bool
  • fn of(&self, rule: A11yRule) -> impl Iterator<Item = &A11yIssue>
  • fn warnings(&self) -> &[A11yIssue] — The warnings of the report (the backdrops the audit could not read).
  • fn assert_clean(&self) — Panics with the full report unless there are no findings.

Trait implementations: Clone, Debug, Default, Display, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::AccordionItem

pub struct AccordionItem { /* see fields */ }

A section of an [accordion].

Methods

  • fn new(id: impl AsRef<str>, title: impl AsRef<str>, body: El) -> Self

structaster_blueprint::ui::prelude::Anchor

pub struct Anchor { /* see fields */ }

Where an anchored child sits inside its parent's padding box. An edge left None is free; both edges of an axis stretch the child between them.

left / right / top / bottom are physical: they stay where they are in every direction. start / end are logical: start is the left edge in a left-to-right subtree and the right edge in a right-to-left one (of the anchored child's own direction). A physical edge wins over its logical twin.

Public fields

fieldtype
leftOption<Len>
topOption<Len>
rightOption<Len>
bottomOption<Len>
startOption<Len>The inline-start edge (the left in LTR, the right in RTL).
endOption<Len>The inline-end edge (the right in LTR, the left in RTL).

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::App

pub struct App { /* see fields */ }

The interactive app: a Ui surface driven by the shared [Engine].

Methods

  • fn new(theme: &Theme, store: Store) -> Self — Start an app: App::new(&Theme::paper_dark(), store).size(960, 640).screen(|s| col([...]))?.
  • fn size(self, w: u32, h: u32) -> Self — Logical size in px (before [App::screen]).
  • fn scale(self, s: f64) -> Self — Output scale (before [App::screen]).
  • fn auto_density(self, on: bool) -> Self — Apply the density of the environment (the viewport's [Density]): the type scale through the theme's type steps, the smallest interactive target (the hit and focus box of an interactive element grows to it, its drawn size does not) and the focus ring width. Off by default, so every screen stays as it was.
  • fn tiled_shadows(self, on: bool) -> Self — Draw large drop shadows (cards, panels, headers) from a small baked drawing and clipped copies of it: the first frame of a page and a resize bake 1-5 ms of shadow instead of 20-25 ms per large card. Off by default, because the result can differ from the single drawing by one level in an occasional corner pixel (see [Screen::tiled_shadows]); an app that prefers the speed turns it on.
  • fn snap_pixels(self, on: bool) -> Self — Snap every laid-out box to the device pixel grid before painting, for crisp edges at fractional scales (1.25, 1.5): see [Screen::snap_pixels]. Off by default.
  • fn direction(self, d: Direction) -> Self — The reading direction of the screen: direction(Direction::Rtl) lays the whole tree out right to left (the rows from the right edge to the left, Start on the right, the grid columns from the right, the text right to left). An element that sets its own direction (El::dir) wins over the app's.
  • fn font_bytes(self, name: &str, bytes: &[u8]) -> Result<Self, interact::InteractError> — Register a face for the rich text (the runs may name it). The face is registered before the screen is made.
  • fn add_font_bytes(&mut self, name: &str, bytes: &[u8]) -> Result<(), interact::InteractError> — Register a face after the screen is made (a face loaded on demand, such as a typography choice). The next frame lays text out with it.
  • fn font_file(self, name: &str, path: impl AsRef<std::path::Path>) -> Result<Self, interact::InteractError> — Register a face for the rich text from a file (read now).
  • fn fallbacks(self, names: &[&str]) -> Self — The default fallback chain of the rich text: the faces a run falls back to when its own face has no glyph for a cluster.
  • fn screen(self, f: impl Fn(&Store) -> El + 'static) -> Result<Self, interact::InteractError> — Define the screen as a function of the store and render the first frame.
  • fn size_class(&self) -> super::responsive::Size — The size class of the current width under the theme's breakpoints.
  • fn stage_semantics(&self, presenter: &mut aster_ui::semantics::Presenter, policy: aster_ui::semantics::AccessibilityPolicy) -> Result<aster_ui::semantics::Ticket, aster_ui::semantics::SemanticError> — Stage the current frame's accessibility semantics (tree().semantics()) on an aster_ui presenter; the host acknowledges it with the matching input presentation.
  • fn store(&self) -> &Store — The store the screen reads: what actions and set changed so far.
  • fn image(&self) -> &Image — The last rendered frame as pixels.
  • fn tree(&self) -> &UiTree — The semantic tree of the last frame, with hovered pressed focused focusable disabled flags.
  • fn caret_rect(&self) -> Option<[f64; 4]> — The caret of the focused text field as [x, y, w, h] in layout px: where a host puts the IME candidate window (None when no text field has the focus, or its caret is scrolled out of the drawn lines).
  • fn rendered(&self) -> &Rendered — The last render: image, element tree and solved layout.
  • fn log(&self) -> &[Event] — The events the actions and the engine raised so far.
  • fn focused(&self) -> Option<&str> — The id of the focused element.
  • fn hovered(&self) -> Option<&str> — The id of the element under the pointer.
  • fn pressed(&self) -> Option<&str> — The id of the element the pointer is holding down.
  • fn set_accelerator(&mut self, accelerator: Option<Box<dyn aster_ui::accel::RasterAccelerator + Send>>) -> Option<Box<dyn aster_ui::accel::RasterAccelerator + Send>> — Experimental: install (or with None remove) an optional frame accelerator, such as the separate gpu/ plugin workspace's, and return the previous one. Without one (the default) every frame is drawn by the CPU renderer exactly as before. An accelerator's frames match the CPU's only within its documented tolerance, so byte-exact snapshot tests must not install one. It applies from the next rendered frame; a frame it fails is drawn by the CPU.
  • fn has_accelerator(&self) -> bool — Whether an accelerator is installed.
  • fn accelerator_last_error(&self) -> Option<String> — The installed accelerator's most recent failure (that frame was drawn by the CPU).
  • fn take_damage(&mut self) -> Option<Vec<[u32; 4]>> — The device rectangles [x, y, w, h] of [App::image] that changed since the previous call, then starts a new accumulation. None means "not known, present the whole frame" (the first frame, a resize, a full or layered render, a cut). Some(empty) means the pixels did not change. A host that uploads frames to a texture (a browser, a compositor) copies only these rectangles.
  • fn renders(&self) -> usize — Frames rendered so far (for tests).
  • fn target_ids(&self) -> Vec<&str> — Ids of all interactive elements in paint order.
  • fn engine(&self) -> &Engine — The shared input engine (acknowledged presentation, hover chain, ...).
  • fn write_png(&self, path: impl AsRef<std::path::Path>) -> headless::Result<()> — Write the last frame to a PNG file (open it and look at it).
  • fn assert_snapshot(&self, golden: impl AsRef<std::path::Path>, tolerance: u8) — Panic unless the last frame matches the golden PNG within tolerance per channel; a missing golden is a failure too, until ASTER_UPDATE_SNAPSHOTS=1 is set, which writes it.
  • fn set_defer_render(&mut self, on: bool) -> Result<Vec<Event>, interact::InteractError> — Render at most once per turn of a host's event loop (off by default; the native window host turns it on).
  • fn flush(&mut self) -> Result<Vec<Event>, interact::InteractError> — Settle and render what deferred moves, leaves and wheel steps owe ([App::set_defer_render]). Does nothing (and renders nothing) when nothing is owed; renders only if the owed settle changed the picture.
  • fn owes_render(&self) -> bool — A deferred move, leave or wheel step is waiting for [App::flush].
  • fn set(&mut self, name: &str, value: impl Into<Value>) -> Result<Vec<Event>, interact::InteractError> — Set a store value and re-render.
  • fn set_pending(&mut self, name: &str, value: impl Into<Value>) — Model change without rendering: input keeps using the last acknowledged geometry until [App::refresh] (or the next event).
  • fn set_view(&mut self, name: &str, value: impl Into<Value>) -> Result<Vec<Event>, interact::InteractError> — View-only change (same model snapshot): a press in flight survives a repaint that leaves every interactive box where it was, and is cancelled (StaleGeometry) by one that moves them.
  • fn run(&mut self, action: &Action) -> Result<Vec<Event>, interact::InteractError> — Run an action and re-render.
  • fn advance(&mut self, ms: i64) -> Result<Vec<Event>, interact::InteractError> — Advance the injected clock by ms and render the frame at the new time. This is the only way time moves: transitions are sampled at the clock, never at the wall clock, so a script is reproducible frame for frame. Store ints named <key>.ttl count down (ms); at 0 <key> becomes false (toasts), at the exact millisecond even inside a long step.
  • ...and 99 more

structaster_blueprint::ui::prelude::Backdrop

pub struct Backdrop { /* see fields */ }

A scene drawn once. Backdrop::new("dusk", || sky_stack()), then backdrop.el() at the bottom of the root overlay and backdrop.glass(panel, Glass::new()) for the panels.

Methods

  • fn new(key: impl AsRef<str>, build: impl Fn() -> El + 'static) -> Backdrop — A backdrop named key (hashed) whose scene build makes. build runs on a miss only: the first frame, a resize, a scale or theme change, or a new key.
  • fn glass_from(self, scene: impl Fn() -> El + 'static) -> Backdrop — Frost the glass from scene instead of from the picture: usually the sky alone, without the light, the grain and the vignette that are laid over it (the glass then looks through to the sky, as .glass(&sky) does). It is rendered at a quarter of the size, the way GlassExt::glass renders its backdrop, so the frosted pictures are those of .glass(&scene, ..) with the scene at rest. Without it the glass frosts a quarter-size copy of the picture.
  • fn sky(self, sky: Sky) -> Backdrop — Give the picture a living sky: [Sky] layers (clouds that drift, an aurora that breathes, grain) composed over it by the clock in small tiles, so that a frame costs the tiles it refreshes and not the screen. Glass still frosts the picture at rest. Opt-in: without it the backdrop is a still, as before. See docs/CINEMATIC.md.
  • fn progressive(self) -> Backdrop — Paint the first frame fast: a soft stand-in (the sky of [Backdrop::glass_from] stretched from its quarter-size render, 40 ms at 1080p, which the glass needs anyway; without one, the scene at a quarter of the size, which costs about as much as the full render) and the full picture replaces it on the next frame (a hitch of the full render's cost). The screen must present that next frame (an animation, a tick or any input does). Opt-in: pixels of the first frame differ (they are soft, and the grain is coarse).
  • fn el(&self) -> El — The full-bleed element that shows the picture (put it first in the root overlay, .cover()ed by default). One image copy per repaint; an unchanged frame is a cache hit.
  • fn glass(&self, panel: El, g: Glass) -> El — Frost panel over this backdrop: a blurred, tinted copy of the picture behind it (like GlassExt::glass), baked once per panel rectangle and parameters, not once per frame.

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::Bloom

pub struct Bloom { /* see fields */ }

Bloom: bright parts of source glow outward. source is the backdrop element (the same one you draw at the bottom of the screen).

Public fields

fieldtype
sourceui::el::El
thresholdf64Luma above which pixels bloom 0..1.
radiusf64Blur radius in logical px.
strengthf64
blendaster_ui::BlendModeAdditive by default: bloom is light added to what is beneath.

Methods

  • fn threshold(self, t: f64) -> Self
  • fn radius(self, r: f64) -> Self
  • fn strength(self, s: f64) -> Self
  • fn blend(self, mode: aster_ui::BlendMode) -> Self — Blend mode of the glow (default Add).
  • fn el(self) -> El

Trait implementations: Clone, Debug, From<Bloom>

structaster_blueprint::ui::prelude::Burst

pub struct Burst(..)

What a click throws: a [Particles] system fired at the pointer.

Public fields

fieldtype
0Particles

Methods

  • fn sparks() -> Self
  • fn confetti() -> Self
  • fn pulse() -> Self — A soft ring of dots that expands and fades (a ripple of light).
  • fn seed(self, seed: u64) -> Self
  • fn count(self, n: usize) -> Self
  • fn colors(self, cols: impl IntoIterator<Item = impl Into<Col>>) -> Self
  • fn duration(&self) -> f64 — Longest time any particle of a burst lives, in seconds.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Camera3d

pub struct Camera3d { /* see fields */ }

Where the scene is looked at from.

Public fields

fieldtype
eyeVec3
targetVec3
upVec3
fovf64Vertical field of view in degrees (perspective).
orthoOption<f64>Some(height): orthographic, height world units tall.
nearf64
farf64

Methods

  • fn perspective(eye: Vec3, target: Vec3, fov: f64) -> Camera3d
  • fn orthographic(eye: Vec3, target: Vec3, height: f64) -> Camera3d
  • fn look_at(self, eye: Vec3, target: Vec3) -> Camera3d
  • fn fov(self, deg: f64) -> Camera3d
  • fn up(self, up: Vec3) -> Camera3d
  • fn clip(self, near: f64, far: f64) -> Camera3d
  • fn matrices(&self, aspect: f64) -> (M4, M4) — The matrices a point goes through: (view, projection) for a picture of aspect (w / h).
  • fn project(&self, p: Vec3, w: f64, h: f64) -> Option<(f64, f64, f64)> — A world point on the screen: (x, y) in 0..w x 0..h pixels (y down) and its depth in view units; None behind the camera.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Chord

pub struct Chord { /* see fields */ }

A key chord: the key plus the modifiers held with it (the shortcut key).

A chord reuses the crate's own key ([Key]) and modifier ([KeyModifiers]) types: it is "Ctrl-K", not a new kind of key. Matching compares the modifiers exactly (Ctrl is not Alt), except Shift, which is ignored unless the chord asks for it - so Chord::plain('/') still matches the shifted slash of a US layout. Letters compare case-insensitively, so Ctrl-K matches Ctrl-k.

Methods

  • fn plain(key: Key) -> Self — The chord key with no modifier held.
  • fn ctrl(key: Key) -> Self — The chord key with Control held (Ctrl-K).
  • fn alt(key: Key) -> Self — The chord key with Alt held (Alt-K).
  • fn meta(key: Key) -> Self — The chord key with Meta (Command / Windows) held (Meta-K).
  • fn new(key: Key, mods: KeyModifiers) -> Self — The chord key with exactly these modifiers held.
  • fn key(&self) -> Key — The key of the chord.
  • fn mods(&self) -> KeyModifiers — The modifiers held with the key.
  • fn is_modified(&self) -> bool — Whether the chord holds a modifier other than Shift: such a chord is a shortcut (Ctrl-K) and reaches the app even while a text field has focus.
  • fn matches(&self, key: Key, mods: KeyModifiers) -> bool — Whether the key event key with mods is this chord.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Chroma

pub struct Chroma { /* see fields */ }

RGB split.

Public fields

fieldtype
pxf64Split in logical px (at the corners when radial).
degOption<f64>None: radial (grows from the centre); Some(deg): one direction.

Methods

  • fn radial(px: f64) -> Self
  • fn directional(px: f64, deg: f64) -> Self

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Cloth

pub struct Cloth { /* see fields */ }

A banner hanging from its top edge: a 2.5D position-based cloth (it also swings in depth, which shows as foreshortening and as light and shade in its folds), blown by fields and an optional steady breeze.

Public fields

fieldtype
nxusize
nyusize
gravityf64
breezef64Steady breeze: peak acceleration (px/s²) along x, and its gust frequency (Hz).
gustf64
dampingf64
field_gainf64
shadef64Shading strength of the folds.
fieldsVec<std::rc::Rc<dyn Field>>

Methods

  • fn new() -> Cloth
  • fn grid(self, nx: usize, ny: usize) -> Self
  • fn breeze(self, accel: f64, hz: f64) -> Self — A steady breeze of this peak acceleration (px/s²) that gusts at hz.
  • fn shade(self, s: f64) -> Self
  • fn field(self, f: Rc<dyn Field>) -> Self

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::prelude::Column

pub struct Column { /* see fields */ }

A column of a [DataTable].

Methods

  • fn new(title: impl AsRef<str>) -> Self — A sortable column titled title, flexible width 1.
  • fn grow(self, g: f64) -> Self — Relative width (flex weight).
  • fn right(self) -> Self — Right-align (numbers).
  • fn no_sort(self) -> Self — Header is not clickable.
  • fn secondary(self) -> Self — Hidden at the Compact (phone) size class.

Trait implementations: Clone, From<T>

structaster_blueprint::ui::prelude::Command

pub struct Command { /* see fields */ }

A command for the [command_palette].

Methods

  • fn new(id: impl AsRef<str>, title: impl AsRef<str>, action: Action) -> Self
  • fn hint(self, h: impl AsRef<str>) -> Self — A shortcut or category shown on the right ("Ctrl T": split on spaces into key caps).
  • fn icon(self, i: Icon) -> Self

Trait implementations: Clone

structaster_blueprint::ui::prelude::Conic

pub struct Conic { /* see fields */ }

A conic (angular sweep) gradient. conic([..]).spin(30.).el().

Public fields

fieldtype
colsVec<ui::el::Col>
anglef64Start angle in degrees (0 = pointing right, clockwise).
center[f64; 2]Centre as fractions of the box.
spinf64Degrees per second (0 = still).
loopedboolThe sweep wraps back to the first colour (seamless).

Methods

  • fn angle(self, deg: f64) -> Self
  • fn center(self, fx: f64, fy: f64) -> Self
  • fn spin(self, deg_per_s: f64) -> Self
  • fn open(self) -> Self — Do not wrap: the last colour is the end of the sweep.
  • fn el(self) -> El — The gradient as an element that fills its box (.size, .radius, .grow apply).

Trait implementations: Clone, Debug, From<Conic>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::CoonsMesh

pub struct CoonsMesh { /* see fields */ }

A grid of cols x rows nodes (row-major), (cols - 1) x (rows - 1) patches.

Public fields

fieldtype
colsusize
rowsusize
nodesVec<MeshNode>
spacesuper::color::Space
colorMeshColor

Methods

  • fn grid(cols: usize, rows: usize, col: impl Fn(usize, usize) -> Col) -> CoonsMesh — A regular grid with straight edges, coloured by col(i, j) (i across, j down).
  • fn node(&self, i: usize, j: usize) -> &MeshNode
  • fn node_mut(&mut self, i: usize, j: usize) -> &mut MeshNode
  • fn at(self, i: usize, j: usize, x: f64, y: f64) -> CoonsMesh — Move a node (box fractions).
  • fn col(self, i: usize, j: usize, c: impl Into<Col>) -> CoonsMesh
  • fn handle(self, i: usize, j: usize, which: usize, d: [f64; 2]) -> CoonsMesh — Set one handle (EAST, WEST, SOUTH, NORTH) of a node.
  • fn space(self, s: Space) -> CoonsMesh
  • fn color_mode(self, c: MeshColor) -> CoonsMesh
  • fn straight_handles(&mut self) — Handles a third of the way to each neighbour: straight edges.
  • fn smooth_handles(self) -> CoonsMesh — Catmull-Rom handles: each grid line becomes a smooth curve through its nodes.
  • fn twist(self, i: usize, j: usize, deg: f64, scale: f64) -> CoonsMesh — Rotate and scale the handles of node (i, j) (a swirl), keeping east/west and north/south opposite.
  • fn prepare(&self, f: impl Fn(Col) -> [u8; 4]) -> MeshPrep — Resolve colours (f: a colour to sRGB bytes) into mixing coordinates and derivatives.
  • fn drifted(&self, t: f64, seed: u64, pull: Option<[f64; 2]>) -> CoonsMesh — The mesh t seconds into a slow drift: interior nodes wander on Lissajous paths (periods of 9 to 23 s, at most 13 % of a cell) and their handles turn a little; edge nodes slide along their edge; corners stay, so the outline is always the box. pull (box fractions): nodes near it lean towards it (a pointer's gravity). Deterministic in t and seed.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Cut

pub struct Cut { /* see fields */ }

A screen transition. Cut::dissolve().edge(hex(0xff9a3d), 2.).ms(700).

Angles are degrees with y down: 0 travels left to right, 90 top to bottom.

Methods

  • fn dissolve() -> Cut — Seeded fBm noise threshold: the new screen appears where the noise is low first.
  • fn wipe(angle_deg: f64) -> Cut — A soft edge sweeping across at angle_deg; the new screen follows it.
  • fn iris() -> Cut — A circle opening from a point (the pointer when known, else the centre). .close() shrinks the old screen instead.
  • fn pixelate() -> Cut — The old screen breaks into growing blocks, the new one resolves from them.
  • fn push() -> Cut — The old screen slides out and shrinks while the new one slides in and grows. angle: 180 (default) leaves left.
  • fn fade() -> Cut — A plain cross-fade: every pixel mixes old into new by the eased progress (no front, no noise). The look of a theme switch (App::theme_fade).
  • fn seed(self, seed: u32) -> Self — Noise seed (dissolve).
  • fn grain(self, px: f64) -> Self — Noise feature size in logical px (dissolve).
  • fn octaves(self, n: u32) -> Self
  • fn value_noise(self) -> Self — Blocky value noise instead of smooth Perlin (dissolve).
  • fn edge(self, color: impl Into<Col>, width: f64) -> Self — A glowing band in color along the front (all but pixelate and push). width 1 is about 4 % of the travel; 2 is a thick burn.
  • fn angle(self, deg: f64) -> Self — Direction of the wipe or push.
  • fn feather(self, f: f64) -> Self — Softness of the front as a fraction of the travel (0.02 crisp, 0.3 very soft).
  • fn hard(self) -> Self — A one-pixel-antialiased front.
  • fn at(self, x: f64, y: f64) -> Self — Iris centre as fractions of the screen (default: the pointer, else 0.5, 0.5).
  • fn close(self) -> Self — Iris closing on the old screen (it shrinks into the point) instead of opening onto the new one.
  • fn blocks(self, px: f64) -> Self — Largest mosaic block in logical px.
  • fn screen(self) -> Self — Play over the whole screen wherever cut_on puts it (the meaning of a nested cut_on before region cuts existed).
  • fn region(self) -> Self — Play inside the declaring element's rectangle, also on the tree root.
  • fn ms(self, ms: u32) -> Self — A literal duration in ms (still instant under reduced motion).
  • fn duration(self, d: MotionDuration) -> Self — A theme duration (MotionDuration::Slow ...).
  • fn ease(self, e: Ease) -> Self — A theme curve.
  • fn token(self, t: MotionToken) -> Self — A duration and curve from a theme token (MotionToken::EMPHASIZED).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::DataTable

pub struct DataTable { /* see fields */ }

Sortable, filterable, paged table with optional row selection.

Store keys (all optional to initialise; missing = default): Text <key>.sort (column index or ""), Bool <key>.desc, Text <key>.q (filter), Int <key>.page (0-based), Text list <key>.sel (selected row numbers as text; read them with [DataTable::selected]). Ids: headers <key>.h.<col>, select-all <key>.all, row boxes <key>.sel.<row>, filter field <key>.q, pager <key>.page.*.

Methods

  • fn new<C: Into<Column>>(s: &Store, key: impl AsRef<str>, cols: impl IntoIterator<Item = C>, rows: Vec<Vec<String>>) -> Self — rows[r][c] is the text of cell c of row r (row number r is the stable row id).
  • fn page_size(self, n: usize) -> Self — Rows per page (default 8).
  • fn search(self, on: bool) -> Self — Show or hide the filter box (default shown).
  • fn selectable(self) -> Self — Checkbox column with select-all.
  • fn cell(self, f: impl Fn(usize, usize, &str) -> Option<El> + 'static) -> Self — Custom cell element: return None to use the plain text.
  • fn selected(s: &Store, key: &str) -> Vec<usize> — Selected row numbers (ascending) of table key.
  • fn order(&self) -> Vec<usize> — Row numbers after filtering and sorting (what the pager slices), for assertions.
  • fn build(self) -> El

Trait implementations: From<DataTable>

structaster_blueprint::ui::prelude::DataView

pub struct DataView { /* see fields */ }

The states every data view has, in one place: [loading_state] while Bool <key>.loading, [error_state] with a retry while Text <key>.error is not empty, [empty_state_icon] when there is nothing (count == 0), else view(). The first that applies wins, in that order. The retry button <key>.retry ("Try again") clears the error and sets <key>.loading again (the app starts its request when it sees the flag); .on_retry(..) adds an action of your own. Works around anything that has a count: a list, a chart's data, a grid_auto of cards, a shelf.

data_view(s, "hosts", rows.len(), || hbar_chart(&values, &names)).empty(empty_state("∅", "No hosts", "Add one")).build()

Methods

  • fn loading(self, el: El) -> Self — Your own loading placeholder (skeleton_card()s in a grid_auto) instead of [loading_state].
  • fn empty(self, el: El) -> Self — Your own empty state ("Nothing matches" with a "Clear filters" button).
  • fn error_title(self, title: impl AsRef<str>) -> Self — The error panel's title (the detail is the Text <key>.error).
  • fn on_retry(self, action: Action) -> Self — Run action as well when "Try again" is clicked.
  • fn keep_stale(self) -> Self — Keep showing the view while it has rows, whatever the loading and error flags say (a refresh in the background, a failed refresh): the placeholders then stand in for an empty view only.
  • fn build(self) -> El

Trait implementations: From<DataView>

structaster_blueprint::ui::prelude::DatePicker

pub struct DatePicker { /* see fields */ }

Builder for [date_picker].

Methods

  • fn min(self, d: Ymd) -> Self — Earliest selectable date.
  • fn max(self, d: Ymd) -> Self — Latest selectable date.
  • fn placeholder(self, p: impl AsRef<str>) -> Self
  • fn week_start(self, d: Weekday) -> Self — The first column of the calendar (default Monday; Weekday::Sunday for the US, Saturday for much of the Middle East).
  • fn month_names(self, names: [&str; 12]) -> Self — Month names, January first (default English). The field shows the first three characters.
  • fn weekday_names(self, names: [&str; 7]) -> Self — Weekday headers, Monday first whatever [DatePicker::week_start] is (default Mo Tu We ..).
  • fn build(self) -> El

Trait implementations: From<DatePicker>

structaster_blueprint::ui::prelude::Density

pub struct Density { /* see fields */ }

Density rules: how big the UI should be, given the panel and the viewing distance.

Public fields

fieldtype
scalef64Device px per logical px.
distanceDistanceHow far away the user sits.

Methods

  • fn new(scale: f64, distance: Distance) -> Self
  • fn ui_scale(&self) -> f64 — The recommended multiplier for every dp size (type, spacing, targets).
  • fn text_scale(&self) -> f64 — The recommended multiplier for type only: the 10-foot UI needs ~1.5x the text.
  • fn min_touch_dp(&self) -> f64 — The smallest comfortable touch target (dp).
  • fn min_focus_dp(&self) -> f64 — The smallest comfortable focus target (dp): bigger when the user aims with a D-pad.
  • fn focus_ring_dp(&self) -> f64 — The focus ring thickness (dp).
  • fn min_touch_px(&self) -> f64 — The touch target in layout px (dp times the UI scale).
  • fn min_focus_px(&self) -> f64 — The focus target in layout px.
  • fn focus_ring_px(&self) -> f64 — The focus ring in layout px.
  • fn min_target_dp(&self, input: Input) -> f64 — The smallest interactive target (dp): a finger needs 48, a D-pad 64.
  • fn min_target_px(&self, input: Input) -> f64 — The smallest interactive target in layout px.
  • fn theme(&self, th: &Theme) -> Theme — The theme this density asks for: the type scale through the theme's type steps. (The focus ring is not in the theme: the app draws it with the one width of the surface, see App::focus_ring_px.)
  • fn hairline(&self) -> f64 — One device pixel in layout px (the hairline width).
  • fn snap(&self, px: f64) -> f64 — Snap a length to a whole device pixel.
  • fn snap_rect(&self, r: Rect) -> Rect — Snap a rectangle: its edges land on device pixels, its size follows.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Distort

pub struct Distort { /* see fields */ }

Shockwave, haze and chromatic aberration for .distort(..) / [distort_below].

Public fields

fieldtype
shockOption<Shock>
hazeOption<Haze>
chromaOption<Chroma>
onOption<String>Store counter that fires the shockwave (default: a click on the element).
atOption<[f64; 2]>Fixed ring origin as fractions of the box (default: the pointer when it fired).
seedu64

Methods

  • fn shockwave_on_click() -> Self — A ring from the click point (needs .id() on an element; for an overlay name a counter with .on(..)).
  • fn shockwave() -> Self — The same ring, meant to be fired with [Distort::on].
  • fn haze() -> Self — Heat shimmer.
  • fn underwater() -> Self — Underwater wobble.
  • fn chromatic() -> Self — A static radial RGB split.
  • fn shock(self, s: Shock) -> Self
  • fn haze_with(self, h: Haze) -> Self
  • fn chroma(self, c: Chroma) -> Self
  • fn on(self, key: &str) -> Self — Fire the shockwave when the store counter key changes (instead of on click).
  • fn at(self, fx: f64, fy: f64) -> Self — Always start the ring at these fractions of the box.
  • fn seed(self, seed: u64) -> Self

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::El

pub struct El { /* see fields */ }

One element of the UI tree. Build with [col], [row], [text] and the components; chain modifiers; hand the root to [crate::ui::Screen].

Methods

  • fn action(self, action: Action) -> El — Run action when clicked (alias of .on_click(action), reads well after [clickable]).
  • fn tone(self, role: Role) -> El — Re-tone a [clickable]: Role::Accent primary, Role::Danger / Role::Warning risky, Role::Info secondary.
  • fn primary(self) -> El — A solid [clickable]: the role's own face, a lit rim and a coloured halo (the call to action of a screen). The label wears the role's readable ink.
  • fn solid(self, role: Role) -> El — A solid [clickable] in a role: the danger of a form, the accent of a hero.
  • fn ghost(self) -> El — Quiet [clickable]: no fill or outline until hovered, tight padding (icon buttons, toolbars).
  • fn ghost_start(self) -> El — ghost() with the label at the start of the row instead of centred (sidebar items, list rows). ghost() keeps its centred look, so nothing that used it moves.
  • fn right(self, slot: impl Into<El>) -> El — Header slot at the top right of a [panel], level with the title (a [legend], a [badge], a [toggle_chip], a small button): panel("Throughput", "per min", [..]).right(legend(&[("Peak", Role::Warning)])). Calling it again replaces the slot. Anywhere but a panel(..) it is a refusal reported by render.
  • fn ringed(self) -> El — A soft ring around an [avatar]: avatar("R", Role::Warning).ringed(). Anywhere but an avatar(..) it is a refusal reported by render.
  • fn value(self, shown: impl AsRef<str>) -> El — Custom right-hand text of a [meter_row] instead of the percentage (meter_row("Filament", 0.4, Role::Info).value("1.2 kg"); "" shows none). Anywhere else this is a refusal reported by render.
  • fn logo(self, logo: impl Into<El>) -> El — Logo slot of an [app_bar], left of the title (a [logo_tile], an icon, any element). Anywhere but an app_bar(..) it is a refusal reported by render.
  • fn rule(self, from: impl Into<Col>, to: impl Into<Col>) -> El — A 2 px horizontal gradient rule along the bottom edge of an [app_bar] (.rule(Role::Accent, Role::Secondary); call it again to recolour). The bar keeps its height. Anywhere but an app_bar(..) it is a refusal reported by render.
  • fn shortcut(self, chord: Chord, action: Action) -> Self — Declare a global shortcut: the app runs action when the chord is pressed, even when nothing has focus. A chord with a modifier (Ctrl-K) also reaches the shortcut while a text field has focus; a plain chord never steals typing from a focused field (it only runs when nothing else handled the key).
  • fn on_hold(self, ms: u32, action: Action) -> Self — Run action after the element has been held down for ms: the pointer pressed on it and kept inside, or Space / Enter held while it has the focus. Letting go earlier cancels (Cancel(Released), nothing runs); the action runs once, at the moment the time is up, and the element must be released before it can run again. The hold is shown by Scalar <id>.hold (0..1; in quarters under reduced motion) and Bool <id>.holding; the app announces the start and the result. See hold_button. Needs an .id().
  • fn on_click(self, action: Action) -> Self — Run action when the element is clicked (pointer press+release inside, or Enter/Space when focused). Needs an .id().
  • fn on_hover(self, enter: Action, leave: Action) -> Self — Run enter when the pointer enters (or a descendant), leave when it leaves.
  • fn on_focus(self, action: Action) -> Self
  • fn on_blur(self, action: Action) -> Self
  • fn on_key(self, key: Key, action: Action) -> Self — Key-down while this element (or a descendant) has focus. Replaces Enter/Space activation for that key.
  • fn on_key_plain(self, key: Key, action: Action) -> Self — Like [El::on_key], but only for the bare key (Ctrl allowed): with Shift, Alt or Meta held the key falls through to the element's own handler. text_area(..).submit_on_enter(..) is built on it (Shift+Enter keeps its newline).
  • fn on_pad(self, pad: super::focus::Pad, action: Action) -> Self — A pad button that has no key of its own (Pad::X, Y, Start, Select) while this element (or a descendant) has focus. With nothing focused (or nothing on the way up from the focus) the first element on the screen that declares the button answers; inside an open dialog, the first one inside the dialog. Needs an .id(). App::on_pad binds a button for the whole app.
  • fn on_key_fn(self, f: impl Fn(&mut Store, Key, KeyModifiers) -> bool + 'static) -> Self — Any key while focused; return true when handled (text fields, lists).
  • fn on_input(self, f: impl Fn(&mut Store, super::text_input::Input, &mut super::text_input::InputEnv<'_>) -> bool + 'static) -> Self — Keys and IME composition events while focused, with host services (clipboard); return true when handled. Used by text inputs.
  • fn on_pointer(self, f: impl Fn(&mut Store, Ptr) + 'static) -> Self — Pointer press and drag over the element (sliders).
  • fn on_hover_move(self, f: impl Fn(&mut Store, Ptr) + 'static) -> Self — Pointer position while merely hovering (and while dragging) over the element: f runs on every move inside it. Used by interactive backgrounds (ui::fluid). Needs an .id().
  • fn on_text_pointer(self, f: impl Fn(&mut Store, Ptr, bool, &mut dyn FnMut(&str) -> f64) + 'static) -> Self — Press and drag over a text element: like [El::on_pointer] but also given first (the initial press) and a measure(text) -> width in the body face, so a text field can map x to a caret position. Used by text_field.
  • fn on_wheel(self, f: impl Fn(&mut Store, f64) + 'static) -> Self — Wheel / scroll deltas in px (positive = down).
  • fn on_nav(self, f: impl Fn(&mut Store, super::focus::Dir) -> bool + 'static) -> Self — Answer a directional focus move yourself: f reads and writes the store (a virtual grid scrolls to the item the move lands on and sets "~focus" to its id) and returns true when it took the move. The hook is asked on the way up from the focus, before the spatial pick, so App::nav and the arrow keys agree.
  • fn measure(self) -> Self — Publish the resolved size of this element in the store as <id>.w and <id>.h, so a screen can size itself from the space it really got (a virtual grid reads its own).
  • fn captures_tab(self) -> Self — Opt in to receive Tab and Shift+Tab as ordinary keys while this element (or a descendant) has the focus, instead of moving the focus: a terminal's tab completion, a code editor's indent. on_key(Key::Tab, ..), on_key_fn and on_input see Key::Tab (with shift set for Shift+Tab); a key nothing handles is still swallowed, so the focus never moves by accident. The element is made focusable and carries the tree flag captures-tab. Focus traversal everywhere else is unchanged.
  • fn focusable(self) -> Self — Reachable with Tab; click focuses it.
  • fn disabled_if(self, f: impl Fn(&Store) -> bool + 'static) -> Self — Disabled while f(store) is true: no input, dimmed, skipped by Tab. Applies to the whole subtree.
  • fn disabled(self, on: bool) -> Self — [El::disabled_if] for a state you already know while building the screen: .disabled(s.bool("busy")).
  • fn selected(self, on: bool) -> Self — [El::selected_if] for a state you already know while building the screen: .selected(s.int("tab") == 2).
  • fn selected_if(self, f: impl Fn(&Store) -> bool + 'static) -> Self — Selected while f(store) is true, symmetric with [El::disabled_if]: the theme's selected look is applied automatically (accent border and an accent-tinted fill over the element's own fill) and the element's UiTree node gets the selected flag. Put it on the interactive element (the one with .id() + .on_click), e.g. a list card or a tab.
  • fn skin(self, skin: Skin) -> Self — Choose how states are drawn (default [Skin::Fill]).
  • fn part(self) -> Self — State layers of the enclosing target are drawn on this descendant (the box of a checkbox, a slider thumb).
  • fn block(self) -> Self — Swallow pointer input (the panel of a dialog), without being focusable.
  • fn trap(self) -> Self — Focus trap: Tab cycles inside; focus moves in on appearance and is restored on removal.
  • fn focus_trap(self) -> Self — Focus trap (a dialog, a sheet, the command palette): the focus stays inside while it is open, moves in when it appears and is restored when it goes. Same as [El::trap].
  • fn focus_group(self, name: impl AsRef<str>) -> Self — A named focus group: the focusable descendants of this element are one group. The group remembers the child that had the focus, so coming back to it returns to the same child. The group wraps at its edges unless [El::focus_wrap] says otherwise.
  • ...and 179 more

Trait implementations: BackdropExt, BurstExt, ChartExt, Clone, Debug, DeformExt, DepthExt, DistortExt, From<&str>, From<Bloom>, From<Conic>, From<DataTable>, From<DataView>, From<DatePicker>, From<Field>, From<Flare>, From<Flow>, From<Grad>, From<IconEl>, From<KineFx>, From<LightLeak>, From<LightShafts>, From<Mesh>, From<Parallax> ...

structaster_blueprint::ui::prelude::Extrusion3d

pub struct Extrusion3d { /* see fields */ }

A 2D outline pushed into a solid: a path, a polygon or the glyphs of a text.

let logo = Extrusion3d::path(shape_commands).height(2.0).depth(0.5).bevel(0.05);
Object3d::new(logo).material(Material3d::glossy(hex(0xff7a30)))

Methods

  • fn path(cmds: impl IntoIterator<Item = ui::vector::VectorCommand>) -> Extrusion3d — The closed sub-paths of cmds (curves are flattened; sub-paths nest by even-odd, so a counter is a hole). The path's own units are scaled to height tall once .height(..) is given.
  • fn polygon(points: &[[f64; 2]]) -> Extrusion3d — A polygon (counter-clockwise or clockwise; y down like a path).
  • fn text(el: El, w: f64, h: f64) -> Extrusion3d — The glyphs of el (a text element with the font and weight you want; it is drawn white on transparent at w x h logical pixels and its outline is traced). Needs fonts, so it appears only when the scene is drawn by a screen.
  • fn height(self, h: f64) -> Self — World height of the finished outline (default 1).
  • fn depth(self, d: f64) -> Self — Thickness along z (default 0.25).
  • fn bevel(self, b: f64) -> Self — Chamfer on both faces (default 0.02): the bevel is what catches the light on an edge.
  • fn tracking(self, t: f64) -> Self — Extra space between the glyphs of an extruded text, as a fraction of its height (default 0.05): the letters of a tight font touch once they have depth.
  • fn bulge(self, b: f64) -> Self — Lean the face normals outward from the middle (0.3 a gentle dome): a flat face then sweeps its reflection across the studio like polished metal instead of showing one flat colour.
  • fn geometry(self) -> Geometry3d

Trait implementations: Clone, From<Extrusion3d>

structaster_blueprint::ui::prelude::Field

pub struct Field { /* see fields */ }

Builder returned by [field]; .build() (or .into() / .child(..)) gives the [El].

Methods

  • fn label(self, label: impl AsRef<str>) -> Self — A caption above the control; it is the control's label.
  • fn hint(self, hint: impl AsRef<str>) -> Self — Helper text under the control, muted; an error replaces it while there is one.
  • fn required(self) -> Self — Mark the field required: a * after the label, "Required" in the control's description, and an error ("Required") once the control was left while its Text or List value is empty. A Bool (a checkbox, a switch) must be true: "I accept the terms". Other kinds of value always pass; use validate for those.
  • fn required_msg(self, msg: impl AsRef<str>) -> Self — required with your own message ("Pick a country").
  • fn validate(self, f: impl Fn(&Store) -> Result<(), String> + 'static) -> Self — A rule over the store (it sees every key, so it can check a stepper, a date or two fields together). Its Err(message) shows under the control, in the danger role, once the control was left (<key>.touched).
  • fn error(self, msg: impl AsRef<str>) -> Self — An error that shows at once, whatever the control holds (a server's answer). It wins over a rule's.
  • fn form(self, form: &Form) -> Self — Register the field's rules (required and validate) with a [Form].
  • fn build(self) -> El — Build the element.

Trait implementations: From<Field>

structaster_blueprint::ui::prelude::Flare

pub struct Flare { /* see fields */ }

Lens flare: lens_flare(Flare::new().follow_pointer()). A hot core, an anamorphic horizontal streak, ghost rings and hexagonal bokeh along the axis through the screen centre; fades as the light nears the screen edge.

Public fields

fieldtype
at[f64; 2]Light position as fractions of the screen.
colorui::el::Col
intensityf64
streakf64
ghostsusize
bokehbool
fade_fromf64Fraction of the way to the edge where the fade starts.
followbool
orbitf64Cycles per second of an animated Lissajous path around at (0 = fixed).
blendaster_ui::BlendMode

Methods

  • fn new() -> Self
  • fn at(self, x: f64, y: f64) -> Self
  • fn color(self, c: impl Into<Col>) -> Self
  • fn intensity(self, v: f64) -> Self
  • fn streak(self, v: f64) -> Self — Length of the horizontal streak 0..=2 (0 = none).
  • fn ghosts(self, n: usize) -> Self — Number of ghosts 0..=7.
  • fn bokeh(self, on: bool) -> Self — Hexagonal bokeh on every other ghost (false: rings only).
  • fn fade_from(self, v: f64) -> Self — Fade begins this far (0..1) from the centre toward the edge.
  • fn follow_pointer(self) -> Self — The light follows the pointer (static at at without one and under reduced motion).
  • fn orbit(self, cps: f64) -> Self — The light drifts on a slow path around at, cps cycles per second (static under reduced motion).
  • fn blend(self, mode: BlendMode) -> Self
  • fn spec(&self, at: [f64; 2], rgb: [u8; 3], alpha: f64, size: [f64; 2]) -> FlareSpec — The spec for a w x h picture with the light at fractions at (edge falloff applied).
  • fn el(self) -> El

Trait implementations: Clone, Copy, Debug, Default, From<Flare>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Flicker

pub struct Flicker { /* see fields */ }

A looped glitch flicker over finished text: every every seconds a burst of burst seconds shifts slices sideways, splits the colour channels and dims the text.

Public fields

fieldtype
everyf64
burstf64
amountf64

Methods

  • fn new() -> Self
  • fn every(self, secs: f64) -> Self
  • fn burst(self, secs: f64) -> Self
  • fn amount(self, a: f64) -> Self — Displacement and dimming strength, 0..=2.

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Flow

pub struct Flow { /* see fields */ }

An animated linear gradient whose bands drift and undulate (hero backgrounds, progress shimmer). Looped, so the motion is seamless.

Public fields

fieldtype
colsVec<ui::el::Col>
anglef64Direction in degrees (0 = left to right).
speedf64Scroll speed in cycles per second (0 = still).
warpf64Undulation of the bands 0..1.
stepf64The picture is rebuilt every step seconds (0 = every frame).

Methods

  • fn angle(self, deg: f64) -> Self
  • fn speed(self, cycles_per_s: f64) -> Self
  • fn warp(self, w: f64) -> Self
  • fn step(self, secs: f64) -> Self — Rebuild the picture every secs seconds (default 0.2; 0 = every frame).
  • fn el(self) -> El

Trait implementations: Clone, Debug, From<Flow>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::FluidSpec

pub struct FluidSpec { /* see fields */ }

Everything a fluid element needs; build with the chained modifiers.

let spec = FluidSpec::smoke().ink(Role::Accent).background(Role::Surface).brush(0.05, 30.);

Methods

  • fn new() -> Self — 128 x 72 cells, ink look: swirls that linger, no emitters.
  • fn smoke() -> Self — Smoke: dye rises, fades in about a second, three soft white plumes along the bottom edge.
  • fn ink_pool() -> Self — Ink: slow, glowing colour that stays for a long time. Colour it with [FluidSpec::ink], or give the brush a hue cycle with [FluidSpec::rainbow].
  • fn embers() -> Self — Embers: one scalar dye coloured by the ember ramp, two jets sweeping in from the left.
  • fn config(self, config: FluidConfig) -> Self — Replace the simulation parameters.
  • fn cells(self, cols: usize, rows: usize) -> Self — Grid size in cells (default 128 x 72; the image is stretched over the element).
  • fn cells_for(self, cols: usize, w: f64, h: f64) -> Self — cols cells across and as many rows as keep the cells square in a w x h box (the rows are clamped to 8..=1024), so the simulation does not stretch with the box's aspect.
  • fn style(self, style: FluidStyle) -> Self — Replace the look (exposure, glow, ramp, upscale). background is taken from the theme unless this style sets one and [FluidSpec::background] is not called.
  • fn emitter(self, e: Emitter) -> Self — Add a continuous source.
  • fn emitters(self, list: impl IntoIterator<Item = Emitter>) -> Self
  • fn obstacle(self, o: Obstacle) -> Self — A static solid region (rect or circle, 0..1 coordinates).
  • fn warmup(self, seconds: f32) -> Self — Seconds of simulation to run before the first frame, so an ambient background is not empty when it appears. Default: 1.5 for a fluid with emitters, 0 otherwise.
  • fn pointer(self, p: FluidPointer) -> Self — How the pointer stirs it (default: while dragging).
  • fn brush(self, radius: f32, force: f32) -> Self — Pointer brush: radius in widths and the velocity per width dragged (default 0.045 and 30).
  • fn brush_color(self, c: impl Into<Col>) -> Self — Dye the pointer leaves (a theme colour). Default: the ink, or white.
  • fn rainbow(self) -> Self — The brush hue cycles along the stroke.
  • fn ink(self, c: impl Into<Col>) -> Self — Colour of emitters and brush that did not pick their own (a theme colour).
  • fn background(self, c: impl Into<Col>) -> Self — The colour the dye is added to (a theme colour; default Role::Background, so the fluid blends into the screen). Pass None-like transparency with [FluidSpec::transparent].
  • fn round_clip(self) -> Self — Clip the picture to the element's corner radius (.radius(..) / .round() on the fluid): the picture is resampled to the device pixels of the box and the corners are cut with an antialiased edge. Off by default (the image is the plain rectangle); costs one resample of the box per new frame.
  • fn transparent(self) -> Self — Premultiplied light over whatever is behind the element (no background colour).
  • fn exposure(self, e: f32) -> Self
  • fn glow(self, g: f32) -> Self
  • fn ramp(self, stops: Vec<(f32, [u8; 3])>) -> Self — Colour ramp (position 0..1, sRGB) for the density; see [FluidStyle::ember] / [FluidStyle::ice].
  • fn upscale(self, n: usize) -> Self — Output pixels per cell, 1..=4 (sharper, costs time).

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::prelude::Fog

pub struct Fog { /* see fields */ }

A fog bank. Build with [Fog::bank] or [Fog::height], turn into an element with [fog].

Methods

  • fn bank() -> Self — A bank of drifting fog that fades out toward the top and bottom of its box.
  • fn height() -> Self — Height fog: thickest at the bottom of its box, thinning upward.
  • fn color(self, c: impl Into<Col>) -> Self — Fog colour (before the scene light tints it).
  • fn density(self, v: f64) -> Self — Peak opacity 0..=1.
  • fn scale(self, px: f64) -> Self — Size of the biggest billows in px.
  • fn drift(self, vx: f64, vy: f64) -> Self — Drift in px per second ((0, 0) bakes once and never changes).
  • fn depth(self, z: f64) -> Self — Depth of the bank in px for the scene's pointer parallax (negative: far, moves less and the other way).
  • fn seed(self, seed: u32) -> Self — Seed of the noise.
  • fn shafts(self, strength: f64) -> Self — Beams of the scene light through the fog, 0..=2 (0, the default, is none). Shadowed behind opaque elements.
  • fn sky(self, backdrop: &El) -> Self — The backdrop alone, for the shafts' occluders ([LightShafts::sky]).
  • fn band(self, top: f64, bottom: f64) -> Self — A bank occupies this band of its box (fractions from the top; default 0.15..0.9).
  • fn rise(self, frac: f64) -> Self — Height fog fills this fraction of its box from the bottom (default 0.5).

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::Fog3d

pub struct Fog3d { /* see fields */ }

Volumetric fog: exponential depth fog, optional height fog, light scattered through the shadow map (god rays), noise.

Public fields

fieldtype
colorui::el::Col
densityf64
height_fallofff64
base_heightf64
scatterf64
anisotropyf64
noiseOption<FogNoise3d>
stepsusize
max_distancef64
ambientf64
motesf64

Methods

  • fn new(density: f64) -> Fog3d — Fog3d of extinction density per world unit (0.02 thin haze, 0.08 thick).
  • fn color(self, c: impl Into<Col>) -> Self
  • fn height(self, falloff: f64, base: f64) -> Self — Thin out above base: density falls by e every 1 / falloff units.
  • fn scatter(self, s: f64) -> Self — Brightness of the scattered light.
  • fn anisotropy(self, g: f64) -> Self — Phase function asymmetry -1..1 (Henyey-Greenstein): above 0 the light piles up when you look toward it.
  • fn noise(self, n: FogNoise3d) -> Self
  • fn steps(self, n: usize) -> Self — Samples per view ray (more is smoother and slower).
  • fn max_distance(self, d: f64) -> Self
  • fn motes(self, k: f64) -> Self — Dust motes that glint where the beams are (0 none, 1 subtle, 3 snowy). They drift with the scene's time.
  • fn ambient(self, a: f64) -> Self — How much the ambient light tints the fog.

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::FogNoise3d

pub struct FogNoise3d { /* see fields */ }

Noise that makes the fog patchy and, with drift, move.

Public fields

fieldtype
scalef64Size of a cloud in world units.
strengthf640..1: how far the density swings around its mean.
driftVec3World units per second the pattern travels.
seedu32

Methods

  • fn new(scale: f64, strength: f64) -> FogNoise3d
  • fn drift(self, d: Vec3) -> Self
  • fn seed(self, s: u32) -> Self

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Fold

pub struct Fold { /* see fields */ }

The hinge of a folding surface (logical px).

Public fields

fieldtype
hingelayout::RectThe hinge rectangle: a thin line through the surface.

Methods

  • fn vertical(x: f64, y: f64, h: f64) -> Self — A vertical crease at x, running from y for h.
  • fn horizontal(y: f64, x: f64, w: f64) -> Self — A horizontal crease at y, running from x for w.
  • fn rotated_cw(&self, h: f64) -> Fold — The hinge after the surface (of logical height h) is turned a quarter turn clockwise.
  • fn is_vertical(&self) -> bool — Is the hinge vertical (a book fold)?

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Form

pub struct Form { /* see fields */ }

A group of validated fields. form.can_submit(store) is true while every rule passes; bind a submit control to it with .disabled_if(form.disabled()), or give it form.submit(action), which runs the action only when the form is valid and otherwise reveals every error and moves the focus to the first field that fails. Create it once, outside the screen closure, and move a clone into it; fields register themselves when built. Around that: [Form::summary] (an error summary for the top), [Form::fail] / [Form::pending] / [Form::resolve] (a server's verdict, an async check), [Form::submit_on_enter], [Form::reset].

Methods

  • fn new() -> Self
  • fn rule(&self, key: impl AsRef<str>, f: impl Fn(&Store) -> Result<(), String> + 'static) -> &Self — Add a rule over the whole store for the field with id key (a select, a stepper, a date picker, or a check across fields such as "the two passwords match"). Err(message) blocks the form.
  • fn errors(&self, s: &Store) -> Vec<(String, String)> — (field key, message) for every failing rule, in the order the fields were built; a server answer given with fail counts while the field still holds the value it was given for.
  • fn submit_on_enter(&self, action: Action) -> Action — submit action, and make every single-line field built after this call submit it on Enter (a field with its own .on_key(Key::Enter, ..) keeps that). Returns the action for the submit button.
  • fn pending(key: impl AsRef<str>) -> Action — A check on key's current value is under way (a request to the server): the field shows "Checking..." where its hint is, and submit waits (it reveals the errors and focuses the field, as for any failing rule). Answer with fail or resolve; an edit of the value drops it too.
  • fn resolve(key: impl AsRef<str>) -> Action — The check started with pending passed: the field goes back to its hint.
  • fn fail(key: impl AsRef<str>, msg: impl AsRef<str>) -> Action — A server's (or any late) verdict on one field: Form::fail("email", "That email is taken") shows the message under the field at once, focuses it, and blocks submit until the field's value changes (then the answer no longer applies and goes away by itself). Run it from an action after the "request" finished.
  • fn summary(&self, s: &Store) -> El — A summary of the problems on the form for its top: a danger callout (heard as an alert) titled "N problems to fix" with one line per shown error, "Label: message", that moves the focus to its field when clicked or activated. Nothing until a field shows an error (after a failed submit, or once a field was left).
  • fn can_submit(&self, s: &Store) -> bool — Every registered rule passes (also true for a form with no rules).
  • fn disabled(&self) -> impl Fn(&Store) -> bool + 'static — Predicate for .disabled_if(..): true while the form cannot be submitted.
  • fn touch_all(&self) -> Action — Action that shows every field's error (put it on a disabled-looking submit, or run it on Enter).
  • fn reset(&self) -> Action — Hide every error again: clears each field's touched flag and the server answers given with fail (the values stay; empty them yourself). Run it after a successful submit or from a "Clear" button.
  • fn focus_first_error(&self) -> Action — Reveal every error and focus the first field that fails (nothing happens when the form is valid).
  • fn submit(&self, action: Action) -> Action — Run action when every rule passes; otherwise reveal every error and focus the first failing field instead. Put it on the submit element and on .on_key(Key::Enter, ..) of the fields.

Trait implementations: Clone, Default

structaster_blueprint::ui::prelude::Freeform

pub struct Freeform { /* see fields */ }

Public fields

fieldtype
pinsVec<Pin>
linesVec<Line>
blendBlend
spacesuper::color::Space

Methods

  • fn new() -> Freeform
  • fn point(self, x: f64, y: f64, col: impl Into<Col>) -> Freeform
  • fn point_spread(self, x: f64, y: f64, col: impl Into<Col>, spread: f64) -> Freeform — A point with its own reach.
  • fn line(self, pts: impl IntoIterator<Item = ([f64; 2], Col)>, spread: f64) -> Freeform
  • fn blend(self, b: Blend) -> Freeform
  • fn space(self, s: Space) -> Freeform
  • fn render(&self, w: usize, h: usize, aspect: f64, f: impl Fn(Col) -> [u8; 4]) -> Field — Evaluate on a w x h grid for a box of aspect w_box / h_box.

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Gauge

pub struct Gauge<'a> { /* see fields */ }

Measures text for a [responsive_gauge] builder: the real shaped width in the screen's faces and the theme's type steps. A text that cannot be shaped (no face for it) is estimated per letter instead, see [Gauge::exact].

Methods

  • fn theme(&self) -> &Theme — The theme the tree is resolved under.
  • fn exact(&self) -> bool — Whether widths are shaped (true) or estimated per letter (false).
  • fn width(&self, text: &str, ty: Type) -> f64 — Width of text set in type step ty (its size and weight under the theme), in logical px.
  • fn width_px(&self, text: &str, px: f64, bold: bool) -> f64 — Width of text at px, in the bold face or the regular one.

structaster_blueprint::ui::prelude::Geometry3d

pub struct Geometry3d { /* see fields */ }

What an object is made of.

Methods

  • fn cube(w: f64, h: f64, d: f64) -> Geometry3d — A box w wide, h tall, d deep.
  • fn rounded_box(w: f64, h: f64, d: f64, radius: f64) -> Geometry3d — A box with rounded edges (radius is clamped to half the smallest side).
  • fn sphere(radius: f64) -> Geometry3d
  • fn torus(major: f64, minor: f64) -> Geometry3d — A torus lying flat: ring radius major, tube radius minor.
  • fn cylinder(radius: f64, height: f64) -> Geometry3d — A capped cylinder along y.
  • fn capsule(radius: f64, length: f64) -> Geometry3d — A capsule along y: length is the straight part between the two hemispheres.
  • fn plane(w: f64, d: f64) -> Geometry3d — A flat ground plane facing up, w by d.
  • fn from_mesh(m: Mesh) -> Geometry3d — Any mesh; the scene hash covers every vertex.
  • fn from_obj(bytes: &[u8]) -> Option<Geometry3d> — A Wavefront OBJ file (v, vn, f; polygons are fanned). None when it has no face.
  • fn mesh_ref(&self) -> Option<&Mesh> — The mesh behind a geometry (None for text, which exists once the scene is drawn).

Trait implementations: Clone, From<Extrusion3d>, From<Mesh>

structaster_blueprint::ui::prelude::Glass

pub struct Glass { /* see fields */ }

How the glass looks.

Public fields

fieldtype
blurf64Blur sigma in logical px.
tintui::el::ColTint colour and how strongly it covers 0..1.
tint_alphaf64
saturationf64Saturation of the backdrop (1 = unchanged, 1.4 = vivid).
brightnessf64Brightness multiplier of the backdrop.
edgef64Strength of the 1 px top-left edge highlight 0..1.

Methods

  • fn new() -> Self
  • fn blur(self, sigma: f64) -> Self
  • fn tint(self, c: impl Into<Col>, alpha: f64) -> Self
  • fn saturation(self, s: f64) -> Self
  • fn brightness(self, b: f64) -> Self
  • fn edge(self, e: f64) -> Self

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Glitch

pub struct Glitch { /* see fields */ }

Seeded slice offsets, RGB split and block corruption.

Public fields

fieldtype
seedu64
slicesu32Horizontal slices at full strength.
shiftf64Largest slice offset in logical px.
rgbf64RGB split in logical px.
blocksu32Corrupted blocks at full strength.
ratef64Glitch pictures per second.
durationf64Seconds a burst or a flicker lasts.
everyf64Mean seconds between ambient flickers (0 = none).
burstboolFires on a click / counter.
strengthf64
onOption<String>

Methods

  • fn burst() -> Self — A glitch burst on every click of the element (or .on(key)).
  • fn ambient() -> Self — An occasional ambient flicker, no trigger needed.
  • fn seed(self, seed: u64) -> Self
  • fn slices(self, n: u32) -> Self
  • fn shift(self, px: f64) -> Self
  • fn rgb(self, px: f64) -> Self
  • fn blocks(self, n: u32) -> Self
  • fn rate(self, fps: f64) -> Self
  • fn duration(self, seconds: f64) -> Self
  • fn every(self, seconds: f64) -> Self — Also flicker on its own about every seconds.
  • fn strength(self, s: f64) -> Self
  • fn on(self, key: &str) -> Self — Fire when the store counter key changes (instead of on click).

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Grad

pub struct Grad { /* see fields */ }

A gradient. Build with a constructor ([Grad::linear], [Grad::mesh], [Grad::aurora] ...), adjust with the modifiers, then use it as a fill (.grad_fill(g) or g.el()), a border, text, a glow or a gradient map.

Public fields

fieldtype
sourceSource
stopsStops
spreadSpread
repeatf64t is multiplied by this (repeating bands with Spread::Repeat/Reflect).
offsetf64Added to t (and to the conic angle as turns).
ditherDither
glowOption<(f64, f64)>Halo: (strength 0..=2, radius logical px).
speedf64Animation speed: ramp cycles per second for t fields (turns per second for conics), time scale for procedural fields. 0 = still.
timef64Start time in seconds (a still frame of an animated field).
scalef64Feature size of procedural fields (logical px per noise unit).
seedu32
view[f64; 2]Where the viewer / light is (box fractions): iridescence and metal highlights.
followboolThe view follows the pointer over the element (needs an .id).
qualityf64Resolution of coarse-evaluated fields (1 = default; 2 = four times the samples).
min_contrastOption<(ui::el::Col, f64)>Every resolved colour is fitted to keep this contrast against a background (gradient text).
vignettef64Darken towards the edges by this much (0..=1; see [Grad::vignette]).
fpsf64Pictures per second an animated gradient is rebuilt at (see [Grad::fps]).
bandsu32Horizontal bands an animated backdrop is re-baked in, one band per frame (see [Grad::bands]).

Methods

  • fn linear(angle: f64, stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Straight bands at angle degrees (0 = left to right, 90 = top to bottom).
  • fn radial(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Circles from the centre to the farthest corner (.ellipse, .focal, .center adjust).
  • fn conic(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — An angular sweep (seamless: the ramp wraps unless .open()).
  • fn diamond(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad
  • fn boxed(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Nested boxes (Illustrator's "square"/Photoshop's "box" shape).
  • fn spiral(arms: f64, twist: f64, stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — A spiral of arms ramps per turn and twist ramps from the centre to the edge (reflects).
  • fn path(pts: Vec<[f64; 2]>, curved: bool, closed: bool, map: PathMap, stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Distance in from the element's rounded edge (0 on the edge, 1 at depth px in). t along a path (pts box fractions; cubic Bézier chains p0, c1, c2, p1, .. with curved): the arc length of the nearest point on it ([PathMap::Along]) or the distance to it ([PathMap::Distance]). closed joins the end back to the start. Fills, borders and shapes take it like any gradient; .animate(speed) makes the bands flow along the path.
  • fn shape_burst(depth: f64, stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Distance in from the element's rounded edge (on a text: from the glyph outlines).
  • fn mesh(m: CoonsMesh) -> Grad
  • fn freeform(f: Freeform) -> Grad
  • fn lush(cols: impl IntoIterator<Item = impl Into<Col>>, seed: u64) -> Grad — A lush organic mesh from 3-6 colours (the first is the ground) and a seed.
  • fn warp(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Inigo Quilez's domain-warped flow through the ramp.
  • fn aurora(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Northern lights: the first stop is the night sky, the rest the curtains' colours.
  • fn silk(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Satin folds, gradient-mapped (dark fold to sheen).
  • fn liquid_metal(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Liquid chrome; the ramp tints the reflection (shadow to highlight).
  • fn iridescent(tint: f64, stops: impl IntoIterator<Item = impl Into<Stop>>) -> Grad — Thin-film interference (holographic foil); the ramp tints it by tint (0..=1).
  • fn named(t: GradToken) -> Grad — A gradient from the theme's palette.
  • fn center(self, x: f64, y: f64) -> Grad — Centre of a radial, conic, diamond, box or spiral (box fractions).
  • fn ellipse(self, rx: f64, ry: f64) -> Grad — Radial: radii as fractions of the box width and height.
  • fn focal(self, x: f64, y: f64) -> Grad — Radial: where t = 0 is (box fractions), inside the circle.
  • fn angle(self, deg: f64) -> Grad — Linear direction / conic start angle in degrees.
  • fn open(self, seam: f64) -> Grad — Conic: do not wrap the ramp; blend the last colour back into the first over seam degrees.
  • fn size(self, s: f64) -> Grad — Diamond / box size (1 = reaches the sides).
  • fn space(self, s: Space) -> Grad
  • fn hue(self, path: HuePath) -> Grad — Mix in OKLCH along path.
  • fn smooth(self, s: f64) -> Grad — 0 piecewise linear, 1 a smooth monotone spline through the stops.
  • fn stops(self, s: Stops) -> Grad
  • fn spread(self, s: Spread) -> Grad
  • fn repeat(self, n: f64) -> Grad
  • fn offset(self, o: f64) -> Grad
  • fn dither(self, d: Dither) -> Grad
  • fn glow(self, strength: f64, radius: f64) -> Grad — A halo of the gradient's own colours around the element: strength 0..=2, radius px.
  • fn animate(self, speed: f64) -> Grad — Animate: cycles (or turns, or time scale) per second. Freezes under reduced motion.
  • fn time(self, secs: f64) -> Grad
  • fn scale(self, px: f64) -> Grad
  • fn seed(self, s: u32) -> Grad
  • fn view(self, x: f64, y: f64) -> Grad
  • fn follow_pointer(self) -> Grad — The view (iridescence, metal highlight) follows the pointer. The element needs an .id.
  • fn quality(self, q: f64) -> Grad
  • fn min_contrast(self, bg: impl Into<Col>, ratio: f64) -> Grad — Fit every colour so it keeps ratio contrast against bg (text filled with this gradient).
  • ...and 13 more

Trait implementations: Clone, Debug, From<Grad>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Haze

pub struct Haze { /* see fields */ }

Noise-driven displacement.

Public fields

fieldtype
ampf64Peak displacement in logical px.
scalef64Feature size in logical px.
speedf64Noise time per second.
heatboolHeat shimmer: mostly sideways, rising, strongest toward the bottom. Otherwise a slow wobble in both axes.

Methods

  • fn heat() -> Self
  • fn water() -> Self
  • fn amp(self, px: f64) -> Self
  • fn scale(self, px: f64) -> Self
  • fn speed(self, s: f64) -> Self

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Hologram

pub struct Hologram { /* see fields */ }

Scanlines, flicker and a slight barrel curve.

Public fields

fieldtype
curvef64Barrel curve (0 = flat, 0.06 = a CRT).
scanf64Scanline darkness 0..1 and spacing in logical px.
spacingf64
flickerf64Brightness flicker 0..1.
rollf64Rolling bright bar, screens per second (0 = none).
tintui::el::Col
tint_amountf64How much of the picture's luma is recoloured toward the tint 0..1.
chromaf64RGB split in logical px at the corners.
vignettef64Corner darkening 0..1.
seedu64

Methods

  • fn new() -> Self
  • fn curve(self, k: f64) -> Self
  • fn scanlines(self, darkness: f64, spacing_px: f64) -> Self
  • fn flicker(self, f: f64) -> Self
  • fn roll(self, screens_per_s: f64) -> Self
  • fn tint(self, c: impl Into<Col>, amount: f64) -> Self
  • fn chroma(self, px: f64) -> Self
  • fn vignette(self, v: f64) -> Self
  • fn seed(self, seed: u64) -> Self

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Hx

pub struct Hx<'a> { /* see fields */ }

What a [reactive] builder can see and drive. See the module docs.

Methods

  • fn seconds(&self) -> f64 — Clock in seconds (frozen at [STILL_SECONDS] under reduced motion).
  • fn seconds_stepped(&self, step: f64, salt: u64) -> f64 — The clock held on a grid of step seconds (0 = every frame), with the grid offset by a hash of salt so several slow layers do not all change on the same frame. Slow drifts (nebulae, light leaks) use this so their picture is rebuilt a few times a second, not every frame: the steps are far below what the eye can see on a smooth gradient.
  • fn age_ms(&mut self) -> u64 — Milliseconds since this element was first built (a one-shot reveal starts here). A tree resolved outside the app's motion pass has no history: it is always 0.
  • fn now_ms(&self) -> u64 — Clock in ms as the app counts it (not frozen).
  • fn reduced_motion(&self) -> bool — The user prefers reduced motion: skip travel, keep a static composed frame.
  • fn store(&self) -> &Store
  • fn theme(&self) -> &Theme
  • fn rect(&self) -> Option<[f64; 4]> — This element's box last frame as [x, y, w, h] in screen px (None on the first frame or without an .id).
  • fn rect_of(&self, id: &str) -> Option<[f64; 4]> — Box of the element with .id(id) last frame as [x, y, w, h].
  • fn pointer(&mut self) -> Option<[f64; 2]> — Hover pointer in element-local px (None when outside the element). Asking makes the app re-render on pointer moves while this element is on screen.
  • fn pointer_in(&mut self, id: &str) -> Option<[f64; 2]> — Like [Hx::pointer] for the element with .id(id) (a wrapper watching its child).
  • fn pointer_frac(&mut self) -> Option<[f64; 2]> — Hover pointer as 0..=1 fractions of the element (None when outside).
  • fn pointer_frac_in(&mut self, id: &str) -> Option<[f64; 2]> — Like [Hx::pointer_frac] for the element with .id(id).
  • fn pointer_screen(&mut self) -> Option<[f64; 2]> — Pointer in screen px regardless of the element (None when the pointer left the window).
  • fn animate_forever(&mut self) — Declare ambient (endless) motion: the host keeps presenting frames while this is on screen. Not recorded under reduced motion.
  • fn spring(&mut self, name: &str, target: [f64; 4], cfg: SpringCfg) -> [f64; 4] — A spring toward target (four lanes; unused lanes stay 0). Starts at the first target it sees, so there is no flight on the first frame.
  • fn count(&mut self, name: &str, key: &str) -> &[HxEvent] — Watch the store counter key (an Action::inc(key, 1) bumped by a click). Returns the events recorded so far for name, newest last; a new one is recorded on the frame the counter changed, at the pointer position local to this element. The first frame only learns the current value (a restored counter does not replay old bursts).
  • fn count_in(&mut self, name: &str, key: &str, id: &str) -> &[HxEvent] — Like [Hx::count], positioned inside the element with .id(id).
  • fn count_screen(&mut self, name: &str, key: &str) -> &[HxEvent] — Like [Hx::count], with the pointer position in screen px (for screen overlays without an id).

structaster_blueprint::ui::prelude::HxEvent

pub struct HxEvent { /* see fields */ }

One event remembered by [Hx::count]: when (ms) and where (element-local px).

Public fields

fieldtype
at_msu64
xf64
yf64
nu641-based index of the event for this name (a stable per-event random seed).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::IconEl

pub struct IconEl { /* see fields */ }

An icon being configured. Chain .size(px), .color(..), .stroke(units), .filled(), then use it as a child (row([..]).child(icon) / .children) or call .el() / .into() to get an [El] for row([...]).

Methods

  • fn size(self, px: impl Into<f64>) -> Self — Side length in logical px (default 20). The stroke scales with it.
  • fn color(self, c: impl Into<Col>) -> Self — Ink colour: a Role, Role::X.tint(a), or hex(..).
  • fn stroke(self, units: impl Into<f64>) -> Self — Stroke width in grid units (default 2, i.e. size / 12 px).
  • fn filled(self) -> Self — Fill the path instead of stroking it (for user SVG paths drawn as solid shapes).
  • fn mirror_in_rtl(self) -> Self — Mirror this icon in a right-to-left subtree: a directional icon (an arrow, a chevron, a "back" mark) turns the other way, the way the reader expects. An icon that is not directional is left alone, so only the marks that mean a direction are mirrored.
  • fn id(self, id: impl AsRef<str>) -> Self — Stable element id for the UiTree.
  • fn el(self) -> El — The element (same as .into()).

Trait implementations: Clone, From<IconEl>

structaster_blueprint::ui::prelude::InputEnv

pub struct InputEnv<'a> { /* see fields */ }

Host services available to an input handler.

Public fields

fieldtype
clipboard&'a mut dyn Clipboard

structaster_blueprint::ui::prelude::Insets

pub struct Insets { /* see fields */ }

Safe-area insets (logical px): the edges a display cuts into (a notch, a rounded corner, an overscan border).

Public fields

fieldtype
lf64
tf64
rf64
bf64

Methods

  • const ZERO: Insets — No insets.
  • fn all(v: f64) -> Self — The same inset on all four sides.
  • const fn new(l: f64, t: f64, r: f64, b: f64) -> Self — Left, top, right, bottom.
  • const fn uniform(v: f64) -> Self — The same inset on all four sides (same as [Insets::all]).
  • fn is_zero(&self) -> bool — Whether every edge is exactly 0.
  • fn horizontal(&self) -> f64 — Left and right together.
  • fn vertical(&self) -> f64 — Top and bottom together.
  • fn max(self, o: Insets) -> Insets — The edge-wise maximum of two insets.
  • fn sanitized(self) -> Insets — Every edge finite and >= 0 (NaN, infinity and negative values become 0).
  • fn rotated_cw(self) -> Insets — The insets after the surface is turned a quarter turn clockwise (the top edge becomes the right edge, the right the bottom, the bottom the left, the left the top).
  • fn shrink(self, r: Rect) -> Rect — The safe rectangle inside r (never smaller than zero).

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Jelly

pub struct Jelly { /* see fields */ }

A soft body: a mass-spring lattice over the element's picture. It lags the body's acceleration, feels fields sampled at its nodes, and is poked by the pointer (a click dents it; a stroke drags it).

Public fields

fieldtype
nxusize
nyusize
stiffnessf64Spring of a node to its place (1/s²), damping (1/s), coupling to neighbours (1/s²).
dampingf64
couplingf64
coref64How much stiffer the middle is than the rim (a jelly wobbles at its edges).
inertiaf64Inertia: share of the body's acceleration felt by the nodes.
field_gainf64Field gain.
pokef64A click pushes the nearby nodes away by about this many px.
radiusf64Radius of a poke or stroke, px.
hoverf64Pointer stroke: acceleration per px/s of pointer speed (0 = off).
onOption<String>
fieldsVec<std::rc::Rc<dyn Field>>

Methods

  • fn new() -> Jelly
  • fn grid(self, nx: usize, ny: usize) -> Self
  • fn stiffness(self, k: f64) -> Self
  • fn damping(self, c: f64) -> Self
  • fn poke(self, px: f64) -> Self
  • fn hover(self, g: f64) -> Self
  • fn inertia(self, g: f64) -> Self
  • fn on(self, key: &str) -> Self — Poke on a store counter (Action::inc(key, 1)) instead of a click on the element itself.
  • fn field(self, f: Rc<dyn Field>) -> Self — A field this jelly always feels (published fields are felt too).

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::prelude::Kinetic

pub struct Kinetic { /* see fields */ }

A kinetic reveal. Start from [Kinetic::decode], [Kinetic::typewriter] or [Kinetic::stagger] and chain.

Public fields

fieldtype
modeMode
orderReveal
seedu64
durationf64Seconds from the first to the last glyph settling.
cpsOption<f64>Typewriter speed in glyphs per second (overrides duration).
delayf64Seconds to wait before starting.
glyphsGlyphs
caretbool
glowOption<ui::el::Col>Colour of the glow trail on newly revealed glyphs (None: no glow).
glow_secsf64
accentui::el::ColColour of scramble glyphs and freshly revealed ones; they cool into the text colour.
flickerOption<Flicker>
exitboolPlay in reverse: the text is shown, then leaves.
holdOption<f64>Reveal, stay for this long, then leave (one shot).
replayOption<String>Play again whenever this store counter changes.
tick_hzf64Scramble glyphs change this many times a second.

Methods

  • fn decode() -> Self — Random glyphs settle into the text.
  • fn typewriter() -> Self — One glyph at a time (.caret() adds a blinking caret, .cps(..) sets the speed).
  • fn stagger() -> Self — Glyphs fade, slide and scale in on a spring with overshoot.
  • fn seed(self, seed: u64) -> Self
  • fn duration(self, secs: f64) -> Self
  • fn cps(self, glyphs_per_sec: f64) -> Self
  • fn delay(self, secs: f64) -> Self
  • fn order(self, o: Reveal) -> Self
  • fn glyphs(self, g: Glyphs) -> Self
  • fn caret(self) -> Self — A blinking caret after the last typed glyph (typewriter), lingering about a second at the end.
  • fn glow(self, c: impl Into<Col>) -> Self — A glow trail on glyphs as they land, fading over glow_secs.
  • fn glow_secs(self, secs: f64) -> Self
  • fn accent(self, c: impl Into<Col>) -> Self
  • fn tick_hz(self, hz: f64) -> Self — How many times a second scramble glyphs change (default 30).
  • fn flicker(self, f: Flicker) -> Self — Looped glitch flicker once the text is on screen.
  • fn exit(self) -> Self — The exit reveal: the text is shown, then decodes/types/staggers away.
  • fn hold(self, secs: f64) -> Self — Reveal, hold secs, then play out. Under reduced motion the text stays.
  • fn replay_on(self, key: impl AsRef<str>) -> Self — Restart whenever the store counter key changes (Action::inc(key, 1)).
  • fn total(&self, n: usize) -> f64 — Seconds from the start to the last pixel of the reveal changing: duration plus the pop, cooling and glow tails (for a text of n glyphs; a typewriter's cps sets the duration).

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Layer

pub struct Layer { /* see fields */ }

An element that floats above the screen instead of taking layout space.

Methods

  • fn new(id: impl AsRef<str>, place: Place) -> Self — A floating layer named id at place.
  • fn anchor(self, id: impl AsRef<str>) -> Self — Position relative to the element with this id.
  • fn scrim(self, fill: Option<Col>, on_click: Option<Action>) -> Self — Full-screen scrim below the body; clicking it runs on_click.
  • fn match_width(self) -> Self — Body is at least as wide as the anchor.

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::LenCtx

pub struct LenCtx { /* see fields */ }

The environment a layout resolves its lengths against: the viewport, the device scale, the type scale and the safe area. vw/vh are 0 when the viewport is unknown; scale is device pixels per logical pixel.

Public fields

fieldtype
vwf64Viewport width in logical px (0 = unknown).
vhf64Viewport height in logical px (0 = unknown).
scalef64Device pixels per logical pixel (1 = unscaled).
emf64The em size (logical px).
remf64The rem size (logical px).
safeInsetsThe safe area (notch, rounded corners, overscan).

Methods

  • const fn new(vw: f64, vh: f64, scale: f64, em: f64, rem: f64, safe: Insets) -> Self — A context from its parts.
  • fn with_root(self, rem: f64) -> Self — The same context with a different root font size.
  • fn sanitized(&self) -> LenCtx — The context with every unusable number replaced: a non-finite or negative viewport side becomes 0 (unknown), a non-positive scale 1, a non-finite or negative em / rem 16, a bad inset 0.
  • fn dp_scale(&self) -> f64 — The factor that turns a device-independent length into the space the solver works in. The solver works in logical pixels, so it is 1.0; a solver that lays out in device pixels multiplies by [LenCtx::scale].

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Light3d

pub struct Light3d { /* see fields */ }

A light: directional (a sun, with shadows), point or spot.

Public fields

fieldtype
colorui::el::Col
intensityf64
shadowbool
softnessf64
rangef64
fogf64
specularf64

Methods

  • fn directional(from: Vec3) -> Light3d — A sun shining from the direction from (a vector pointing at the light from the scene's centre). Casts shadows.
  • fn point(pos: Vec3) -> Light3d — A point light at pos; intensity is the radiant power seen at one unit.
  • fn spot(pos: Vec3, target: Vec3, inner_deg: f64, outer_deg: f64) -> Light3d — A spot light at pos aimed at target, full inside inner_deg and gone at outer_deg from the axis.
  • fn color(self, c: impl Into<Col>) -> Self
  • fn intensity(self, i: f64) -> Self
  • fn shadows(self, on: bool) -> Self — Shadow map on or off (directional lights only).
  • fn softness(self, s: f64) -> Self — Angular radius of the light as a tangent: how fast the shadow softens away from the contact (0.02 sharp, 0.12 very soft).
  • fn range(self, r: f64) -> Self — Distance at which a point or spot light is gone.
  • fn specular(self, k: f64) -> Self — Strength of this light's specular highlights (0 = diffuse only).
  • fn fog_scatter(self, k: f64) -> Self — How much of this light the fog scatters (0 hides it from the fog).

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::LightLeak

pub struct LightLeak { /* see fields */ }

A warm wash bleeding in from a screen edge or corner, like light leaking into a lens.

Public fields

fieldtype
colorui::el::Col
at[f64; 2]Where it enters, as fractions of the box (0, 0 = top-left corner).
sizef64Reach as a fraction of the box diagonal.
strengthf64
breathef64Slow breathing in cycles per second (0 = still).
blendaster_ui::BlendModeAdditive by default: the leak lights what it covers instead of tinting it.

Methods

  • fn size(self, s: f64) -> Self
  • fn strength(self, s: f64) -> Self
  • fn blend(self, mode: aster_ui::BlendMode) -> Self — Blend mode of the wash (default Add; SourceOver tints instead of lighting).
  • fn breathe(self, cycles_per_s: f64) -> Self
  • fn el(self) -> El

Trait implementations: Clone, Copy, Debug, From<LightLeak>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::LightShafts

pub struct LightShafts { /* see fields */ }

Volumetric light shafts: light_shafts(LightShafts::from(0.7, 0.2).color(..)). Put it last in the root overlay (it sees everything painted before it).

Public fields

fieldtype
colorui::el::Col
intensityf64
densityf64
decayf64
reachf64Reach as a fraction of the screen diagonal.
raysf64
shimmerf64
coref64
followbool
skyOption<ui::el::El>
qualityf64
blendaster_ui::BlendModeAdditive by default: the shafts light what they cross.
directionOption<f64>The direction of the rays in degrees (0 = right, 90 = down): None radiates from the light (a sunburst), a direction makes the rays travel in parallel.
spreadf64The width of the ray fan in degrees (0 = parallel rays; the rays fan out within half of it).

Methods

  • fn from(x: f64, y: f64) -> Self — A point light at fractions (x, y) of the screen (0, 0 = top-left; may lie outside).
  • fn element(el: &El) -> Self — The light is el (a bright shape in a screen-sized box, e.g. a sun disc or a window); rays stream from its brightness.
  • fn from_el(el: &El) -> Self — The light is el: the rays stream from its brightness. Same as [LightShafts::element].
  • fn resting_at(&self) -> [f64; 2] — Where the light rests: fractions of the screen (an element light is found by its shape).
  • fn color(self, c: impl Into<Col>) -> Self
  • fn intensity(self, v: f64) -> Self
  • fn density(self, v: f64) -> Self — How dark occluders make the rays behind them 0..=2.
  • fn decay(self, v: f64) -> Self — 0.9..1: lower weighs occluders near the lit pixel more (short, local shadows).
  • fn reach(self, v: f64) -> Self
  • fn rays(self, v: f64) -> Self — Contrast of the angular streaks 0..1.
  • fn shimmer(self, rate: f64) -> Self — Slow noise shimmer in ray cells per second (0 = still: a static light is a cache hit).
  • fn core(self, v: f64) -> Self
  • fn follow_pointer(self) -> Self — The light follows the pointer (a point light moves to it, an element is carried along); without a pointer, or under reduced motion, it rests at its own place.
  • fn sky(self, backdrop: &El) -> Self — The backdrop alone (the full-bleed background, as for GlassExt::glass): whatever differs from it counts as an occluder. Without it the screen's border colour is the sky.
  • fn quality(self, lo: f64) -> Self — Working resolution as a fraction of the screen (0.25..=0.5; default 0.25).
  • fn blend(self, mode: BlendMode) -> Self
  • fn direction(self, angle_deg: f64) -> Self — The rays leave the light in this direction (degrees: 0 = right, 90 = down) and travel in parallel: a window casts a beam instead of a sunburst, and the occluders cast parallel shadows. Without a direction the light radiates as before.
  • fn spread(self, deg: f64) -> Self — The rays fan out within half this angle (degrees) of the direction (0 = parallel rays, up to 180: a half-plane).
  • fn directional(self, angle_deg: f64, spread_deg: f64) -> Self — The rays leave the light in this direction (degrees) and fan out within it.
  • fn el(self) -> El

Trait implementations: Clone, Debug, From<LightShafts>

structaster_blueprint::ui::prelude::LogAxis

pub struct LogAxis { /* see fields */ }

A logarithmic value axis (.log_y()): whole decades, 10^lo to 10^hi, a tick every step decades (one for up to five decades, more beyond that so the labels do not crowd). The values must be above zero.

Public fields

fieldtype
loi32
hii32
stepi32

Methods

  • fn new(min: f64, max: f64) -> LogAxis — The decades that contain min..=max (both above zero).
  • fn frac(&self, v: f64) -> f64 — Where v sits: 0 at 10^lo, 1 at 10^hi (clamped; zero and below sit at 0).
  • fn ticks(&self) -> Vec<f64> — Tick values, 10^lo up to 10^hi.
  • fn label(&self, v: f64) -> String — The tick label for v: 0.01, 1, 100, 10k, 1M.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Material3d

pub struct Material3d { /* see fields */ }

PBR-lite material: base colour, roughness, metalness, emissive, rim.

Public fields

fieldtype
baseui::el::Col
roughf64
metalf64
emissiveOption<(ui::el::Col, f64)>
rimf64
rim_colorOption<ui::el::Col>
double_sidedbool
receive_shadowbool
patternPattern3d
fadeOption<(f64, f64)>
reflectf64
coatf64
catcherf64
reflect_reachf64
glassf64
refractionf64
frostf64
thicknessf64
causticsf64

Methods

  • fn new(base: impl Into<Col>) -> Material3d
  • fn accent() -> Material3d — The theme's accent colour, satin.
  • fn glossy(base: impl Into<Col>) -> Material3d — Glossy with a clear coat: lacquered plastic or car paint.
  • fn matte(base: impl Into<Col>) -> Material3d
  • fn metal(base: impl Into<Col>) -> Material3d
  • fn emissive(color: impl Into<Col>, strength: f64) -> Material3d — A light source's body: shows color at strength regardless of lighting.
  • fn glass(tint: impl Into<Col>, radius: f64) -> Material3d — Transmissive glass tinted by tint (white is clear): the view through it is the rest of the scene and, when the scene has [Scene3d::refract_ui], the page beneath, bent by the surface normal like a lens, with a little chromatic spread, a Fresnel reflection of the studio and absorption that deepens toward the rim. radius is the body's size in world units (it scales the bend).
  • fn refraction(self, k: f64) -> Self — How strongly glass bends the view (default 1.6, a ball lens that inverts the view; 0 is a flat pane).
  • fn frosted(self, k: f64) -> Self — Frosted glass: blur the view through it by k (0 clear, 1 milky).
  • fn caustics(self, k: f64) -> Self — Show the bright caustic spot that glass bodies focus into their shadow on this surface (floors and shadow catchers).
  • fn shadow_catcher(strength: f64) -> Material3d — An invisible plane that only shows what the scene does to it: the shadows and contact darkening of the objects and their mirror image (reflect), composited over whatever is beneath the picture (a card, a page). strength is how dark a full shadow is.
  • fn floor() -> Material3d — A floor that takes its look from the theme: a slightly raised surface, rough, fading out at the edge, with a mirror sheen.
  • fn roughness(self, r: f64) -> Self
  • fn metallic(self, m: f64) -> Self
  • fn emission(self, color: impl Into<Col>, strength: f64) -> Self
  • fn rim(self, strength: f64, color: impl Into<Col>) -> Self — Fresnel rim light of strength (tinted by color, default the base colour brightened).
  • fn double_sided(self) -> Self
  • fn no_shadow_receive(self) -> Self
  • fn pattern(self, p: Pattern3d) -> Self
  • fn fade(self, inner: f64, outer: f64) -> Self — Fade the surface out radially (world units from the object's origin): a floor that dissolves into the page.
  • fn reflect(self, k: f64) -> Self — Show the scene's mirror image on this surface (a floor): 0..1.
  • fn reflect_reach(self, h: f64) -> Self — The mirror image fades out within h world units of height above the surface (default: a smooth exponential).
  • fn coat(self, k: f64) -> Self — A thin gloss layer over the base: reflections of the studio on top of the colour.

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::MemoryClipboard

pub struct MemoryClipboard(..)

In-memory clipboard (the default for headless use and tests).

Trait implementations: Clipboard, Clone, Debug, Default

structaster_blueprint::ui::prelude::Mesh

pub struct Mesh { /* see fields */ }

A mesh (multi-point) gradient: colour blobs blended smoothly, optionally drifting.

Public fields

fieldtype
pointsVec<(f64, f64, ui::el::Col)>(x, y, colour) with x, y as fractions of the box.
sharpnessf64Falloff sharpness (1 = very soft, 4 = distinct blobs).
driftf64Orbit radius of each point as a fraction of the box (0 = still).
speedf64Orbit speed in turns per second.
stepf64The picture is rebuilt every step seconds (0 = every frame).

Methods

  • fn sharpness(self, s: f64) -> Self
  • fn step(self, secs: f64) -> Self — Rebuild the picture every secs seconds (default 0.2; 0 = every frame).
  • fn drift(self, radius: f64, speed: f64) -> Self — Each point wanders on a small loop of radius (box fraction) at speed turns/s.
  • fn el(self) -> El

Trait implementations: Clone, Debug, From<Mesh>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::MotionToken

pub struct MotionToken { /* see fields */ }

A named duration + easing pairing.

Public fields

fieldtype
durationMotionDuration
easeEase

Methods

  • const fn new(duration: MotionDuration, ease: Ease) -> Self
  • const 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::ui::prelude::MotionTokens

pub struct MotionTokens { /* see fields */ }

The motion scale of a theme.

Public fields

fieldtype
fast_msu32
normal_msu32
slow_msu32
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.
reducedboolReduced 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 for t in 0..=1 (clamped).

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::NoiseSpec

pub struct NoiseSpec { /* see fields */ }

Builder for a procedural fill. Start from a kind constructor ([NoiseSpec::fbm], [NoiseSpec::aurora], ...), chain modifiers, pass to [noise_fill].

noise_fill(NoiseSpec::fbm().seed(3).scale(140.).ramp([Role::Background, Role::Accent]).animate(0.2).grain(0.08)).h(220)

Methods

  • fn new(kind: SurfaceKind) -> Self — A spec of kind with a surface-to-text ramp.
  • fn value() -> Self — Value noise (blocky-soft blobs).
  • fn perlin() -> Self — Gradient (Perlin) noise.
  • fn simplex() -> Self — Simplex noise.
  • fn cellular() -> Self — Cellular (Worley) F1 distance.
  • fn edges() -> Self — Cellular F2 - F1: bright cell borders.
  • fn fbm() -> Self — Fractal Brownian motion (clouds).
  • fn ridged() -> Self — Ridged noise (crests, veins).
  • fn turbulence() -> Self — Turbulence (smoke).
  • fn warp() -> Self — Domain-warped fBm (marble).
  • fn aurora() -> Self — Noise-distorted gradient (aurora backgrounds).
  • fn seed(self, seed: u32) -> Self — Field seed (any u32): a different seed is a different, equally good field.
  • fn scale(self, px: impl Into<f64>) -> Self — Feature size in logical px (larger = smoother, lower frequency).
  • fn octaves(self, n: u32) -> Self — Octaves summed by fractal kinds (1..=12).
  • fn lacunarity(self, v: f64) -> Self — Frequency multiplier per octave (default 2).
  • fn gain(self, v: f64) -> Self — Amplitude multiplier per octave (default 0.5).
  • fn distort(self, v: f64) -> Self — Warp strength (warp) or gradient distortion (aurora).
  • fn contrast(self, v: f64) -> Self — Contrast about the middle of the ramp (1 = unchanged, 2 = punchy).
  • fn ramp<C: Into<Col>>(self, colors: impl IntoIterator<Item = C>) -> Self — Evenly spaced ramp colours, low to high: .ramp([Role::Background, Role::Accent]).
  • fn stops<C: Into<Col>>(self, stops: impl IntoIterator<Item = (f64, C)>) -> Self — Explicit (position 0..=1, colour) stops.
  • fn animate(self, speed: f64) -> Self — Evolve over time: speed lattice units per second along the time axis (0.1 is a slow drift, 0.5 brisk). Driven by the App clock; static under reduced motion.
  • fn time(self, secs: f64) -> Self — Seconds into the animation (a fixed frame; added to the clock when animated).
  • fn fps(self, fps: u32) -> Self — Frame quantum: time snaps to 1 / fps seconds so frames cache (default 30).
  • fn detail(self, px: f64) -> Self — Internal px per generated sample (default automatic from a sample budget).
  • fn grain(self, amount: f64) -> Self — Film grain over the fill, 0..=1 (about 0.05..0.15 is subtle). It flickers at 24 fps while the fill is animated or [NoiseSpec::live].
  • fn live(self) -> Self — Keep the element animating (grain flicker) even with animate(0.0).
  • fn corner(self, px: f64) -> Self — Rounded corners in px, baked into the image alpha.
  • fn surface(&self, th: &design::Theme) -> Surface — The resolved surface for the given theme (for tests and the graph bridge).

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::Object3d

pub struct Object3d { /* see fields */ }

A geometry with a transform and a material. Transform calls compose in reading order: the first one is applied to the object first, so .rotate_y(30).at(1, 0, 0) rotates in place and then moves, while .at(..).rotate_y(30) orbits.

Methods

  • fn new(geom: impl Into<Geometry3d>) -> Object3d
  • fn material(self, m: Material3d) -> Self
  • fn at(self, x: f64, y: f64, z: f64) -> Self — Move to (x, y, z).
  • fn rotate_x(self, deg: f64) -> Self
  • fn rotate_y(self, deg: f64) -> Self
  • fn rotate_z(self, deg: f64) -> Self
  • fn scale(self, s: f64) -> Self
  • fn scale_xyz(self, x: f64, y: f64, z: f64) -> Self
  • fn spin(self, deg_per_s: f64) -> Self — Turn about the object's own up axis at deg_per_s (an animated scene; a still frame shows the angle at its time).
  • fn casts_shadow(self, on: bool) -> Self — Whether the object throws shadows (default yes).
  • fn occludes(self, on: bool) -> Self — Whether the object darkens the ambient light around it (contact shadow; default yes).
  • fn reflected(self, on: bool) -> Self — Whether the object shows in a floor's reflection (default yes).
  • fn ground(size: f64, y: f64) -> Object3d — A ground plane: size square, takes the theme's floor material, throws no shadow and darkens nothing.

Trait implementations: Clone

structaster_blueprint::ui::prelude::OverflowIssue

pub struct OverflowIssue { /* see fields */ }

One finding of [UiTree::audit_overflow]: a container whose children extend past its content box.

Public fields

fieldtype
idStringThe container.
rectuitree::Rect
over[f64; 2]How far the children stick out past the content box, in logical px: (right/bottom, ...) as (x, y).
childOption<String>The child that reaches furthest past the container's edge, when it is in the tree.
messageString
fixString

Trait implementations: Clone, Debug, Display, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::PageMotion

pub struct PageMotion { /* see fields */ }

Where a page's elements come from when the page changes.

Public fields

fieldtype
from_opf64The opacity the page starts at.
from_off[f64; 2]The offset (px) the page starts at.
from_scalef64The scale the page starts at.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Parallax

pub struct Parallax { /* see fields */ }

Layers that shift with the pointer (and optionally a scroll position) at different rates.

Methods

  • fn layer(self, el: El, depth: f64) -> Self
  • fn amount(self, px: f64) -> Self — Largest pointer shift in px at depth 1.
  • fn scroll(self, key: &str, rate: f64) -> Self — Also shift vertically with the store scalar key (a scroll offset in px) at rate * depth px per px (use .offset or <scroll id>.top).
  • fn el(self) -> El

Trait implementations: Clone, Debug, From<Parallax>

structaster_blueprint::ui::prelude::Particles

pub struct Particles { /* see fields */ }

A particle system description. Build with a preset and chain the knobs.

Public fields

fieldtype
seedu64
countusize
emitterEmitter
life(f64, f64)Lifetime range in seconds.
speed(f64, f64)Launch speed range in px/s.
dir(f64, f64)Launch direction: centre and spread in degrees (0 = right, -90 = up).
gravity[f64; 2]Constant acceleration in px/s^2 (positive y = down).
dragf64Linear drag per second.
swirlf64Swirl sway amplitude in px (a curl-like wander around the ballistic path).
size(f64, f64)Diameter in px at birth and at death.
size_jitterf64Per-particle size variation 0..1.
colorsVec<ui::el::Col>Colour over life.
opacityf64Peak opacity 0..1.
fade(f64, f64)Fractions of life spent fading in and out.
twinklef64Twinkle depth 0..1 (stars).
hotf64Whitening of the core 0..1.
halof64Extra large faint halo 0..1.
hardf64Edge hardness of dots 0..1.
trailusizeTrailing copies behind the head (sparks), each fainter.
shapeShape
stepf64Ambient fields redraw every step seconds (0 = every frame). Slow drifts look the same at 20 fps and cost a third; staggered by seed so fields do not all redraw on one frame.
by_particleboolEach particle takes one of the colors for its whole life instead of cooling through them (confetti).
blendaster_ui::BlendModeHow the sprites combine with what is beneath: Add makes sparks, embers and star halos light up their surroundings (the presets that glow choose it); SourceOver is ordinary paint.

Methods

  • fn dust() -> Self — Slow, tiny motes drifting upward through the light.
  • fn stars() -> Self — Fixed stars that twinkle.
  • fn embers() -> Self — Glowing embers rising from the bottom edge and cooling from yellow to red.
  • fn sparks() -> Self — A quick radial spray with trails; meant for [Burst].
  • fn confetti() -> Self — Tumbling confetti falling from a burst point.
  • fn seed(self, seed: u64) -> Self
  • fn count(self, n: usize) -> Self
  • fn emitter(self, e: Emitter) -> Self
  • fn life(self, min: f64, max: f64) -> Self
  • fn speed(self, min: f64, max: f64) -> Self
  • fn dir(self, centre_deg: f64, spread_deg: f64) -> Self
  • fn gravity(self, gx: f64, gy: f64) -> Self
  • fn drag(self, k: f64) -> Self
  • fn swirl(self, px: f64) -> Self
  • fn size(self, start: f64, end: f64) -> Self
  • fn colors(self, cols: impl IntoIterator<Item = impl Into<Col>>) -> Self — Colours over life (one colour is flat; several cool from the first to the last).
  • fn opacity(self, a: f64) -> Self
  • fn twinkle(self, depth: f64) -> Self
  • fn blend(self, mode: aster_ui::BlendMode) -> Self — Combine the sprites with what is beneath using mode (the glowing presets use Add).
  • fn halo(self, h: f64) -> Self
  • fn palette(self) -> Self — Each particle keeps one colour of colors for life instead of cooling through them.
  • fn step(self, secs: f64) -> Self — Redraw every secs seconds (0 = every frame).
  • fn trail(self, n: usize) -> Self
  • fn key(&self) -> u64 — Hash of every field: the layer cache key.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Picture

pub struct Picture(..)

An immutable decoded picture (straight-alpha RGBA8). Cheap to clone and share; build it once, draw it with [image].

Methods

  • fn rgba(w: u32, h: u32, pixels: &[u8]) -> Result<Picture, PictureError> — A picture from straight-alpha RGBA8 pixels, row after row, w * h * 4 bytes.
  • fn png(bytes: &[u8]) -> Result<Picture, PictureError> — A picture from PNG bytes (8-bit or 16-bit gray, gray+alpha, RGB, RGBA or palette; not interlaced).
  • fn size(&self) -> (u32, u32) — Width and height in pixels.
  • fn pixels(&self) -> &[u8] — The straight-alpha RGBA8 pixels.
  • fn id(&self) -> u64 — A process-local identity: two clones share it, a new picture has a new one (a new frame of a stream).

Trait implementations: Clone, Debug, PartialEq

structaster_blueprint::ui::prelude::PictureError

pub struct PictureError(..)

Why a picture could not be made.

Public fields

fieldtype
0String

Trait implementations: Clone, Debug, Display, Eq, Error, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::PipelineOpts

pub struct PipelineOpts { /* see fields */ }

Vertical layout of [pipeline_with].

Public fields

fieldtype
valignlayout::AlignHow each column's nodes sit in the height: Align::Stretch (default) spreads them over the whole height, Start / Center / End pack each column into the top / middle / bottom (equal-size cells per node).
staggerf64Fraction of the height (0..=0.4) by which every other column (the 2nd, 4th, ..) is pushed down and the others pulled up: the zig-zag of a staggered flow. 0. = none (default).

Methods

  • fn new() -> Self
  • fn valign(self, a: Align) -> Self
  • fn stagger(self, f: f64) -> Self

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::PointLight

pub struct PointLight { /* see fields */ }

A glowing element's light (see [DepthExt::casts_light]).

Methods

  • fn new() -> Self
  • fn color(self, c: impl Into<Col>) -> Self — Light colour (alpha scales the intensity).
  • fn intensity(self, v: f64) -> Self — Strength 0..=2.
  • fn radius(self, px: f64) -> Self — Reach in px: the light falls off to nothing at this distance from the element's centre.
  • fn quality(self, q: f64) -> Self — Working resolution 0.15..=0.5 of the screen (lower is cheaper and softer).
  • fn sky(self, backdrop: &El) -> Self — The scene without any element on top of it: whatever differs from it blocks the light (default: guessed from the colour of the screen border, which suits a flat background).

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::prelude::Post

pub struct Post { /* see fields */ }

A post-processing stack. Post::new() does nothing; add effects with the builder methods, or start from [Post::film] / [Post::for_theme].

Public fields

fieldtype
bloomOption<PostBloom>
halationOption<Halation>
streaksOption<Streaks>
dirtf32Lens dirt 0..=1: the bloom and streaks light up a procedural smudge texture.
gradeOption<super::post_color::Grade>
lutOption<std::sync::Arc<super::post_color::Lut3>>
vignetteOption<Vignette>
chromaf32Chromatic aberration: the red/blue offset at the corners, logical px.
distortionf32Barrel distortion -1..1 (corners fixed).
grainOption<Grain>
ditherbool
sharpenf32CAS sharpening 0..=1.
dofOption<Dof>
motionOption<MotionBlur>
autoboolResolve to the default preset of the theme the screen uses when built (see [Post::for_theme]).

Methods

  • fn new() -> Post — Nothing: [Post::apply] returns the picture unchanged.
  • fn auto() -> Post — The default preset of whatever theme the screen is drawn with, chosen when the element is built.
  • fn bloom(self, v: impl Into<Option<PostBloom>>) -> Self
  • fn halation(self, v: impl Into<Option<Halation>>) -> Self
  • fn streaks(self, v: impl Into<Option<Streaks>>) -> Self
  • fn grade(self, v: impl Into<Option<Grade>>) -> Self
  • fn vignette(self, v: impl Into<Option<Vignette>>) -> Self
  • fn grain(self, v: impl Into<Option<Grain>>) -> Self
  • fn dof(self, v: impl Into<Option<Dof>>) -> Self
  • fn motion(self, v: impl Into<Option<MotionBlur>>) -> Self
  • fn dirt(self, v: f64) -> Self
  • fn chroma(self, px: f64) -> Self
  • fn distortion(self, k: f64) -> Self
  • fn dither(self, on: bool) -> Self
  • fn sharpen(self, s: f64) -> Self
  • fn lut(self, lut: impl Into<Option<Arc<Lut3>>>) -> Self — A 3D LUT applied after the grade.
  • fn look(self, look: Look) -> Self — A built-in look as the LUT.
  • fn cube(self, bytes: &[u8]) -> Result<Self, LutError> — A .cube file as the LUT.
  • fn tone(self, tone: Tone, exposure_stops: f64) -> Self — The tone curve and exposure (stops) of the grade.
  • fn white_balance(self, temperature: f64, tint: f64) -> Self
  • fn saturation(self, s: f64) -> Self
  • fn contrast(self, c: f64) -> Self
  • fn split_tone(self, shadows: [f32; 3], s_amount: f64, highlights: [f32; 3], h_amount: f64) -> Self — Split toning: shadows and highlights tinted (sRGB colours) by amount each.
  • fn without(self, effect: &str) -> Self — Turn an effect off by name: bloom, halation, streaks, dirt, grade, lut, vignette, chroma, distortion, grain, dither, sharpen, dof, motion.
  • fn effects(&self) -> Vec<&'static str> — The names of the effects that are on.
  • fn is_identity(&self) -> bool — True when [Post::apply] leaves every byte alone.
  • fn key(&self) -> u64 — A hash of every parameter.
  • fn film() -> Post — The house look for a dark UI: a gentle filmic shoulder with a touch of contrast, teal shadows and warm highlights, a soft bloom on emissive things, a little halation, a vignette, static grain, blue-noise dithering and light sharpening.
  • fn film_light() -> Post — The default for a light theme: no bloom (a white page would glow), a lighter vignette, warm grade.
  • fn for_theme(theme: &Theme) -> Post — The default preset of a theme. High-contrast themes (promise of 7:1 text) get nothing; only dithering would not change their flat colours, so they get a plain identity.
  • fn blockbuster() -> Post — The Teal & Orange look on top of [Post::film].
  • fn apply(&self, w: u32, h: u32, rgba: &[u8], env: &PostEnv) -> Vec<u8> — Run the pipeline on an RGBA8 picture (straight alpha, w x h). A picture that is not [Post::is_identity] is returned changed; an identity returns the same bytes.
  • fn apply_pix(&self, src: Pix, env: &PostEnv) -> Pix
  • fn apply_owned(&self, w: u32, h: u32, rgba: Vec<u8>, env: &PostEnv) -> Vec<u8>

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::PostEnv

pub struct PostEnv { /* see fields */ }

What the pipeline needs beyond the picture and the parameters.

Public fields

fieldtype
scalef32Device pixels per logical pixel.
frameu32Grain frame (0 = the still pattern). Only used when the grain animates.
reduced_motionbool
focusOption<[f32; 4]>Focus rectangle in device px of the picture.
motionVec<([f32; 4], [f32; 2])>Motion boxes in device px of the picture, with device px per frame.
depthVec<([f32; 4], f32)>Element depths in device px of the picture, nearest last: [x, y, w, h] and z (the depth registry, for Focus::Z).

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Ptr

pub struct Ptr { /* see fields */ }

Pointer position local to the element, with its size (logical px).

Public fields

fieldtype
xf64
yf64
wf64
hf64

Methods

  • fn fx(&self) -> f64 — Horizontal fraction 0..=1.
  • fn fy(&self) -> f64

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Rendered

pub struct Rendered { /* see fields */ }

A rendered screen: pixels, the auto-registered semantic tree and the solved layout.

Public fields

fieldtype
imageheadless::Image
treeuitree::UiTree
solvedstd::rc::Rc<layout::Solved>Shared with the layout cache (a frame whose layout input did not change holds the cached solution).
theme_nameString

Methods

  • fn png(&self, path: impl AsRef<Path>) -> Result<(), UiError> — Write the picture as PNG.
  • fn params(&self, prefix: &str) -> Result<Vec<(Symbol, Literal)>, UiError> — Solved geometry of every element with an explicit .id() as graph LogicalLength parameters prefix.<id>.x|y|w|h, for graph-driven retargeting.

structaster_blueprint::ui::prelude::Responsive

pub struct Responsive { /* see fields */ }

Theme-level responsive settings: breakpoints (logical px) and the optional compact type scale.

Public fields

fieldtype
breakpoints[f64; 3]Upper bounds (exclusive) of Compact, Medium and Expanded.
compact_type_scalef64Multiplier for every type step while the class is Compact (1.0 = off, the default).

Methods

  • fn classify(&self, width: f64) -> Size
  • fn with_breakpoints(self, compact: f64, medium: f64, expanded: f64) -> Self
  • fn with_compact_type_scale(self, k: f64) -> Self — Type steps shrink (or grow) by k on compact screens, e.g. 0.9.

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Scene3d

pub struct Scene3d { /* see fields */ }

A scene: camera, objects, lights, environment, fog and finishing. Build it, then scene3d(scene).

Methods

  • fn new() -> Scene3d — An empty scene: a camera 6 units back looking at the origin, no lights (add some, or use [Scene3d::studio]).
  • fn studio() -> Scene3d — A product-shot studio that takes its colours from the theme: a warm shadow-casting key light, a cool fill, an accent-tinted rim light from behind, and a sky with two softboxes for the reflections. Add objects and a camera.
  • fn camera(self, c: Camera3d) -> Self
  • fn object(self, o: Object3d) -> Self
  • fn objects(self, os: impl IntoIterator<Item = Object3d>) -> Self
  • fn light(self, l: Light3d) -> Self
  • fn clear_lights(self) -> Self — Drop the studio's lights (and softboxes) and start from yours.
  • fn sky(self, top: impl Into<Col>, horizon: impl Into<Col>, ground: impl Into<Col>) -> Self — Sky gradient (zenith, horizon) and the ground colour bounced back up: the hemisphere light and what glossy surfaces reflect.
  • fn softbox(self, from: Vec3, w_deg: f64, h_deg: f64, color: impl Into<Col>, intensity: f64) -> Self — A softbox (a bright rectangle in the sky) that glossy surfaces reflect: it lights nothing but their highlights.
  • fn ambient(self, k: f64) -> Self — Strength of the ambient (hemisphere and reflection) light.
  • fn occlusion(self, k: f64) -> Self — Contact darkening from the objects' bulk (0 off, 1 strong).
  • fn fog(self, f: Fog3d) -> Self
  • fn backdrop(self, b: Backdrop3d) -> Self
  • fn exposure(self, e: f64) -> Self — Exposure multiplier before tone mapping.
  • fn bloom(self, k: f64) -> Self — A soft glow around the brightest parts.
  • fn feather(self, f: f64) -> Self — Fade the picture's alpha to nothing over this fraction (0..0.5) of its size at the edges, so fog and glow composite into the page without a visible box.
  • fn quality(self, q: Quality3d) -> Self
  • fn at_time(self, t: f64) -> Self — The scene's time in seconds for spins, orbits and fog drift (a still frame; an animated element adds the screen's clock).
  • fn orbit(self, deg_per_s: f64) -> Self — Orbit the camera around its target about the up axis at deg_per_s.
  • fn fps(self, fps: f64) -> Self — Frame rate of an animated scene (default 12, at most 60): a new picture per tick, never more.
  • fn animation_pixels(self, px: usize) -> Self — Largest picture (pixels) an animated scene renders; the painter stretches it to the element (default 160 000).
  • fn aspect(self, a: f64) -> Self — Width / height the element takes when only one side is sized (default 1.6).
  • fn refract_ui(self, on: bool) -> Self — Let glass look through to the page beneath the picture (cards, text, images painted earlier): the element then reads the screen below it, as glass_below does, and re-renders when that changes. Without it glass sees the scene and its backdrop only.
  • fn pointer_orbit(self, id: impl Into<String>, yaw_deg: f64, pitch_deg: f64) -> Self — Make the scene interactive: the camera orbits its target as the pointer moves over the element called id (yaw_deg left and right, pitch_deg up and down at the edges). While the camera moves the scene renders cheaply (a third of the resolution, one sample per pixel, coarse shadows and fog, upscaled by the renderer); about 150 ms after it settles it refines to half resolution and then to full quality, and the settled frame is byte-identical to a still render at that camera.
  • fn live_cell(self, n: usize) -> Self — Size in pixels (2..=4, default 3) of the cells an interactive frame shades once per surface: bigger is faster and softer inside surfaces (edges stay crisp).
  • fn progressive(self, on: bool) -> Self — false turns the cheap moving frames off (every frame at full quality: the measuring baseline).
  • fn alt(self, text: impl Into<String>) -> Self — Name the picture for assistive tech. Without it the scene is decorative.
  • fn is_animated(&self) -> bool — Whether anything in the scene changes with time.
  • fn key(&self) -> u64 — Hash of everything that decides the picture (at the scene's own time).
  • fn render(&self, th: &Theme, w: u32, h: u32) -> Pix — Render without a screen: w x h pixels of straight-alpha RGBA8 at the scene's own time. Extruded text is skipped (it needs a screen's fonts).
  • fn render_live_preview(&self, th: &Theme, w: u32, h: u32, div: usize) -> Pix — An interactive frame (see [Scene3d::pointer_orbit]) rendered without a screen: full-resolution visibility, shading once per surface per div x div cell (2..=4), the cheap shadow, reflection and fog paths.
  • fn render_live_lowres(&self, th: &Theme, w: u32, h: u32) -> Pix — An interactive frame the way the first version drew it: the whole scene at w x h with the cheap paths (for comparison; stretch it over the element yourself).
  • fn render_hdr(&self, th: &Theme, w: u32, h: u32) -> Vec<[f32; 4]> — The same render as a linear HDR buffer (premultiplied RGBA), for tests and tools.

Trait implementations: Clone, Default

structaster_blueprint::ui::prelude::SceneLight

pub struct SceneLight { /* see fields */ }

A directional light for a whole scene (the sun, a window, a key light). Put it on the root with [DepthExt::scene_light].

Methods

  • fn directional(azimuth_deg: f64, elevation_deg: f64) -> Self — A light that travels across the screen in direction azimuth_deg (the screen's axes, as [super::LightShafts::direction]: 0 right, 90 down, 180 left, 270 up) and stands elevation_deg above the surface (90 overhead: tight shadows under the element; low: long shadows). Shadows fall the way the light travels.
  • fn color(self, c: impl Into<Col>) -> Self — Light colour (alpha scales the intensity).
  • fn intensity(self, v: f64) -> Self — Strength 0..=2; 0 switches the scene light off (elements keep the theme's own elevation).
  • fn ambient(self, v: f64) -> Self — Fill light 0..=1: how much of the shade and shadow darkness is filled back in (default 0.25).
  • fn softness(self, v: f64) -> Self — Penumbra scale 0.2..=3 (default 1): a big soft source or a hard sun.
  • fn follow_pointer(self) -> Self — The light becomes a lamp that follows the pointer: highlights, glints and shadow directions of every element follow it (springs; static under reduced motion, where the directional light stays).
  • fn parallax(self, px: f64) -> Self — Pointer parallax: an element with .depth(z) shifts by up to px * z / 50 px as the pointer crosses the screen (nearer layers move the opposite way, far layers with negative z the same way). Off under reduced motion.
  • fn scroll_parallax(self, key: impl Into<String>, gain: f64) -> Self — Scroll parallax: the store integer key (a scroll offset in px that the app keeps) shifts elements with a depth vertically by -key * gain * z / 100 px.
  • fn level_height(self, px: f64) -> Self — Px of height one theme elevation level stands for (default 5).
  • fn azimuth_deg(&self) -> f64 — The azimuth in degrees.
  • fn elevation_deg(&self) -> f64 — The elevation in degrees.
  • fn shadow_offset(&self, z: f64) -> [f64; 2] — Where the shadow of an element z px above the surface falls, relative to the element.

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::Scenery

pub struct Scenery { /* see fields */ }

A generated backdrop: a preset, a seed and how loud it is.

The art takes its colours from the theme it is drawn in (the accent, the info and the secondary roles over the theme's background), so it belongs to the app without anyone having to name the colours. The same seed and the same size give the same picture.

Methods

  • fn of(kind: BackdropKind) -> Self — A backdrop of kind with the default seed.
  • fn aurora() -> Self — Soft flowing gradient bands.
  • fn mesh() -> Self — Multi-point gradient blobs.
  • fn bokeh() -> Self — Soft light circles with depth.
  • fn dusk() -> Self — A dusk sky with a horizon and a low sun.
  • fn grain() -> Self — A dithered gradient (no banding).
  • fn topo() -> Self — Topographic contour lines.
  • fn grid() -> Self — A glowing grid.
  • fn starfield() -> Self — A starfield.
  • fn kind(&self) -> BackdropKind — The preset.
  • fn seed(self, seed: u64) -> Self — Name the seed: the same seed and size give the same picture.
  • fn intensity(self, v: f64) -> Self — How loud the art is (0..=1, default 1): 0 is the plain field, 1 the full picture.
  • fn living(self, on: bool) -> Self — Let the art drift: a slow, cheap sway of a small translucent layer over the still backdrop (see docs/CINEMATIC.md). Off by default; under reduced motion it freezes.
  • fn rate(self, hz: f64) -> Self — How often a living scenery refreshes the tiles it shows (1..=60 Hz, default 8: slow art does not need more; a video wants its frame rate).
  • fn budget(self, px: usize) -> Self — The most device pixels a living scenery composes in one frame (default 150 000, about 2-3 ms); the sky slows down before a frame does.
  • fn key(&self) -> String — The key the picture is cached under: the preset, the seed, the intensity and, for a living scenery, the rate and budget. Every float the painter or the sky captures is keyed by its exact f64::to_bits() (intensity, rate): nothing is quantised, so two values that paint differently never share a cached picture. The clock and phases are not inputs of the key: the sway/breathe/phase constants are fixed per preset and time is applied by the sky outside the cached picture.
  • fn el(&self) -> El — The full-bleed backdrop element: one picture, baked once per size, seed and theme.
  • fn backdrop(&self) -> FxBackdrop — The backdrop as one picture ([crate::ui::fx::Backdrop]): the scene is rendered once, offscreen, and every glass panel over it frosts that same picture.
  • fn page(&self, content: El) -> El — A page: this backdrop under the content, so the page has depth in one call.
  • fn panel(&self, content: El) -> El — A frosted glass panel over this backdrop: a blurred, tinted copy of the picture behind it.
  • fn glass(&self) -> Glass — The glass the panels of this scenery use: a soft frost that keeps the accent's light.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Screen

pub struct Screen { /* see fields */ }

Entry point: theme + size + scale, then render(&root).

Methods

  • fn new(theme: &Theme) -> Result<Self, UiError> — 1280x800 at 1x with the bundled DejaVu fonts (never system fonts).
  • fn size(self, w: u32, h: u32) -> Self — Logical size in px.
  • fn font_bytes(self, name: &str, bytes: &[u8]) -> Result<Self, UiError> — Register a face for the rich text (the runs may name it).
  • fn font_file(self, name: &str, path: impl AsRef<Path>) -> Result<Self, UiError> — Register a face for the rich text from a file.
  • fn fallbacks(self, names: &[&str]) -> Self — The default fallback chain of the rich text: the faces a run falls back to when its own face has no glyph for a cluster.
  • fn scale(self, scale: f64) -> Self — Output scale (2.0 = 2x pixel density).
  • fn theme(self, theme: &Theme) -> Self — Switch theme: re-render the same tree with different tokens.
  • fn layout_cache_stats(&self) -> (u64, u64) — (hits, misses) of the layout cache since the screen was made (for tests and profiling).
  • fn layout_cache_bytes(&self) -> usize — The heap the layout cache holds (the lowered trees and their solutions).
  • fn layout_slot_bytes(&self) -> Vec<usize> — The heap each layout slot holds (the lowered tree and its solution), most recent first.
  • fn layer_cache_stats(&self) -> (u64, u64) — (hits, misses) of the immersive layer caches since the screen was made (for tests and profiling).
  • fn render(&mut self, root: &El) -> Result<Rendered, UiError> — Layout, scene, effects, headless render, UiTree registration.
  • fn tiled_shadows(self, on: bool) -> Self — Draw large drop shadows (cards, panels, headers: more than two 128 px tiles on an axis) from one small baked drawing and clipped copies of it instead of baking the whole box: 1-5 ms instead of 20-25 ms for a 788x474 card, which is most of the first visit of a page and of a resize. Off by default: the renderer rounds the corner arcs of a fill by the box's own coordinates, so a tiled shadow equals the single drawing everywhere but for an occasional pixel one level off at a corner (one pixel of 3.4 million in the print-farm demo at 2x). Only power-of-two scales, boxes whose sides are multiples of 1/256 px and places that are not an exact half pixel are tiled; the rest keeps the single drawing.
  • fn snap_pixels(self, on: bool) -> Self — Snap every laid-out box to the device pixel grid before painting: each edge goes to the nearest device pixel, so a box at a fractional device position (a logical x of 263 at scale 1.25 is 328.75 px) paints with crisp edges, and stacked text blocks and fractional-width keycaps stay on the grid. Edges are rounded, not sizes, so boxes that touch keep touching; a baseline and a scroll clip move with their box, and the hit boxes are the painted ones. A box can grow or shrink by up to one device pixel. Off by default (the pixels of a fractional scale change); at an integer scale with whole logical coordinates it changes nothing.

structaster_blueprint::ui::prelude::Series

pub struct Series { /* see fields */ }

One named data series for [line_chart] / [area_chart].

Public fields

fieldtype
nameString
valuesVec<f64>

Methods

  • fn new<V: Copy + Into<f64>>(name: impl AsRef<str>, values: &[V]) -> Self — Series::new("CPU", &[3., 5., 4.]); the colour cycles Accent, Info, Success, Warning unless .role(..).
  • fn role(self, role: Role) -> Self
  • fn right_axis(self) -> Self — Plot this series against a second value axis on the right, with its own nice range and ticks (line_chart, area_chart: a temperature over a request count). At least one series must stay on the left axis. The legend and the chart's description say which series are on the right.

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::Shape

pub struct Shape { /* see fields */ }

One filled and/or stroked path. Coordinates are logical px inside the element.

Methods

  • fn path(cmds: impl IntoIterator<Item = VectorCommand>) -> Self — Any path.
  • fn line(a: [f64; 2], b: [f64; 2]) -> Self — A straight line.
  • fn polyline(pts: &[[f64; 2]]) -> Self — An open polyline through pts.
  • fn polygon(pts: &[[f64; 2]]) -> Self — A closed polygon through pts.
  • fn circle(cx: f64, cy: f64, r: f64) -> Self — A circle.
  • fn rect(x: f64, y: f64, w: f64, h: f64) -> Self — An axis-aligned rectangle.
  • fn fill(self, c: impl Into<Col>) -> Self — Fill colour (a Role, Role::X.tint(a), ...).
  • fn stroke(self, c: impl Into<Col>, width: f64) -> Self — Stroke colour and width in px (round caps and joins by default).
  • fn dash(self, dash: f64, gap: f64) -> Self — Dashed stroke: dash and gap lengths in px.
  • fn butt(self) -> Self — Butt caps and miter joins instead of round ones.
  • fn even_odd(self) -> Self — Even-odd fill rule (rings, holes); the default is non-zero.

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::Shatter

pub struct Shatter { /* see fields */ }

Shatter parameters. Build with [Shatter::shards], [Shatter::glass] or [Shatter::dust].

Public fields

fieldtype
patternShatterPattern
dustbool
seedu64
onOption<String>
speedf64Outward impulse, px/s.
spinf64Peak spin, rad/s.
gravitysuper::V2Gravity (px/s²) and drag (1/s).
dragf64
flyf64Seconds of flight, then seconds held apart.
holdf64
backf64Seconds each fragment takes to come home, and the spread of their start times.
staggerf64
reassembleboolFly back (default) or stay gone.
windsuper::V2Dust: wind (px/s), sweep direction, sweep duration, piece life (s).
sweepsuper::V2
sweep_sf64
lifef64
handoffboolHand dust pieces to the particle lane when they let go (they leave the picture).
fieldsVec<std::rc::Rc<dyn Field>>

Methods

  • fn shards() -> Shatter — Voronoi shards that burst from the click, fall, and fly home.
  • fn glass() -> Shatter — Cracks radiating from the click, like glass.
  • fn dust() -> Shatter — Disintegrate to dust, swept away by a wind, then reform.
  • fn pattern(self, p: ShatterPattern) -> Self
  • fn seed(self, s: u64) -> Self
  • fn speed(self, v: f64) -> Self
  • fn gravity(self, g: V2) -> Self
  • fn wind(self, w: V2) -> Self
  • fn sweep(self, dir: V2, seconds: f64) -> Self
  • fn timing(self, fly: f64, hold: f64, back: f64) -> Self
  • fn reassemble(self, yes: bool) -> Self
  • fn handoff(self, yes: bool) -> Self — Hand dust pieces over as [DustParticle]s (see [drain_dust]).
  • fn on(self, key: &str) -> Self — Break on a store counter instead of a click on the element.
  • fn field(self, f: Rc<dyn Field>) -> Self — A field the fragments always feel (published fields are felt too).

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::prelude::Shelf

pub struct Shelf { /* see fields */ }

One horizontally scrolling row of tiles: the builder.

Only the tiles in view (plus an overscan) are built, so count may be 100k+.

Methods

  • fn gap(self, px: impl Into<f64>) -> Self — The gap between the tiles (px).
  • fn overscan(self, n: usize) -> Self — The tiles built beyond the view (default 1).
  • fn smooth_scroll(self, ms: u32) -> Self — Ease the offset moves of the shelf: ms is the duration of a move (the target stays in the Scalar <id>.scroll).
  • fn touch_scroll(self) -> Self — Pan with a touch drag (see [El::touch_scroll]).
  • fn overscroll(self, on: bool) -> Self — Rubber-band at the ends (see [El::overscroll]).
  • fn smooth_wheel(self, ms: u32) -> Self — Ease the wheel's moves too (see [El::smooth_wheel]).
  • fn reorderable(self, on_move: impl Fn(&mut Store, usize, usize) + 'static) -> Self — The tiles of the shelf can be reordered by the user: on_move(from, to) runs when a tile lands on a new place (the app moves it in its own list).
  • fn build(self) -> El — The shelf itself.

Trait implementations: From<Shelf>

structaster_blueprint::ui::prelude::Shelves

pub struct Shelves { /* see fields */ }

A page of shelves: the builder.

Only the shelves in view (plus an overscan) are built, and a shelf only its tiles in view.

Methods

  • fn gap(self, px: impl Into<f64>) -> Self — The gap between the tiles and between the shelves (px).
  • fn overscan(self, n: usize) -> Self — The shelves (and the tiles) built beyond the view (default 1).
  • fn title_h(self, px: impl Into<f64>) -> Self — The height of a shelf title (the body's line height by default).
  • fn smooth_scroll(self, ms: u32) -> Self — Ease the offset moves of the page and of its shelves: ms is the duration of a move (the target stays in the Scalar <id>.scroll).
  • fn touch_scroll(self) -> Self — Pan with a touch drag (see [El::touch_scroll]).
  • fn overscroll(self, on: bool) -> Self — Rubber-band at the ends (see [El::overscroll]).
  • fn smooth_wheel(self, ms: u32) -> Self — Ease the wheel's moves too (see [El::smooth_wheel]).
  • fn reorderable(self, on_move: impl Fn(&mut Store, usize, usize, usize) + 'static) -> Self — The tiles of every shelf can be reordered by the user: on_move(shelf, from, to) runs when a tile lands on a new place of its shelf (the app moves it in its own list).
  • fn build(self) -> El — The page itself.

Trait implementations: From<Shelves>

structaster_blueprint::ui::prelude::Shock

pub struct Shock { /* see fields */ }

An expanding refractive ring.

Public fields

fieldtype
ampf64Peak displacement in logical px.
widthf64Half width of the ring in logical px.
speedf64Expansion in logical px per second.
lifef64Seconds until the ring has faded out.
fringef64Chromatic fringe 0..1 (0 = none).

Methods

  • fn new() -> Self
  • fn amp(self, px: f64) -> Self
  • fn width(self, px: f64) -> Self
  • fn speed(self, px_per_s: f64) -> Self
  • fn life(self, seconds: f64) -> Self
  • fn fringe(self, f: f64) -> Self

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Sky

pub struct Sky { /* see fields */ }

The living part of a backdrop: layers, grain and how fast it refreshes. Backdrop::new(..).sky(Sky::new()..).

Methods

  • fn new() -> Sky — A sky with no layers yet: refreshed at most 8 times a second, 150 000 device pixels per frame at most.
  • fn layer(self, l: SkyLayer) -> Sky — Add a layer (they are composed in the order added, over the base).
  • fn grain(self, strength: f64) -> Sky — Film grain of strength (0.05 is the usual) from four pre-baked tiles that are cycled and shifted each time a tile refreshes: it flickers at the refresh rate. (The backdrop's own picture should have none.)
  • fn rate(self, hz: f64) -> Sky — Refresh each visible tile at most hz times a second (1..=60, default 8; NaN is the default).
  • fn budget(self, px: usize) -> Sky — At most px device pixels of tiles are composed in a frame (default 150 000: about 2-3 ms at 1080p). When more are stale the stalest go first and the rest wait for the next frame: the sky slows down, no frame does.

Trait implementations: Clone, Default

structaster_blueprint::ui::prelude::SkyLayer

pub struct SkyLayer { /* see fields */ }

One translucent layer of the sky: a scene rendered once, then moved and faded by the clock.

SkyLayer::new("clouds", || noise_fill(..)).sway(60., 20., 90.).breathe(0.3, 11.)

Methods

  • fn new(name: impl AsRef<str>, scene: impl Fn() -> El + 'static) -> SkyLayer — A layer named name (hashed: change it when scene changes) whose picture scene makes on a transparent ground. It is laid out in a box the size of the screen plus the sway margin and rendered at a quarter of the size; build it from soft things (noise, aurora, glows). It is rendered once per size, scale and theme.
  • fn sway(self, ax: f64, ay: f64, period: f64) -> SkyLayer — Travel ax, ay logical px each way over period seconds (a slow back-and-forth, so no seam ever shows).
  • fn morph(self, other: impl Fn() -> El + 'static, period: f64) -> SkyLayer — Cross-fade to other and back over period seconds (a second shape of the same cloud or aurora: nothing is generated at run time, two pictures are blended).
  • fn breathe(self, depth: f64, period: f64) -> SkyLayer — Fade between full strength and 1 - depth of it over period seconds.
  • fn additive(self) -> SkyLayer — Add the layer's light to the sky instead of laying it over (glows, shafts).
  • fn opacity(self, a: f64) -> SkyLayer — Show the layer at a times its strength (0..=1).
  • fn phase(self, seconds: f64) -> SkyLayer — Seconds to start the layer's motion at (so two layers do not move in step).
  • fn res(self, r: f64) -> SkyLayer — The layer is rendered at this fraction of the logical size (0.25..=1, default 0.25).

Trait implementations: Clone

structaster_blueprint::ui::prelude::Span

pub struct Span { /* see fields */ }

One inline run of a rich text: its text, and optionally its own face, size and colour. The runs of one rich text are laid out as one paragraph (the lines break across the runs).

Public fields

fieldtype
textStringThe text of the run.
fontOption<String>The face of the run (the element's own face when it is none).
sizeOption<f64>The size of the run (the element's own size when it is none).
colorOption<Col>The colour of the run (the element's own colour when it is none).
dirOption<layout::Direction>The run is a directional isolate (see [Span::dir]).
decoSpanDecoThe run is underlined, struck through or on a background; none of it changes the layout (see [Span::underline]).
italicboolThe run is set in the oblique face (see [Span::italic]).

Methods

  • fn new(text: impl Into<String>) -> Span — A run of text in the element's own face, size and colour.
  • fn underline(self) -> Span — A line under the run, in the run's colour (a hyperlink, an SGR underline). It sits below the baseline and does not change the run's width or the line's height, so give the line some leading if the next line must not touch it.
  • fn strike(self) -> Span — A line through the middle of the run, in the run's colour (deleted text, an SGR strikethrough). Layout is unchanged.
  • fn bg(self, c: impl Into<Col>) -> Span — A background behind the run: the full height of the run's line, as wide as the run (a terminal cell's background, a highlight, a code chip). It is drawn under the text and does not change the layout. The text colour is not adjusted: pick a pair with enough contrast (the a11y audit judges text against what is drawn under it).
  • fn italic(self) -> Span — The oblique face of the run. The bundled faces have two obliques, Inter Oblique and DejaVu Sans Mono Oblique: the proportional oblique ("italic") or the oblique monospace ("mono-italic") when the run is a monospace one. The host cannot slant a face (it refuses a synthetic bold or italic), so a proportional oblique is Inter Oblique (see docs/TYPE.md).
  • fn dir(self, dir: layout::Direction) -> Span — Make the run a directional isolate (UAX #9 LRI / RLI): it is resolved in dir on its own and counts as one neutral object for the text around it, so a Hebrew name in an English sentence keeps its own order and the punctuation next to it stays in the sentence's direction.
  • fn font(self, f: impl Into<String>) -> Span — The face of the run ("bold" is the bold face of the theme).
  • fn mono(self) -> Span — The monospace face of the run ("mono", or the oblique monospace when the run is an italic one).
  • fn tabular(self) -> Span — Tabular figures: every digit of the run has the width of the others, so a column of values lines up and a running clock does not jitter. (A number with a short unit is tabular without asking.)
  • fn proportional(self) -> Span — Proportional figures, even in a number with a unit.
  • fn small_caps(self) -> Span — Small capitals: the lower case of the run is drawn as capitals at 80 % of their size, in the weight of the run (Latin; the sans faces of the default set have them).
  • fn fractions(self) -> Span — Diagonal fractions: 1/2 is drawn as a fraction.
  • fn slashed_zero(self) -> Span — A zero with a slash through it, so it is never an O (codes, serial numbers, tables).
  • fn case_sensitive(self) -> Span — Case-sensitive forms: the hyphen, the slash and the brackets sit at the middle of the capitals. (A text in capitals gets them without asking.)
  • fn weight(self, w: u16) -> Span — The run at a weight of the Inter ramp, 100 (Thin) to 900 (Black), rounded to the nearest hundred: every weight is a face of its own, so the steps are real (.weight(300) is lighter than .weight(400)).
  • fn bold(self) -> Span — The bold face of the run.
  • fn size(self, s: f64) -> Span — The size of the run (px).
  • fn color(self, c: impl Into<Col>) -> Span — The colour of the run.

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::SpanDeco

pub struct SpanDeco { /* see fields */ }

The decoration of a [Span]: a line under or through the run in its colour, and a background behind it.

Public fields

fieldtype
underlinebool
strikebool
bgOption<Col>

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::SpringCfg

pub struct SpringCfg { /* see fields */ }

Damped spring parameters (per second): a = k (target - x) - c v.

Public fields

fieldtype
stiffnessf64
dampingf64

Methods

  • const SNAPPY: SpringCfg — Quick with a little overshoot (hover tilt, magnetic pull).
  • const SOFT: SpringCfg — Slower and softer (parallax, spotlight drift).
  • const BOUNCY: SpringCfg — Visible wobble (press feedback).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Squash

pub struct Squash { /* see fields */ }

Squash and stretch from a body's velocity: the picture elongates along its velocity and squashes on impact (a sudden change of velocity), volume preserved (area is conserved: the stretch along one axis is the inverse of the other), with a spring that wobbles it back.

Public fields

fieldtype
stretchf64Largest speed stretch as a log factor (0.16 = 17 % longer along the velocity).
v_reff64Speed (px/s) at which the stretch is about 76 % of the maximum (tanh).
impactf64Impact gain: strain rate kicked per v_ref of velocity change.
a_minf64Acceleration (px/s²) above which a velocity change counts as an impact.
stiffnessf64Spring stiffness (1/s²) and damping (1/s) of the strain.
dampingf64
maxf64Hard limit of the log strain.

Methods

  • fn new() -> Squash
  • fn subtle() -> Squash — Barely there: for UI that should feel alive but calm.
  • fn cartoon() -> Squash — A cartoon: long stretch, deep squash, a long wobble.
  • fn stretch(self, s: f64) -> Self
  • fn impact(self, g: f64) -> Self
  • fn spring(self, stiffness: f64, damping: f64) -> Self

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Stagger

pub struct Stagger { /* see fields */ }

How a staggered entrance is timed.

Public fields

fieldtype
step_msu32The delay between two children (ms). It shrinks when there are many children, so the whole entrance still fits in [Stagger::max_total_ms].
risef64How far the children rise into place (px).
dur_msu32How long one child takes to arrive (ms).
max_total_msu32The most the whole entrance takes (ms): the last child is in place by then.
max_itemsusizeThe most children that are staggered (the rest arrive with the last one).

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Stop

pub struct Stop { /* see fields */ }

One colour stop. Build with [stop] or from a colour / (position, colour) pair.

Public fields

fieldtype
atOption<f64>Position 0..=1 along the gradient (None: spread evenly between its neighbours).
colui::el::Col
midf64Where between this stop and the next the colours are half and half (0.5 = halfway).
curveCurveThe shape of the segment from this stop to the next.
glowf64Light above white this stop emits (0 = none; 1 = twice as bright). Rolled off to white in the colour, and handed to the glow halo (see Grad::glow).

Methods

  • fn even(col: impl Into<Col>) -> Stop — An evenly spread stop.
  • fn mid(self, m: f64) -> Stop — Midpoint of the segment after this stop (0.02..=0.98).
  • fn curve(self, c: Curve) -> Stop
  • fn glow(self, g: f64) -> Stop

Trait implementations: Clone, Copy, Debug, From<(f64, C)>, From<Col>, From<Role>, From<Srgb8>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Stops

pub struct Stops { /* see fields */ }

A gradient's colour ramp: stops plus how they mix.

Public fields

fieldtype
stopsVec<Stop>
spacesuper::color::Space
smoothf640 = piecewise linear between stops, 1 = a smooth monotone spline through them.
premulboolMix premultiplied by alpha (correct transparency, the default).
loopedboolThe ramp wraps: the first stop is repeated at the end (seamless conics, flows).

Methods

  • fn new(stops: impl IntoIterator<Item = impl Into<Stop>>) -> Stops
  • fn space(self, s: Space) -> Stops
  • fn smooth(self, s: f64) -> Stops
  • fn looped(self, on: bool) -> Stops
  • fn straight_alpha(self) -> Stops — Straight-alpha mixing (what naive toolkits do; here for comparisons).
  • fn resolve(&self, th: &Theme) -> Ramp — Resolve the colours against a theme and lay the stops out.
  • fn resolve_with(&self, f: impl Fn(Col) -> [u8; 4]) -> Ramp — Resolve with a colour lookup (tests and offline tools: |c| c.resolve(&theme).channels()).

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::Store

pub struct Store { /* see fields */ }

Small typed app-state store (ordered, deterministic).

Methods

  • fn new() -> Self
  • fn with(self, name: impl AsRef<str>, value: impl Into<Value>) -> Self
  • fn set(&mut self, name: impl AsRef<str>, value: impl Into<Value>)
  • fn get(&self, name: impl AsRef<str>) -> Option<&Value>
  • fn has(&self, name: impl AsRef<str>) -> bool — Whether name holds a value of any kind.
  • fn toggle(&mut self, name: impl AsRef<str>) -> bool — Flip Bool name (a missing or non-bool key counts as false, so it becomes true) and return the new value: st.toggle("open") in an [Action::custom], the direct twin of [Action::toggle].
  • fn inc(&mut self, name: impl AsRef<str>, by: i64) -> i64 — Add by to Int name (a missing or non-int key counts as 0) and return the new value: the twin of [Action::inc].
  • fn bool(&self, name: impl AsRef<str>) -> bool — false when missing or not a bool.
  • fn int(&self, name: impl AsRef<str>) -> i64 — 0 when missing or not an int.
  • fn scalar(&self, name: impl AsRef<str>) -> f64 — Scalar or int as f64; 0.0 otherwise.
  • fn text(&self, name: impl AsRef<str>) -> &str
  • fn iter(&self) -> impl Iterator<Item = (&str, &Value)>
  • fn list(&self, name: impl AsRef<str>) -> &[Value] — The items of list name (empty when missing or not a list).
  • fn len(&self, name: impl AsRef<str>) -> usize — Number of items in list name (0 when missing or not a list).
  • fn is_empty(&self, name: impl AsRef<str>) -> bool — true when list name has no items (or is missing).
  • fn strings(&self, name: impl AsRef<str>) -> Vec<String> — The Text items of list name as owned strings (other items are skipped).
  • fn push(&mut self, name: impl AsRef<str>, value: impl Into<Value>) -> Result<(), String> — Append to list name, creating it when missing. Refused when the key holds a non-list.
  • fn remove_at(&mut self, name: impl AsRef<str>, index: usize) -> Option<Value> — Remove and return item index of list name (None when out of range).

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq, ViewportExt

structaster_blueprint::ui::prelude::SystemPrefs

pub struct SystemPrefs { /* see fields */ }

The accessibility and appearance settings of the operating system.

Public fields

fieldtype
darkboolThe system is in dark mode (prefers-color-scheme: dark).
high_contrastboolIncreased contrast (prefers-contrast: more).
reduced_motionboolReduced motion (prefers-reduced-motion: reduce).
reduced_transparencyboolReduced transparency (prefers-reduced-transparency: reduce): frosted glass is drawn as a solid surface.
text_scalef64The 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) -> Self
  • fn from_env() -> Self — The settings an environment names: ASTER_DARK, ASTER_CONTRAST (or ASTER_HIGH_CONTRAST), ASTER_REDUCE_MOTION, ASTER_REDUCE_TRANSPARENCY (1, true, yes, on are on; anything else or nothing is off) and ASTER_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) -> Self
  • fn high_contrast(self, on: bool) -> Self
  • fn reduced_motion(self, on: bool) -> Self
  • fn reduced_transparency(self, on: bool) -> Self

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::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

fieldtype
lightsuper::Theme
darksuper::Theme
high_contrast_lightsuper::Theme
high_contrast_darksuper::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 of light and dark ([Theme::increased_contrast]) instead of the built-in high-contrast themes.
  • fn resolve(&self, prefs: SystemPrefs) -> Theme — The theme prefs selects, with its reduced-motion and reduced-transparency flags set.

Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::TextInput

pub struct TextInput { /* see fields */ }

Builder for text inputs: text_input(s, "k", "placeholder") then .password(), .multiline(rows), .max_length(n), .validate(..), .form(&form), .w(px), then .build() (or .into() / .child(..)) to get the [El].

Methods

  • fn password(self) -> Self — Mask the value and enable the reveal toggle (see [password_field]).
  • fn multiline(self, rows: usize) -> Self — rows visible lines (>= 2 makes a wrapping text area).
  • fn max_length(self, n: usize) -> Self — At most n chars: typing past it is refused, a paste is cut to fit.
  • fn w(self, px: impl Into<f64>) -> Self — Exact width in px. Without it the input is 240 px wide on its own, but fills the width of a stretching parent (a col) or of a .grow(1.) slot in a row, and a text area wraps at the width it was actually given.
  • fn multi_caret(self) -> Self — Opt in to several carets/selections. Ctrl-D selects the word at the caret, then adds the next occurrence of the selected text; Alt-Down / Alt-Up (text area) add a caret on the next / previous line. Typing, Enter, Backspace, Delete, Left/Right and Home/End then apply at every caret, Escape keeps only the primary one. The extra ones live in Text <key>.extra (caret:anchor;.., chars); any other key, a click, undo or IME collapses them. Off by default (single caret as before).
  • fn reveal_toggle(self, on: bool) -> Self — Show or hide the Show/Hide toggle of a password field.
  • fn validate(self, f: impl Fn(&str) -> Result<(), String> + 'static) -> Self — Validation rule: Err(message) is shown under the field in the danger role once the field was edited or left (<key>.touched), and the border turns danger.
  • fn rule(self, r: rules::Rule) -> Self — validate with a ready-made [rules::Rule]: .rule(rules::required("Name?").and(rules::min_len(3, "Too short"))).
  • fn validate_store(self, f: impl Fn(&Store) -> Result<(), String> + 'static) -> Self — A rule over the whole store, run after .validate(..): it can compare this field with others ("the passwords match") or read any other state. Shown and registered with the [Form] like the others.
  • fn required(self) -> Self — Mark the field required: a * after the label, "Required" in the field's description, and an error ("Required") once it was left while empty (blank counts as empty), ahead of any .validate(..) / .rule(..). With a [Form] it is a rule by itself, so .form(&f) needs nothing else.
  • fn required_msg(self, msg: impl AsRef<str>) -> Self — required with your own message ("Enter your name").
  • fn error(self, msg: impl AsRef<str>) -> Self — An error that shows at once, whatever the field holds (a server's answer: "That email is taken"). It wins over a rule's.
  • fn form(self, form: &Form) -> Self — Register the field's rule with a [Form] (.validate(..), .rule(..) or .required()).
  • fn on_key(self, key: Key, action: Action) -> Self — .on_key(Key::Enter, action) on the field (submit).
  • fn submit_on_enter(self, action: Action) -> Self — Enter runs action (send the message) while Shift+Enter still inserts a newline: the chat composer of a [text_area]. The action runs for Enter and Ctrl+Enter, not for Shift, Alt or Meta with it; an IME's Enter that confirms a composition is not a key and never submits. The field's accessible description says so ("Enter sends, Shift+Enter adds a new line"), unless .required() writes its own. In a single-line field it is the same as .on_key(Key::Enter, action). Clear the draft in the same action: Action::seq([send, Action::set("draft", "")]).
  • fn disabled_if(self, f: impl Fn(&Store) -> bool + 'static) -> Self — Disabled while f(store) is true.
  • fn label(self, label: impl AsRef<str>) -> Self — A caption above the field; it is also the field's label (the placeholder otherwise).
  • fn hint(self, hint: impl AsRef<str>) -> Self — Helper text under the field, muted; a validation error replaces it while there is one.
  • fn counter(self) -> Self — A 12 / 280 character count under the field, right aligned (needs .max_length(n); refused without).
  • fn clear_button(self) -> Self — An x button at the end of a single-line field (<key>.clear, label "Clear") that empties it, undoably, and keeps the focus; its slot is kept while the field is empty so the field does not change width.
  • fn on_change(self, action: Action) -> Self — Run action after the text changed by typing, deleting, pasting, cutting, undo, an IME commit or the clear button (not when the app sets the key itself): mark a form dirty, start a debounce timer (start_timer + App::on_expire), filter.
  • fn read_only(self) -> Self — Read only: the caret, selection, Ctrl-A and copy work, typing, deleting, pasting, cutting, undo and IME do nothing, and the field is a read-only text field for assistive tech. (Disabled is .disabled_if(..).)
  • fn mono(self) -> Self — Set the text in the monospace face (see [El::mono]): hostnames, commands, keys, fingerprints, code. Every character has the same advance, so a caret, a selection and a column of fields line up.
  • fn copy_button(self) -> Self — A copy button at the end of a single-line field (<key>.copy, labelled "Copy"): it puts the whole text on the app clipboard, shows a check mark for a moment (Bool <key>.copied, a 1.5 s timer) and the app announces "Copied". Pair it with read_only or [selectable_text] for a command, a fingerprint, an address.
  • fn bare(self) -> Self — No fill and no outline: the field reads as plain text (its focus ring still shows). Selection and copy work as before.
  • fn build(self) -> El — Build the element.

Trait implementations: From<TextInput>

structaster_blueprint::ui::prelude::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 in Style::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 at k times the theme's own size (absolute: with_text_scale(1.) undoes with_text_scale(1.5); non-finite values are ignored, others kept within 0.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) -> &str
  • fn mode(&self) -> Mode
  • fn style(&self) -> Style
  • fn color(&self, role: Role) -> Srgb8 — Color of a role.
  • fn tint(&self, role: Role, alpha: f64) -> Srgb8 — A role at alpha (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 step 0..=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 a w x h shape.
  • fn elevation(&self, level: u8) -> &Elevation — Elevation preset; levels above [MAX_ELEVATION] clamp.
  • fn states(&self) -> StateLayers
  • fn focus_ring(&self) -> FocusRing
  • fn 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 by t (the lit top of a gradient).
  • fn lower(&self, role: Role, t: f64) -> Srgb8 — A role darkened toward black by t (the shaded bottom of a gradient).
  • fn border_width(&self) -> f64 — Stroke width of a plain Border outline (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: base moved toward the accent by 14 %, stopping where content that is readable on base would stop being.
  • fn fit_mix(&self, a: Srgb8, b: Srgb8, t: f64) -> Srgb8 — mix(a, b, t) with t reduced until the content colour of a ([on_color]) stays readable on the result. A gradient end that cannot make initials unreadable: see ui::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, Info and TextMuted are 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 (see ui::responsive).
  • fn with_responsive(self, r: ui::responsive::Responsive) -> Self
  • ...and 23 more

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::TiltCard

pub struct TiltCard { /* see fields */ }

Tilt card settings.

Public fields

fieldtype
max_degf64Largest rotation in degrees at the card edge.
perspectivef64Camera distance in px (smaller = stronger perspective).
shadef64Depth shading 0..1: the side tilting away darkens, the near side lightens.
sheenf64Specular sheen strength 0..1 (a soft white glare under the pointer).
liftf64Scale-up while hovered.
springui::hx::SpringCfg

Methods

  • fn new() -> Self
  • fn max_deg(self, d: f64) -> Self
  • fn perspective(self, px: f64) -> Self
  • fn shade(self, s: f64) -> Self
  • fn sheen(self, s: f64) -> Self
  • fn lift(self, k: f64) -> Self

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::TimelineItem

pub struct TimelineItem { /* see fields */ }

One event on a [timeline].

Methods

  • fn new(title: impl AsRef<str>, time: impl AsRef<str>) -> Self
  • fn detail(self, d: impl AsRef<str>) -> Self
  • fn role(self, r: Role) -> Self
  • fn icon(self, i: Icon) -> Self

Trait implementations: Clone

structaster_blueprint::ui::prelude::Transition

pub struct Transition { /* see fields */ }

How a property moves to a new value: duration, curve and delay.

Methods

  • fn theme(token: MotionToken) -> Self — A theme token pairing: Transition::theme(MotionToken::FAST).
  • fn ms(ms: u32, ease: Ease) -> Self — A literal duration in ms with a theme curve (still instant under reduced motion).
  • fn instant() -> Self — No animation: the value jumps.
  • fn delay(self, ms: u32) -> Self — Start ms after the target changes.
  • fn spring(s: Spring) -> Self — A transition that follows a spring response: Transition::spring(Spring::Snappy). The value overshoots when the spring does and settles when it settles. Under reduced motion the transition is instant (as every other one).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::TreeNode

pub struct TreeNode { /* see fields */ }

A node of a [tree_view].

Methods

  • fn new(id: impl AsRef<str>, label: impl AsRef<str>) -> Self — id must be unique in the tree (it is stored in the selection).
  • fn icon(self, i: Icon) -> Self
  • fn children(self, kids: impl IntoIterator<Item = TreeNode>) -> Self

Trait implementations: Clone

structaster_blueprint::ui::prelude::Viewport

pub struct Viewport { /* see fields */ }

The surface the UI is drawn on.

Public fields

fieldtype
physical(f64, f64)The panel resolution in device px.
scalef64Device px per logical px (any value > 0; 1.25, 1.5, 1.75 and 2.25 are fine).
safelayout::InsetsThe safe area (notch, rounded corners, TV overscan), in logical px.
distanceDistanceHow far away the user sits.
inputInputThe input devices at hand.
foldOption<Fold>The hinge of a folding surface.

Methods

  • fn new(physical: (f64, f64), scale: f64) -> Self — A viewport of physical device px at scale.
  • fn from_logical(logical: (f64, f64), scale: f64) -> Self — A viewport of logical px at scale (the panel is logical * scale device px).
  • fn with_scale(self, scale: f64) -> Self — The same surface, at another scale (the logical size is kept).
  • fn logical(&self) -> (f64, f64) — The logical size (device px divided by the scale).
  • fn logical_w(&self) -> f64 — The logical width.
  • fn logical_h(&self) -> f64 — The logical height.
  • fn aspect(&self) -> f64 — Width divided by height (0 when the height is unknown).
  • fn orientation(&self) -> Orientation — Which way the surface points.
  • fn size_class(&self) -> Size — The width class under the default breakpoints (the theme may move them).
  • fn size_class_in(&self, r: &super::responsive::Responsive) -> Size — The width class under a theme's breakpoints.
  • fn height_class(&self) -> Height — The height class of the logical height.
  • fn form(&self) -> Form — The form factor. The rules are in docs/FOUNDATION-viewport.md; they are pure and deterministic (same viewport, same form).
  • fn density(&self) -> Density — The density rules of this surface.
  • fn len_ctx(&self, em: f64) -> LenCtx — The length context of this surface (see crate::layout::LenCtx).
  • fn safe_insets(&self) -> Insets — The safe insets as the layout may rely on them: finite, >= 0, and never more than the surface (left + right <= width, top + bottom <= height; the left and top edges win).
  • fn safe_device(&self) -> Insets — The safe insets in device px (logical px times the scale).
  • fn safe_rect(&self) -> Rect — The safe rectangle inside the surface (logical px).
  • fn rotated(&self) -> Viewport — The same surface turned a quarter turn clockwise: the panel swaps its sides, the safe insets and the hinge turn with it, the distance and the input stay.
  • fn with_overscan(self, pct: f64) -> Self — The same surface with TV overscan: pct percent of each edge is unsafe.
  • fn with_safe(self, safe: Insets) -> Self — The same surface with safe insets.
  • fn with_distance(self, d: Distance) -> Self — The same surface at another viewing distance.
  • fn with_input(self, i: Input) -> Self — The same surface with another input set.
  • fn with_fold(self, f: Option<Fold>) -> Self — The same surface with a hinge.
  • fn snap(&self, px: f64) -> f64 — Snap a length to a whole device pixel.
  • fn snap_rect(&self, r: Rect) -> Rect — Snap a rectangle to whole device pixels.
  • fn hairline(&self) -> f64 — One device pixel in layout px (the hairline width).
  • fn preset(d: Device) -> Viewport — The preset surface of a device.

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::VirtualGrid

pub struct VirtualGrid { /* see fields */ }

A virtualised grid of tiles: the builder.

virtual_grid(s, "g", 10_000, 220., 140., |i| tile(i)) is a grid of 10,000 tiles that lays out the rows in view only. The columns follow the width the grid got (or .cols(n), or a minimum tile width in the foundation's units). The tiles are keyed <id>.<i>; the scroll offset is the Scalar <id>.scroll and the focused index the Int <id>.sel.

Methods

  • fn cols(self, n: usize) -> Self — A fixed number of columns (else they follow the width the grid got).
  • fn min_tile_w(self, l: Len) -> Self — The smallest a tile may be, in the foundation's units (Len::Vw(12.)): the columns follow it and the tiles share the width the grid got.
  • fn gap(self, px: impl Into<f64>) -> Self — The gap between the tiles (px).
  • fn overscan(self, rows: usize) -> Self — The rows built above and below the view (default 1).
  • fn smooth_scroll(self, ms: u32) -> Self — Ease the offset moves of the grid: ms is the duration of a move (the target stays in the Scalar <id>.scroll).
  • fn touch_scroll(self) -> Self — Pan with a touch drag (see [El::touch_scroll]).
  • fn overscroll(self, on: bool) -> Self — Rubber-band at the ends (see [El::overscroll]).
  • fn smooth_wheel(self, ms: u32) -> Self — Ease the wheel's moves too (see [El::smooth_wheel]).
  • fn reorderable(self, on_move: impl Fn(&mut Store, usize, usize) + 'static) -> Self — The tiles of the grid can be reordered by the user: on_move(from, to) runs when a tile lands on a new place (the app moves it in its own list).
  • fn build(self) -> El — The grid itself.

Trait implementations: From<VirtualGrid>

structaster_blueprint::ui::prelude::Wizard

pub struct Wizard { /* see fields */ }

Multi-step form. Int key is the current step (0-based), Bool <key>.done the finished flag. Next runs the current step's form check: if a rule fails it shows every error and focuses the first failing field (focus_first_error) and stays; otherwise it advances, and on the last step sets <key>.done, runs .finish(action) and shows .done_view(el). Back goes one step; finished steps in the header are clickable. Ids <key>.step.<i>, <key>.back, <key>.next. At Compact width the header folds into "Step n of m" with a meter.

Methods

  • fn finish(self, a: Action) -> Self — Action run when the last step passes.
  • fn done_view(self, e: El) -> Self — What to show once finished.
  • fn build(self) -> El

Trait implementations: From<Wizard>

structaster_blueprint::ui::prelude::WizardStep

pub struct WizardStep { /* see fields */ }

One step of a [wizard]: its title, the body to show and the [Form] that must pass to leave it.

Methods

  • fn new(title: impl AsRef<str>, body: El) -> Self
  • fn form(self, f: &Form) -> Self — Validate with this form (fields registered via text_input(..).form(&form)) before Next.

structaster_blueprint::ui::prelude::WrapOpts

pub struct WrapOpts { /* see fields */ }

The wrap options of one text node.

Public fields

fieldtype
rulesWrapRulesThe break opportunities the breaker may use.
modeWrapModeHow the breaker places the breaks.

Methods

  • const fn new(rules: WrapRules, mode: WrapMode) -> Self — The options of one mode and one rule set.

Trait implementations: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::XySeries

pub struct XySeries { /* see fields */ }

One named series of (x, y) points for [scatter_chart].

Public fields

fieldtype
nameString
pointsVec<[f64; 2]>

Methods

  • fn new<X: Copy + Into<f64>, Y: Copy + Into<f64>>(name: impl AsRef<str>, points: &[(X, Y)]) -> Self — XySeries::new("run A", &[(1., 2.5), (2., 3.1)]); the colour cycles Accent, Info, Success, Warning unless .role(..).
  • fn role(self, role: Role) -> Self

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::fog::Fog

pub struct Fog { /* see fields */ }

A fog bank. Build with [Fog::bank] or [Fog::height], turn into an element with [fog].

Methods

  • fn bank() -> Self — A bank of drifting fog that fades out toward the top and bottom of its box.
  • fn height() -> Self — Height fog: thickest at the bottom of its box, thinning upward.
  • fn color(self, c: impl Into<Col>) -> Self — Fog colour (before the scene light tints it).
  • fn density(self, v: f64) -> Self — Peak opacity 0..=1.
  • fn scale(self, px: f64) -> Self — Size of the biggest billows in px.
  • fn drift(self, vx: f64, vy: f64) -> Self — Drift in px per second ((0, 0) bakes once and never changes).
  • fn depth(self, z: f64) -> Self — Depth of the bank in px for the scene's pointer parallax (negative: far, moves less and the other way).
  • fn seed(self, seed: u32) -> Self — Seed of the noise.
  • fn shafts(self, strength: f64) -> Self — Beams of the scene light through the fog, 0..=2 (0, the default, is none). Shadowed behind opaque elements.
  • fn sky(self, backdrop: &El) -> Self — The backdrop alone, for the shafts' occluders ([LightShafts::sky]).
  • fn band(self, top: f64, bottom: f64) -> Self — A bank occupies this band of its box (fractions from the top; default 0.15..0.9).
  • fn rise(self, frac: f64) -> Self — Height fog fills this fraction of its box from the bottom (default 0.5).

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::fog::FogShared

pub struct FogShared { /* see fields */ }

What a fog element shares with the scene pass: its settings and the light the pass last gave it.

Trait implementations: Debug

structaster_blueprint::ui::prelude::particles::Burst

pub struct Burst(..)

What a click throws: a [Particles] system fired at the pointer.

Public fields

fieldtype
0Particles

Methods

  • fn sparks() -> Self
  • fn confetti() -> Self
  • fn pulse() -> Self — A soft ring of dots that expands and fades (a ripple of light).
  • fn seed(self, seed: u64) -> Self
  • fn count(self, n: usize) -> Self
  • fn colors(self, cols: impl IntoIterator<Item = impl Into<Col>>) -> Self
  • fn duration(&self) -> f64 — Longest time any particle of a burst lives, in seconds.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::particles::Dot

pub struct Dot { /* see fields */ }

One particle at one instant.

Public fields

fieldtype
xf64
yf64
sizef64Diameter in px.
rgb[u8; 3]
alphaf64
squashf64Width factor 0..1 (flip of a flake).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::particles::LifeAt

pub struct LifeAt(..)

How a particle system is timed (see [eval]).

Methods

  • fn cycle(t: f64) -> Self — Endless field at clock t seconds.
  • fn once(n: u64, age: f64, origin: [f64; 2]) -> Self — Burst number n born at element-local origin, age seconds ago.

Trait implementations: Clone, Copy, Debug

structaster_blueprint::ui::prelude::particles::Particles

pub struct Particles { /* see fields */ }

A particle system description. Build with a preset and chain the knobs.

Public fields

fieldtype
seedu64
countusize
emitterEmitter
life(f64, f64)Lifetime range in seconds.
speed(f64, f64)Launch speed range in px/s.
dir(f64, f64)Launch direction: centre and spread in degrees (0 = right, -90 = up).
gravity[f64; 2]Constant acceleration in px/s^2 (positive y = down).
dragf64Linear drag per second.
swirlf64Swirl sway amplitude in px (a curl-like wander around the ballistic path).
size(f64, f64)Diameter in px at birth and at death.
size_jitterf64Per-particle size variation 0..1.
colorsVec<ui::el::Col>Colour over life.
opacityf64Peak opacity 0..1.
fade(f64, f64)Fractions of life spent fading in and out.
twinklef64Twinkle depth 0..1 (stars).
hotf64Whitening of the core 0..1.
halof64Extra large faint halo 0..1.
hardf64Edge hardness of dots 0..1.
trailusizeTrailing copies behind the head (sparks), each fainter.
shapeShape
stepf64Ambient fields redraw every step seconds (0 = every frame). Slow drifts look the same at 20 fps and cost a third; staggered by seed so fields do not all redraw on one frame.
by_particleboolEach particle takes one of the colors for its whole life instead of cooling through them (confetti).
blendaster_ui::BlendModeHow the sprites combine with what is beneath: Add makes sparks, embers and star halos light up their surroundings (the presets that glow choose it); SourceOver is ordinary paint.

Methods

  • fn dust() -> Self — Slow, tiny motes drifting upward through the light.
  • fn stars() -> Self — Fixed stars that twinkle.
  • fn embers() -> Self — Glowing embers rising from the bottom edge and cooling from yellow to red.
  • fn sparks() -> Self — A quick radial spray with trails; meant for [Burst].
  • fn confetti() -> Self — Tumbling confetti falling from a burst point.
  • fn seed(self, seed: u64) -> Self
  • fn count(self, n: usize) -> Self
  • fn emitter(self, e: Emitter) -> Self
  • fn life(self, min: f64, max: f64) -> Self
  • fn speed(self, min: f64, max: f64) -> Self
  • fn dir(self, centre_deg: f64, spread_deg: f64) -> Self
  • fn gravity(self, gx: f64, gy: f64) -> Self
  • fn drag(self, k: f64) -> Self
  • fn swirl(self, px: f64) -> Self
  • fn size(self, start: f64, end: f64) -> Self
  • fn colors(self, cols: impl IntoIterator<Item = impl Into<Col>>) -> Self — Colours over life (one colour is flat; several cool from the first to the last).
  • fn opacity(self, a: f64) -> Self
  • fn twinkle(self, depth: f64) -> Self
  • fn blend(self, mode: aster_ui::BlendMode) -> Self — Combine the sprites with what is beneath using mode (the glowing presets use Add).
  • fn halo(self, h: f64) -> Self
  • fn palette(self) -> Self — Each particle keeps one colour of colors for life instead of cooling through them.
  • fn step(self, secs: f64) -> Self — Redraw every secs seconds (0 = every frame).
  • fn trail(self, n: usize) -> Self
  • fn key(&self) -> u64 — Hash of every field: the layer cache key.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::rules::Rule

pub struct Rule(..)

A validation rule: Ok(()) or the message to show.

Methods

  • fn new(f: impl Fn(&str) -> Result<(), String> + 'static) -> Rule
  • fn check(&self, v: &str) -> Result<(), String> — Check a value.
  • fn and(self, next: Rule) -> Rule — This rule, then next when it passes: the first failure's message wins.

Trait implementations: Clone

structaster_blueprint::ui::prelude::scene3d::Camera3d

pub struct Camera3d { /* see fields */ }

Where the scene is looked at from.

Public fields

fieldtype
eyeVec3
targetVec3
upVec3
fovf64Vertical field of view in degrees (perspective).
orthoOption<f64>Some(height): orthographic, height world units tall.
nearf64
farf64

Methods

  • fn perspective(eye: Vec3, target: Vec3, fov: f64) -> Camera3d
  • fn orthographic(eye: Vec3, target: Vec3, height: f64) -> Camera3d
  • fn look_at(self, eye: Vec3, target: Vec3) -> Camera3d
  • fn fov(self, deg: f64) -> Camera3d
  • fn up(self, up: Vec3) -> Camera3d
  • fn clip(self, near: f64, far: f64) -> Camera3d
  • fn matrices(&self, aspect: f64) -> (M4, M4) — The matrices a point goes through: (view, projection) for a picture of aspect (w / h).
  • fn project(&self, p: Vec3, w: f64, h: f64) -> Option<(f64, f64, f64)> — A world point on the screen: (x, y) in 0..w x 0..h pixels (y down) and its depth in view units; None behind the camera.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::scene3d::Extrusion3d

pub struct Extrusion3d { /* see fields */ }

A 2D outline pushed into a solid: a path, a polygon or the glyphs of a text.

let logo = Extrusion3d::path(shape_commands).height(2.0).depth(0.5).bevel(0.05);
Object3d::new(logo).material(Material3d::glossy(hex(0xff7a30)))

Methods

  • fn path(cmds: impl IntoIterator<Item = ui::vector::VectorCommand>) -> Extrusion3d — The closed sub-paths of cmds (curves are flattened; sub-paths nest by even-odd, so a counter is a hole). The path's own units are scaled to height tall once .height(..) is given.
  • fn polygon(points: &[[f64; 2]]) -> Extrusion3d — A polygon (counter-clockwise or clockwise; y down like a path).
  • fn text(el: El, w: f64, h: f64) -> Extrusion3d — The glyphs of el (a text element with the font and weight you want; it is drawn white on transparent at w x h logical pixels and its outline is traced). Needs fonts, so it appears only when the scene is drawn by a screen.
  • fn height(self, h: f64) -> Self — World height of the finished outline (default 1).
  • fn depth(self, d: f64) -> Self — Thickness along z (default 0.25).
  • fn bevel(self, b: f64) -> Self — Chamfer on both faces (default 0.02): the bevel is what catches the light on an edge.
  • fn tracking(self, t: f64) -> Self — Extra space between the glyphs of an extruded text, as a fraction of its height (default 0.05): the letters of a tight font touch once they have depth.
  • fn bulge(self, b: f64) -> Self — Lean the face normals outward from the middle (0.3 a gentle dome): a flat face then sweeps its reflection across the studio like polished metal instead of showing one flat colour.
  • fn geometry(self) -> Geometry3d

Trait implementations: Clone, From<Extrusion3d>

structaster_blueprint::ui::prelude::scene3d::Fog3d

pub struct Fog3d { /* see fields */ }

Volumetric fog: exponential depth fog, optional height fog, light scattered through the shadow map (god rays), noise.

Public fields

fieldtype
colorui::el::Col
densityf64
height_fallofff64
base_heightf64
scatterf64
anisotropyf64
noiseOption<FogNoise3d>
stepsusize
max_distancef64
ambientf64
motesf64

Methods

  • fn new(density: f64) -> Fog3d — Fog3d of extinction density per world unit (0.02 thin haze, 0.08 thick).
  • fn color(self, c: impl Into<Col>) -> Self
  • fn height(self, falloff: f64, base: f64) -> Self — Thin out above base: density falls by e every 1 / falloff units.
  • fn scatter(self, s: f64) -> Self — Brightness of the scattered light.
  • fn anisotropy(self, g: f64) -> Self — Phase function asymmetry -1..1 (Henyey-Greenstein): above 0 the light piles up when you look toward it.
  • fn noise(self, n: FogNoise3d) -> Self
  • fn steps(self, n: usize) -> Self — Samples per view ray (more is smoother and slower).
  • fn max_distance(self, d: f64) -> Self
  • fn motes(self, k: f64) -> Self — Dust motes that glint where the beams are (0 none, 1 subtle, 3 snowy). They drift with the scene's time.
  • fn ambient(self, a: f64) -> Self — How much the ambient light tints the fog.

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::scene3d::FogNoise3d

pub struct FogNoise3d { /* see fields */ }

Noise that makes the fog patchy and, with drift, move.

Public fields

fieldtype
scalef64Size of a cloud in world units.
strengthf640..1: how far the density swings around its mean.
driftVec3World units per second the pattern travels.
seedu32

Methods

  • fn new(scale: f64, strength: f64) -> FogNoise3d
  • fn drift(self, d: Vec3) -> Self
  • fn seed(self, s: u32) -> Self

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::scene3d::Geometry3d

pub struct Geometry3d { /* see fields */ }

What an object is made of.

Methods

  • fn cube(w: f64, h: f64, d: f64) -> Geometry3d — A box w wide, h tall, d deep.
  • fn rounded_box(w: f64, h: f64, d: f64, radius: f64) -> Geometry3d — A box with rounded edges (radius is clamped to half the smallest side).
  • fn sphere(radius: f64) -> Geometry3d
  • fn torus(major: f64, minor: f64) -> Geometry3d — A torus lying flat: ring radius major, tube radius minor.
  • fn cylinder(radius: f64, height: f64) -> Geometry3d — A capped cylinder along y.
  • fn capsule(radius: f64, length: f64) -> Geometry3d — A capsule along y: length is the straight part between the two hemispheres.
  • fn plane(w: f64, d: f64) -> Geometry3d — A flat ground plane facing up, w by d.
  • fn from_mesh(m: Mesh) -> Geometry3d — Any mesh; the scene hash covers every vertex.
  • fn from_obj(bytes: &[u8]) -> Option<Geometry3d> — A Wavefront OBJ file (v, vn, f; polygons are fanned). None when it has no face.
  • fn mesh_ref(&self) -> Option<&Mesh> — The mesh behind a geometry (None for text, which exists once the scene is drawn).

Trait implementations: Clone, From<Extrusion3d>, From<Mesh>

structaster_blueprint::ui::prelude::scene3d::Light3d

pub struct Light3d { /* see fields */ }

A light: directional (a sun, with shadows), point or spot.

Public fields

fieldtype
colorui::el::Col
intensityf64
shadowbool
softnessf64
rangef64
fogf64
specularf64

Methods

  • fn directional(from: Vec3) -> Light3d — A sun shining from the direction from (a vector pointing at the light from the scene's centre). Casts shadows.
  • fn point(pos: Vec3) -> Light3d — A point light at pos; intensity is the radiant power seen at one unit.
  • fn spot(pos: Vec3, target: Vec3, inner_deg: f64, outer_deg: f64) -> Light3d — A spot light at pos aimed at target, full inside inner_deg and gone at outer_deg from the axis.
  • fn color(self, c: impl Into<Col>) -> Self
  • fn intensity(self, i: f64) -> Self
  • fn shadows(self, on: bool) -> Self — Shadow map on or off (directional lights only).
  • fn softness(self, s: f64) -> Self — Angular radius of the light as a tangent: how fast the shadow softens away from the contact (0.02 sharp, 0.12 very soft).
  • fn range(self, r: f64) -> Self — Distance at which a point or spot light is gone.
  • fn specular(self, k: f64) -> Self — Strength of this light's specular highlights (0 = diffuse only).
  • fn fog_scatter(self, k: f64) -> Self — How much of this light the fog scatters (0 hides it from the fog).

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::scene3d::Material3d

pub struct Material3d { /* see fields */ }

PBR-lite material: base colour, roughness, metalness, emissive, rim.

Public fields

fieldtype
baseui::el::Col
roughf64
metalf64
emissiveOption<(ui::el::Col, f64)>
rimf64
rim_colorOption<ui::el::Col>
double_sidedbool
receive_shadowbool
patternPattern3d
fadeOption<(f64, f64)>
reflectf64
coatf64
catcherf64
reflect_reachf64
glassf64
refractionf64
frostf64
thicknessf64
causticsf64

Methods

  • fn new(base: impl Into<Col>) -> Material3d
  • fn accent() -> Material3d — The theme's accent colour, satin.
  • fn glossy(base: impl Into<Col>) -> Material3d — Glossy with a clear coat: lacquered plastic or car paint.
  • fn matte(base: impl Into<Col>) -> Material3d
  • fn metal(base: impl Into<Col>) -> Material3d
  • fn emissive(color: impl Into<Col>, strength: f64) -> Material3d — A light source's body: shows color at strength regardless of lighting.
  • fn glass(tint: impl Into<Col>, radius: f64) -> Material3d — Transmissive glass tinted by tint (white is clear): the view through it is the rest of the scene and, when the scene has [Scene3d::refract_ui], the page beneath, bent by the surface normal like a lens, with a little chromatic spread, a Fresnel reflection of the studio and absorption that deepens toward the rim. radius is the body's size in world units (it scales the bend).
  • fn refraction(self, k: f64) -> Self — How strongly glass bends the view (default 1.6, a ball lens that inverts the view; 0 is a flat pane).
  • fn frosted(self, k: f64) -> Self — Frosted glass: blur the view through it by k (0 clear, 1 milky).
  • fn caustics(self, k: f64) -> Self — Show the bright caustic spot that glass bodies focus into their shadow on this surface (floors and shadow catchers).
  • fn shadow_catcher(strength: f64) -> Material3d — An invisible plane that only shows what the scene does to it: the shadows and contact darkening of the objects and their mirror image (reflect), composited over whatever is beneath the picture (a card, a page). strength is how dark a full shadow is.
  • fn floor() -> Material3d — A floor that takes its look from the theme: a slightly raised surface, rough, fading out at the edge, with a mirror sheen.
  • fn roughness(self, r: f64) -> Self
  • fn metallic(self, m: f64) -> Self
  • fn emission(self, color: impl Into<Col>, strength: f64) -> Self
  • fn rim(self, strength: f64, color: impl Into<Col>) -> Self — Fresnel rim light of strength (tinted by color, default the base colour brightened).
  • fn double_sided(self) -> Self
  • fn no_shadow_receive(self) -> Self
  • fn pattern(self, p: Pattern3d) -> Self
  • fn fade(self, inner: f64, outer: f64) -> Self — Fade the surface out radially (world units from the object's origin): a floor that dissolves into the page.
  • fn reflect(self, k: f64) -> Self — Show the scene's mirror image on this surface (a floor): 0..1.
  • fn reflect_reach(self, h: f64) -> Self — The mirror image fades out within h world units of height above the surface (default: a smooth exponential).
  • fn coat(self, k: f64) -> Self — A thin gloss layer over the base: reflections of the studio on top of the colour.

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::scene3d::Mesh

pub struct Mesh { /* see fields */ }

An indexed triangle mesh (counter-clockwise front faces).

Public fields

fieldtype
posVec<V3>
nrmVec<V3>
idxVec<[u32; 3]>

Methods

  • fn is_empty(&self) -> bool
  • fn triangles(&self) -> usize
  • fn bounds(&self) -> (V3, V3) — Axis-aligned bounds (min, max); a degenerate box at the origin for an empty mesh.
  • fn transform(&mut self, m: &M4) — Apply m to positions and its normal matrix to normals.
  • fn merge(&mut self, o: &Mesh)
  • fn signed_volume(&self) -> f32 — Signed volume (positive when triangles wind counter-clockwise seen from outside).
  • fn content_hash(&self) -> u64 — A key for the scene hash: depends on every vertex and index.
  • fn smooth_normals(&mut self, crease_deg: f32) — Recompute smooth normals: face normals are averaged over the faces that share a position, but only across angles below crease_deg, so a cube keeps its edges and a sphere stays round.

Trait implementations: Clone, Debug, Default, From<Mesh>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::scene3d::Object3d

pub struct Object3d { /* see fields */ }

A geometry with a transform and a material. Transform calls compose in reading order: the first one is applied to the object first, so .rotate_y(30).at(1, 0, 0) rotates in place and then moves, while .at(..).rotate_y(30) orbits.

Methods

  • fn new(geom: impl Into<Geometry3d>) -> Object3d
  • fn material(self, m: Material3d) -> Self
  • fn at(self, x: f64, y: f64, z: f64) -> Self — Move to (x, y, z).
  • fn rotate_x(self, deg: f64) -> Self
  • fn rotate_y(self, deg: f64) -> Self
  • fn rotate_z(self, deg: f64) -> Self
  • fn scale(self, s: f64) -> Self
  • fn scale_xyz(self, x: f64, y: f64, z: f64) -> Self
  • fn spin(self, deg_per_s: f64) -> Self — Turn about the object's own up axis at deg_per_s (an animated scene; a still frame shows the angle at its time).
  • fn casts_shadow(self, on: bool) -> Self — Whether the object throws shadows (default yes).
  • fn occludes(self, on: bool) -> Self — Whether the object darkens the ambient light around it (contact shadow; default yes).
  • fn reflected(self, on: bool) -> Self — Whether the object shows in a floor's reflection (default yes).
  • fn ground(size: f64, y: f64) -> Object3d — A ground plane: size square, takes the theme's floor material, throws no shadow and darkens nothing.

Trait implementations: Clone

structaster_blueprint::ui::prelude::scene3d::Scene3d

pub struct Scene3d { /* see fields */ }

A scene: camera, objects, lights, environment, fog and finishing. Build it, then scene3d(scene).

Methods

  • fn new() -> Scene3d — An empty scene: a camera 6 units back looking at the origin, no lights (add some, or use [Scene3d::studio]).
  • fn studio() -> Scene3d — A product-shot studio that takes its colours from the theme: a warm shadow-casting key light, a cool fill, an accent-tinted rim light from behind, and a sky with two softboxes for the reflections. Add objects and a camera.
  • fn camera(self, c: Camera3d) -> Self
  • fn object(self, o: Object3d) -> Self
  • fn objects(self, os: impl IntoIterator<Item = Object3d>) -> Self
  • fn light(self, l: Light3d) -> Self
  • fn clear_lights(self) -> Self — Drop the studio's lights (and softboxes) and start from yours.
  • fn sky(self, top: impl Into<Col>, horizon: impl Into<Col>, ground: impl Into<Col>) -> Self — Sky gradient (zenith, horizon) and the ground colour bounced back up: the hemisphere light and what glossy surfaces reflect.
  • fn softbox(self, from: Vec3, w_deg: f64, h_deg: f64, color: impl Into<Col>, intensity: f64) -> Self — A softbox (a bright rectangle in the sky) that glossy surfaces reflect: it lights nothing but their highlights.
  • fn ambient(self, k: f64) -> Self — Strength of the ambient (hemisphere and reflection) light.
  • fn occlusion(self, k: f64) -> Self — Contact darkening from the objects' bulk (0 off, 1 strong).
  • fn fog(self, f: Fog3d) -> Self
  • fn backdrop(self, b: Backdrop3d) -> Self
  • fn exposure(self, e: f64) -> Self — Exposure multiplier before tone mapping.
  • fn bloom(self, k: f64) -> Self — A soft glow around the brightest parts.
  • fn feather(self, f: f64) -> Self — Fade the picture's alpha to nothing over this fraction (0..0.5) of its size at the edges, so fog and glow composite into the page without a visible box.
  • fn quality(self, q: Quality3d) -> Self
  • fn at_time(self, t: f64) -> Self — The scene's time in seconds for spins, orbits and fog drift (a still frame; an animated element adds the screen's clock).
  • fn orbit(self, deg_per_s: f64) -> Self — Orbit the camera around its target about the up axis at deg_per_s.
  • fn fps(self, fps: f64) -> Self — Frame rate of an animated scene (default 12, at most 60): a new picture per tick, never more.
  • fn animation_pixels(self, px: usize) -> Self — Largest picture (pixels) an animated scene renders; the painter stretches it to the element (default 160 000).
  • fn aspect(self, a: f64) -> Self — Width / height the element takes when only one side is sized (default 1.6).
  • fn refract_ui(self, on: bool) -> Self — Let glass look through to the page beneath the picture (cards, text, images painted earlier): the element then reads the screen below it, as glass_below does, and re-renders when that changes. Without it glass sees the scene and its backdrop only.
  • fn pointer_orbit(self, id: impl Into<String>, yaw_deg: f64, pitch_deg: f64) -> Self — Make the scene interactive: the camera orbits its target as the pointer moves over the element called id (yaw_deg left and right, pitch_deg up and down at the edges). While the camera moves the scene renders cheaply (a third of the resolution, one sample per pixel, coarse shadows and fog, upscaled by the renderer); about 150 ms after it settles it refines to half resolution and then to full quality, and the settled frame is byte-identical to a still render at that camera.
  • fn live_cell(self, n: usize) -> Self — Size in pixels (2..=4, default 3) of the cells an interactive frame shades once per surface: bigger is faster and softer inside surfaces (edges stay crisp).
  • fn progressive(self, on: bool) -> Self — false turns the cheap moving frames off (every frame at full quality: the measuring baseline).
  • fn alt(self, text: impl Into<String>) -> Self — Name the picture for assistive tech. Without it the scene is decorative.
  • fn is_animated(&self) -> bool — Whether anything in the scene changes with time.
  • fn key(&self) -> u64 — Hash of everything that decides the picture (at the scene's own time).
  • fn render(&self, th: &Theme, w: u32, h: u32) -> Pix — Render without a screen: w x h pixels of straight-alpha RGBA8 at the scene's own time. Extruded text is skipped (it needs a screen's fonts).
  • fn render_live_preview(&self, th: &Theme, w: u32, h: u32, div: usize) -> Pix — An interactive frame (see [Scene3d::pointer_orbit]) rendered without a screen: full-resolution visibility, shading once per surface per div x div cell (2..=4), the cheap shadow, reflection and fog paths.
  • fn render_live_lowres(&self, th: &Theme, w: u32, h: u32) -> Pix — An interactive frame the way the first version drew it: the whole scene at w x h with the cheap paths (for comparison; stretch it over the element yourself).
  • fn render_hdr(&self, th: &Theme, w: u32, h: u32) -> Vec<[f32; 4]> — The same render as a linear HDR buffer (premultiplied RGBA), for tests and tools.

Trait implementations: Clone, Default

structaster_blueprint::ui::prelude::scene3d::mesh::Mesh

pub struct Mesh { /* see fields */ }

An indexed triangle mesh (counter-clockwise front faces).

Public fields

fieldtype
posVec<V3>
nrmVec<V3>
idxVec<[u32; 3]>

Methods

  • fn is_empty(&self) -> bool
  • fn triangles(&self) -> usize
  • fn bounds(&self) -> (V3, V3) — Axis-aligned bounds (min, max); a degenerate box at the origin for an empty mesh.
  • fn transform(&mut self, m: &M4) — Apply m to positions and its normal matrix to normals.
  • fn merge(&mut self, o: &Mesh)
  • fn signed_volume(&self) -> f32 — Signed volume (positive when triangles wind counter-clockwise seen from outside).
  • fn content_hash(&self) -> u64 — A key for the scene hash: depends on every vertex and index.
  • fn smooth_normals(&mut self, crease_deg: f32) — Recompute smooth normals: face normals are averaged over the faces that share a position, but only across angles below crease_deg, so a cube keeps its edges and a sphere stays round.

Trait implementations: Clone, Debug, Default, From<Mesh>, PartialEq, StructuralPartialEq

structaster_blueprint::ui::prelude::scene3d::render::RCam

pub struct RCam { /* see fields */ }

Public fields

fieldtype
eyeV3
viewM4
projM4
orthobool
forwardV3

Trait implementations: Clone

structaster_blueprint::ui::prelude::scene3d::render::RFog

pub struct RFog { /* see fields */ }

Public fields

fieldtype
colorV3
densityf32Extinction per world unit at the base height.
height_fallofff32
base_heightf32
scatterf32In-scatter brightness of the lights.
gf32
noiseOption<RNoise>
stepsusize
max_distf32
ambientf32Contribution of the ambient light to the fog's colour.
motesf32Strength of the dust motes that glint in the beams (0 = none).

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::scene3d::render::RLight

pub struct RLight { /* see fields */ }

Public fields

fieldtype
kindLKind
colorV3Linear colour times intensity.
shadowbool
softnessf32Tangent of the light's angular radius (penumbra growth).
rangef32Range window for point and spot lights (0 = none).
fogf32Fog scattering of this light relative to its surface strength.
specf32Strength of this light's specular highlight (a rim light that should not glare off floors).

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::scene3d::render::RMat

pub struct RMat { /* see fields */ }

Public fields

fieldtype
baseV3
roughf32
metalf32
emissiveV3
rimf32Fresnel rim strength and colour.
rim_colorV3
double_sidedbool
receive_shadowbool
patternPattern
fadeOption<(f32, f32)>Radial fade (inner, outer) around the object's world origin on x/z: coverage goes to zero between them.
reflectf32Mirror strength of a floor (0 = none): this object shows the scene's reflection.
coatf32Clear-coat gloss on top of the base layer (0..1).
reflect_reachf32Height (world units) above the floor at which the mirror image has faded out (0 = a smooth exponential fade).
glassf32Transmissive glass (0 = opaque): what is behind is seen through the surface, bent by the normal.
refractf32How far the view through glass is bent, as a fraction of the object's radius in pixels.
frostf32Blur of the view through the glass (frosted), as a fraction of the bend.
thicknessf32Effective radius of the glass body in world units (scales the bend).
causticf32Strength of the caustic spot this (floor) surface shows under glass objects.
catcherf32A shadow catcher: shows only shadow and reflection, with this much shadow strength (0 = an ordinary surface).

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::scene3d::render::RNoise

pub struct RNoise { /* see fields */ }

Public fields

fieldtype
seedu32
scalef32
strengthf32
driftV3
timef32

Trait implementations: Clone, Debug

structaster_blueprint::ui::prelude::scene3d::render::RObj

pub struct RObj { /* see fields */ }

Public fields

fieldtype
meshstd::sync::Arc<super::mesh::Mesh>
xfM4
matRMat
castbool
occludeboolOccludes ambient light on other surfaces (contact darkening).
mirroredboolAppears in the floor reflection.

Trait implementations: Clone

structaster_blueprint::ui::prelude::scene3d::render::RScene

pub struct RScene { /* see fields */ }

Public fields

fieldtype
camRCam
objsVec<RObj>
lightsVec<RLight>
sky_topV3
sky_horizonV3
groundV3
boxesVec<SoftBox>
envf32
aof32
fogOption<RFog>
bgBg
exposuref32
bloomf32
featherf32
ssusize
shadow_resusize
floor_yf32Plane height of the mirror floor.
underOption<std::sync::Arc<Vec<V3>>>What the page looks like beneath the picture (linear RGB, under_dims wide and tall): seen through glass.
under_dims[usize; 2]
static_keyu64Hash of everything but the camera (0 = do not cache): an interactive scene reuses its shadow maps and world triangles.
noise_eyeV3The camera position the fog noise grid is fitted around (so the grid does not move with an orbiting camera).
liveboolInteractive frame: cheaper shadow filtering, a cheaper floor reflection and coarser fog.

Trait implementations: Clone

structaster_blueprint::ui::prelude::scene3d::render::SoftBox

pub struct SoftBox { /* see fields */ }

Public fields

fieldtype
dirV3
rightV3
upV3
half[f32; 2]
colorV3

Trait implementations: Clone, Debug

structaster_blueprint::ui::responsive::Ctx

pub struct Ctx { /* see fields */ }

What a responsive_w builder is told.

Public fields

fieldtype
sizeSize
widthf64Estimated width available to this element (logical px).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::responsive::Gauge

pub struct Gauge<'a> { /* see fields */ }

Measures text for a [responsive_gauge] builder: the real shaped width in the screen's faces and the theme's type steps. A text that cannot be shaped (no face for it) is estimated per letter instead, see [Gauge::exact].

Methods

  • fn theme(&self) -> &Theme — The theme the tree is resolved under.
  • fn exact(&self) -> bool — Whether widths are shaped (true) or estimated per letter (false).
  • fn width(&self, text: &str, ty: Type) -> f64 — Width of text set in type step ty (its size and weight under the theme), in logical px.
  • fn width_px(&self, text: &str, px: f64, bold: bool) -> f64 — Width of text at px, in the bold face or the regular one.

structaster_blueprint::ui::responsive::Hooks

pub struct Hooks { /* see fields */ }

Size-dependent hooks stored on an element (S::resp); empty for ordinary elements.

Trait implementations: Clone, Debug, Default

structaster_blueprint::ui::responsive::Responsive

pub struct Responsive { /* see fields */ }

Theme-level responsive settings: breakpoints (logical px) and the optional compact type scale.

Public fields

fieldtype
breakpoints[f64; 3]Upper bounds (exclusive) of Compact, Medium and Expanded.
compact_type_scalef64Multiplier for every type step while the class is Compact (1.0 = off, the default).

Methods

  • fn classify(&self, width: f64) -> Size
  • fn with_breakpoints(self, compact: f64, medium: f64, expanded: f64) -> Self
  • fn with_compact_type_scale(self, k: f64) -> Self — Type steps shrink (or grow) by k on compact screens, e.g. 0.9.

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::scenery::Scenery

pub struct Scenery { /* see fields */ }

A generated backdrop: a preset, a seed and how loud it is.

The art takes its colours from the theme it is drawn in (the accent, the info and the secondary roles over the theme's background), so it belongs to the app without anyone having to name the colours. The same seed and the same size give the same picture.

Methods

  • fn of(kind: BackdropKind) -> Self — A backdrop of kind with the default seed.
  • fn aurora() -> Self — Soft flowing gradient bands.
  • fn mesh() -> Self — Multi-point gradient blobs.
  • fn bokeh() -> Self — Soft light circles with depth.
  • fn dusk() -> Self — A dusk sky with a horizon and a low sun.
  • fn grain() -> Self — A dithered gradient (no banding).
  • fn topo() -> Self — Topographic contour lines.
  • fn grid() -> Self — A glowing grid.
  • fn starfield() -> Self — A starfield.
  • fn kind(&self) -> BackdropKind — The preset.
  • fn seed(self, seed: u64) -> Self — Name the seed: the same seed and size give the same picture.
  • fn intensity(self, v: f64) -> Self — How loud the art is (0..=1, default 1): 0 is the plain field, 1 the full picture.
  • fn living(self, on: bool) -> Self — Let the art drift: a slow, cheap sway of a small translucent layer over the still backdrop (see docs/CINEMATIC.md). Off by default; under reduced motion it freezes.
  • fn rate(self, hz: f64) -> Self — How often a living scenery refreshes the tiles it shows (1..=60 Hz, default 8: slow art does not need more; a video wants its frame rate).
  • fn budget(self, px: usize) -> Self — The most device pixels a living scenery composes in one frame (default 150 000, about 2-3 ms); the sky slows down before a frame does.
  • fn key(&self) -> String — The key the picture is cached under: the preset, the seed, the intensity and, for a living scenery, the rate and budget. Every float the painter or the sky captures is keyed by its exact f64::to_bits() (intensity, rate): nothing is quantised, so two values that paint differently never share a cached picture. The clock and phases are not inputs of the key: the sway/breathe/phase constants are fixed per preset and time is applied by the sky outside the cached picture.
  • fn el(&self) -> El — The full-bleed backdrop element: one picture, baked once per size, seed and theme.
  • fn backdrop(&self) -> FxBackdrop — The backdrop as one picture ([crate::ui::fx::Backdrop]): the scene is rendered once, offscreen, and every glass panel over it frosts that same picture.
  • fn page(&self, content: El) -> El — A page: this backdrop under the content, so the page has depth in one call.
  • fn panel(&self, content: El) -> El — A frosted glass panel over this backdrop: a blurred, tinted copy of the picture behind it.
  • fn glass(&self) -> Glass — The glass the panels of this scenery use: a soft frost that keeps the accent's light.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::text_input::Form

pub struct Form { /* see fields */ }

A group of validated fields. form.can_submit(store) is true while every rule passes; bind a submit control to it with .disabled_if(form.disabled()), or give it form.submit(action), which runs the action only when the form is valid and otherwise reveals every error and moves the focus to the first field that fails. Create it once, outside the screen closure, and move a clone into it; fields register themselves when built. Around that: [Form::summary] (an error summary for the top), [Form::fail] / [Form::pending] / [Form::resolve] (a server's verdict, an async check), [Form::submit_on_enter], [Form::reset].

Methods

  • fn new() -> Self
  • fn rule(&self, key: impl AsRef<str>, f: impl Fn(&Store) -> Result<(), String> + 'static) -> &Self — Add a rule over the whole store for the field with id key (a select, a stepper, a date picker, or a check across fields such as "the two passwords match"). Err(message) blocks the form.
  • fn errors(&self, s: &Store) -> Vec<(String, String)> — (field key, message) for every failing rule, in the order the fields were built; a server answer given with fail counts while the field still holds the value it was given for.
  • fn submit_on_enter(&self, action: Action) -> Action — submit action, and make every single-line field built after this call submit it on Enter (a field with its own .on_key(Key::Enter, ..) keeps that). Returns the action for the submit button.
  • fn pending(key: impl AsRef<str>) -> Action — A check on key's current value is under way (a request to the server): the field shows "Checking..." where its hint is, and submit waits (it reveals the errors and focuses the field, as for any failing rule). Answer with fail or resolve; an edit of the value drops it too.
  • fn resolve(key: impl AsRef<str>) -> Action — The check started with pending passed: the field goes back to its hint.
  • fn fail(key: impl AsRef<str>, msg: impl AsRef<str>) -> Action — A server's (or any late) verdict on one field: Form::fail("email", "That email is taken") shows the message under the field at once, focuses it, and blocks submit until the field's value changes (then the answer no longer applies and goes away by itself). Run it from an action after the "request" finished.
  • fn summary(&self, s: &Store) -> El — A summary of the problems on the form for its top: a danger callout (heard as an alert) titled "N problems to fix" with one line per shown error, "Label: message", that moves the focus to its field when clicked or activated. Nothing until a field shows an error (after a failed submit, or once a field was left).
  • fn can_submit(&self, s: &Store) -> bool — Every registered rule passes (also true for a form with no rules).
  • fn disabled(&self) -> impl Fn(&Store) -> bool + 'static — Predicate for .disabled_if(..): true while the form cannot be submitted.
  • fn touch_all(&self) -> Action — Action that shows every field's error (put it on a disabled-looking submit, or run it on Enter).
  • fn reset(&self) -> Action — Hide every error again: clears each field's touched flag and the server answers given with fail (the values stay; empty them yourself). Run it after a successful submit or from a "Clear" button.
  • fn focus_first_error(&self) -> Action — Reveal every error and focus the first field that fails (nothing happens when the form is valid).
  • fn submit(&self, action: Action) -> Action — Run action when every rule passes; otherwise reveal every error and focus the first failing field instead. Put it on the submit element and on .on_key(Key::Enter, ..) of the fields.

Trait implementations: Clone, Default

structaster_blueprint::ui::text_input::InputEnv

pub struct InputEnv<'a> { /* see fields */ }

Host services available to an input handler.

Public fields

fieldtype
clipboard&'a mut dyn Clipboard

structaster_blueprint::ui::text_input::MemoryClipboard

pub struct MemoryClipboard(..)

In-memory clipboard (the default for headless use and tests).

Trait implementations: Clipboard, Clone, Debug, Default

structaster_blueprint::ui::text_input::TextInput

pub struct TextInput { /* see fields */ }

Builder for text inputs: text_input(s, "k", "placeholder") then .password(), .multiline(rows), .max_length(n), .validate(..), .form(&form), .w(px), then .build() (or .into() / .child(..)) to get the [El].

Methods

  • fn password(self) -> Self — Mask the value and enable the reveal toggle (see [password_field]).
  • fn multiline(self, rows: usize) -> Self — rows visible lines (>= 2 makes a wrapping text area).
  • fn max_length(self, n: usize) -> Self — At most n chars: typing past it is refused, a paste is cut to fit.
  • fn w(self, px: impl Into<f64>) -> Self — Exact width in px. Without it the input is 240 px wide on its own, but fills the width of a stretching parent (a col) or of a .grow(1.) slot in a row, and a text area wraps at the width it was actually given.
  • fn multi_caret(self) -> Self — Opt in to several carets/selections. Ctrl-D selects the word at the caret, then adds the next occurrence of the selected text; Alt-Down / Alt-Up (text area) add a caret on the next / previous line. Typing, Enter, Backspace, Delete, Left/Right and Home/End then apply at every caret, Escape keeps only the primary one. The extra ones live in Text <key>.extra (caret:anchor;.., chars); any other key, a click, undo or IME collapses them. Off by default (single caret as before).
  • fn reveal_toggle(self, on: bool) -> Self — Show or hide the Show/Hide toggle of a password field.
  • fn validate(self, f: impl Fn(&str) -> Result<(), String> + 'static) -> Self — Validation rule: Err(message) is shown under the field in the danger role once the field was edited or left (<key>.touched), and the border turns danger.
  • fn rule(self, r: rules::Rule) -> Self — validate with a ready-made [rules::Rule]: .rule(rules::required("Name?").and(rules::min_len(3, "Too short"))).
  • fn validate_store(self, f: impl Fn(&Store) -> Result<(), String> + 'static) -> Self — A rule over the whole store, run after .validate(..): it can compare this field with others ("the passwords match") or read any other state. Shown and registered with the [Form] like the others.
  • fn required(self) -> Self — Mark the field required: a * after the label, "Required" in the field's description, and an error ("Required") once it was left while empty (blank counts as empty), ahead of any .validate(..) / .rule(..). With a [Form] it is a rule by itself, so .form(&f) needs nothing else.
  • fn required_msg(self, msg: impl AsRef<str>) -> Self — required with your own message ("Enter your name").
  • fn error(self, msg: impl AsRef<str>) -> Self — An error that shows at once, whatever the field holds (a server's answer: "That email is taken"). It wins over a rule's.
  • fn form(self, form: &Form) -> Self — Register the field's rule with a [Form] (.validate(..), .rule(..) or .required()).
  • fn on_key(self, key: Key, action: Action) -> Self — .on_key(Key::Enter, action) on the field (submit).
  • fn submit_on_enter(self, action: Action) -> Self — Enter runs action (send the message) while Shift+Enter still inserts a newline: the chat composer of a [text_area]. The action runs for Enter and Ctrl+Enter, not for Shift, Alt or Meta with it; an IME's Enter that confirms a composition is not a key and never submits. The field's accessible description says so ("Enter sends, Shift+Enter adds a new line"), unless .required() writes its own. In a single-line field it is the same as .on_key(Key::Enter, action). Clear the draft in the same action: Action::seq([send, Action::set("draft", "")]).
  • fn disabled_if(self, f: impl Fn(&Store) -> bool + 'static) -> Self — Disabled while f(store) is true.
  • fn label(self, label: impl AsRef<str>) -> Self — A caption above the field; it is also the field's label (the placeholder otherwise).
  • fn hint(self, hint: impl AsRef<str>) -> Self — Helper text under the field, muted; a validation error replaces it while there is one.
  • fn counter(self) -> Self — A 12 / 280 character count under the field, right aligned (needs .max_length(n); refused without).
  • fn clear_button(self) -> Self — An x button at the end of a single-line field (<key>.clear, label "Clear") that empties it, undoably, and keeps the focus; its slot is kept while the field is empty so the field does not change width.
  • fn on_change(self, action: Action) -> Self — Run action after the text changed by typing, deleting, pasting, cutting, undo, an IME commit or the clear button (not when the app sets the key itself): mark a form dirty, start a debounce timer (start_timer + App::on_expire), filter.
  • fn read_only(self) -> Self — Read only: the caret, selection, Ctrl-A and copy work, typing, deleting, pasting, cutting, undo and IME do nothing, and the field is a read-only text field for assistive tech. (Disabled is .disabled_if(..).)
  • fn mono(self) -> Self — Set the text in the monospace face (see [El::mono]): hostnames, commands, keys, fingerprints, code. Every character has the same advance, so a caret, a selection and a column of fields line up.
  • fn copy_button(self) -> Self — A copy button at the end of a single-line field (<key>.copy, labelled "Copy"): it puts the whole text on the app clipboard, shows a check mark for a moment (Bool <key>.copied, a 1.5 s timer) and the app announces "Copied". Pair it with read_only or [selectable_text] for a command, a fingerprint, an address.
  • fn bare(self) -> Self — No fill and no outline: the field reads as plain text (its focus ring still shows). Selection and copy work as before.
  • fn build(self) -> El — Build the element.

Trait implementations: From<TextInput>

structaster_blueprint::ui::text_input::rules::Rule

pub struct Rule(..)

A validation rule: Ok(()) or the message to show.

Methods

  • fn new(f: impl Fn(&str) -> Result<(), String> + 'static) -> Rule
  • fn check(&self, v: &str) -> Result<(), String> — Check a value.
  • fn and(self, next: Rule) -> Rule — This rule, then next when it passes: the first failure's message wins.

Trait implementations: Clone

structaster_blueprint::ui::vector::Shape

pub struct Shape { /* see fields */ }

One filled and/or stroked path. Coordinates are logical px inside the element.

Methods

  • fn path(cmds: impl IntoIterator<Item = VectorCommand>) -> Self — Any path.
  • fn line(a: [f64; 2], b: [f64; 2]) -> Self — A straight line.
  • fn polyline(pts: &[[f64; 2]]) -> Self — An open polyline through pts.
  • fn polygon(pts: &[[f64; 2]]) -> Self — A closed polygon through pts.
  • fn circle(cx: f64, cy: f64, r: f64) -> Self — A circle.
  • fn rect(x: f64, y: f64, w: f64, h: f64) -> Self — An axis-aligned rectangle.
  • fn fill(self, c: impl Into<Col>) -> Self — Fill colour (a Role, Role::X.tint(a), ...).
  • fn stroke(self, c: impl Into<Col>, width: f64) -> Self — Stroke colour and width in px (round caps and joins by default).
  • fn dash(self, dash: f64, gap: f64) -> Self — Dashed stroke: dash and gap lengths in px.
  • fn butt(self) -> Self — Butt caps and miter joins instead of round ones.
  • fn even_odd(self) -> Self — Even-odd fill rule (rings, holes); the default is non-zero.

Trait implementations: Clone, Debug

structaster_blueprint::ui::viewport::Density

pub struct Density { /* see fields */ }

Density rules: how big the UI should be, given the panel and the viewing distance.

Public fields

fieldtype
scalef64Device px per logical px.
distanceDistanceHow far away the user sits.

Methods

  • fn new(scale: f64, distance: Distance) -> Self
  • fn ui_scale(&self) -> f64 — The recommended multiplier for every dp size (type, spacing, targets).
  • fn text_scale(&self) -> f64 — The recommended multiplier for type only: the 10-foot UI needs ~1.5x the text.
  • fn min_touch_dp(&self) -> f64 — The smallest comfortable touch target (dp).
  • fn min_focus_dp(&self) -> f64 — The smallest comfortable focus target (dp): bigger when the user aims with a D-pad.
  • fn focus_ring_dp(&self) -> f64 — The focus ring thickness (dp).
  • fn min_touch_px(&self) -> f64 — The touch target in layout px (dp times the UI scale).
  • fn min_focus_px(&self) -> f64 — The focus target in layout px.
  • fn focus_ring_px(&self) -> f64 — The focus ring in layout px.
  • fn min_target_dp(&self, input: Input) -> f64 — The smallest interactive target (dp): a finger needs 48, a D-pad 64.
  • fn min_target_px(&self, input: Input) -> f64 — The smallest interactive target in layout px.
  • fn theme(&self, th: &Theme) -> Theme — The theme this density asks for: the type scale through the theme's type steps. (The focus ring is not in the theme: the app draws it with the one width of the surface, see App::focus_ring_px.)
  • fn hairline(&self) -> f64 — One device pixel in layout px (the hairline width).
  • fn snap(&self, px: f64) -> f64 — Snap a length to a whole device pixel.
  • fn snap_rect(&self, r: Rect) -> Rect — Snap a rectangle: its edges land on device pixels, its size follows.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::viewport::Fold

pub struct Fold { /* see fields */ }

The hinge of a folding surface (logical px).

Public fields

fieldtype
hingelayout::RectThe hinge rectangle: a thin line through the surface.

Methods

  • fn vertical(x: f64, y: f64, h: f64) -> Self — A vertical crease at x, running from y for h.
  • fn horizontal(y: f64, x: f64, w: f64) -> Self — A horizontal crease at y, running from x for w.
  • fn rotated_cw(&self, h: f64) -> Fold — The hinge after the surface (of logical height h) is turned a quarter turn clockwise.
  • fn is_vertical(&self) -> bool — Is the hinge vertical (a book fold)?

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

structaster_blueprint::ui::viewport::Input

pub struct Input(..)

The input devices at hand. Devices mix (a tablet has touch and a keyboard), so this is a set: [Input::Touch] | [Input::Pointer] | [Input::Gamepad] | [Input::Remote].

Methods

  • const None: Input — Nothing (a signage screen).
  • const Touch: Input — A finger.
  • const Pointer: Input — A mouse or a trackpad.
  • const Gamepad: Input — A gamepad or a D-pad.
  • const Remote: Input — A remote control (arrows, OK, back).
  • const TouchPointer: Input — Touch and pointer (a tablet, a laptop).
  • const GamepadRemote: Input — Gamepad and remote (a TV).
  • const All: Input — Everything.
  • const fn bits(self) -> u8 — The raw bits.
  • const fn contains(self, other: Input) -> bool — Is every device of other present? The empty set is never "contained".
  • const fn with(self, other: Input) -> Input — The union of two sets.
  • const fn is_empty(self) -> bool — Is the set empty?
  • fn names(self) -> Vec<&'static str> — The devices present, in a stable order.

Trait implementations: BitOr, Clone, Copy, Debug, Default, Eq, Hash, PartialEq, StructuralPartialEq

structaster_blueprint::ui::viewport::Viewport

pub struct Viewport { /* see fields */ }

The surface the UI is drawn on.

Public fields

fieldtype
physical(f64, f64)The panel resolution in device px.
scalef64Device px per logical px (any value > 0; 1.25, 1.5, 1.75 and 2.25 are fine).
safelayout::InsetsThe safe area (notch, rounded corners, TV overscan), in logical px.
distanceDistanceHow far away the user sits.
inputInputThe input devices at hand.
foldOption<Fold>The hinge of a folding surface.

Methods

  • fn new(physical: (f64, f64), scale: f64) -> Self — A viewport of physical device px at scale.
  • fn from_logical(logical: (f64, f64), scale: f64) -> Self — A viewport of logical px at scale (the panel is logical * scale device px).
  • fn with_scale(self, scale: f64) -> Self — The same surface, at another scale (the logical size is kept).
  • fn logical(&self) -> (f64, f64) — The logical size (device px divided by the scale).
  • fn logical_w(&self) -> f64 — The logical width.
  • fn logical_h(&self) -> f64 — The logical height.
  • fn aspect(&self) -> f64 — Width divided by height (0 when the height is unknown).
  • fn orientation(&self) -> Orientation — Which way the surface points.
  • fn size_class(&self) -> Size — The width class under the default breakpoints (the theme may move them).
  • fn size_class_in(&self, r: &super::responsive::Responsive) -> Size — The width class under a theme's breakpoints.
  • fn height_class(&self) -> Height — The height class of the logical height.
  • fn form(&self) -> Form — The form factor. The rules are in docs/FOUNDATION-viewport.md; they are pure and deterministic (same viewport, same form).
  • fn density(&self) -> Density — The density rules of this surface.
  • fn len_ctx(&self, em: f64) -> LenCtx — The length context of this surface (see crate::layout::LenCtx).
  • fn safe_insets(&self) -> Insets — The safe insets as the layout may rely on them: finite, >= 0, and never more than the surface (left + right <= width, top + bottom <= height; the left and top edges win).
  • fn safe_device(&self) -> Insets — The safe insets in device px (logical px times the scale).
  • fn safe_rect(&self) -> Rect — The safe rectangle inside the surface (logical px).
  • fn rotated(&self) -> Viewport — The same surface turned a quarter turn clockwise: the panel swaps its sides, the safe insets and the hinge turn with it, the distance and the input stay.
  • fn with_overscan(self, pct: f64) -> Self — The same surface with TV overscan: pct percent of each edge is unsafe.
  • fn with_safe(self, safe: Insets) -> Self — The same surface with safe insets.
  • fn with_distance(self, d: Distance) -> Self — The same surface at another viewing distance.
  • fn with_input(self, i: Input) -> Self — The same surface with another input set.
  • fn with_fold(self, f: Option<Fold>) -> Self — The same surface with a hinge.
  • fn snap(&self, px: f64) -> f64 — Snap a length to a whole device pixel.
  • fn snap_rect(&self, r: Rect) -> Rect — Snap a rectangle to whole device pixels.
  • fn hairline(&self) -> f64 — One device pixel in layout px (the hairline width).
  • fn preset(d: Device) -> Viewport — The preset surface of a device.

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

structaster_blueprint::ui::virtual_grid::Shelf

pub struct Shelf { /* see fields */ }

One horizontally scrolling row of tiles: the builder.

Only the tiles in view (plus an overscan) are built, so count may be 100k+.

Methods

  • fn gap(self, px: impl Into<f64>) -> Self — The gap between the tiles (px).
  • fn overscan(self, n: usize) -> Self — The tiles built beyond the view (default 1).
  • fn smooth_scroll(self, ms: u32) -> Self — Ease the offset moves of the shelf: ms is the duration of a move (the target stays in the Scalar <id>.scroll).
  • fn touch_scroll(self) -> Self — Pan with a touch drag (see [El::touch_scroll]).
  • fn overscroll(self, on: bool) -> Self — Rubber-band at the ends (see [El::overscroll]).
  • fn smooth_wheel(self, ms: u32) -> Self — Ease the wheel's moves too (see [El::smooth_wheel]).
  • fn reorderable(self, on_move: impl Fn(&mut Store, usize, usize) + 'static) -> Self — The tiles of the shelf can be reordered by the user: on_move(from, to) runs when a tile lands on a new place (the app moves it in its own list).
  • fn build(self) -> El — The shelf itself.

Trait implementations: From<Shelf>

structaster_blueprint::ui::virtual_grid::Shelves

pub struct Shelves { /* see fields */ }

A page of shelves: the builder.

Only the shelves in view (plus an overscan) are built, and a shelf only its tiles in view.

Methods

  • fn gap(self, px: impl Into<f64>) -> Self — The gap between the tiles and between the shelves (px).
  • fn overscan(self, n: usize) -> Self — The shelves (and the tiles) built beyond the view (default 1).
  • fn title_h(self, px: impl Into<f64>) -> Self — The height of a shelf title (the body's line height by default).
  • fn smooth_scroll(self, ms: u32) -> Self — Ease the offset moves of the page and of its shelves: ms is the duration of a move (the target stays in the Scalar <id>.scroll).
  • fn touch_scroll(self) -> Self — Pan with a touch drag (see [El::touch_scroll]).
  • fn overscroll(self, on: bool) -> Self — Rubber-band at the ends (see [El::overscroll]).
  • fn smooth_wheel(self, ms: u32) -> Self — Ease the wheel's moves too (see [El::smooth_wheel]).
  • fn reorderable(self, on_move: impl Fn(&mut Store, usize, usize, usize) + 'static) -> Self — The tiles of every shelf can be reordered by the user: on_move(shelf, from, to) runs when a tile lands on a new place of its shelf (the app moves it in its own list).
  • fn build(self) -> El — The page itself.

Trait implementations: From<Shelves>

structaster_blueprint::ui::virtual_grid::VirtualGrid

pub struct VirtualGrid { /* see fields */ }

A virtualised grid of tiles: the builder.

virtual_grid(s, "g", 10_000, 220., 140., |i| tile(i)) is a grid of 10,000 tiles that lays out the rows in view only. The columns follow the width the grid got (or .cols(n), or a minimum tile width in the foundation's units). The tiles are keyed <id>.<i>; the scroll offset is the Scalar <id>.scroll and the focused index the Int <id>.sel.

Methods

  • fn cols(self, n: usize) -> Self — A fixed number of columns (else they follow the width the grid got).
  • fn min_tile_w(self, l: Len) -> Self — The smallest a tile may be, in the foundation's units (Len::Vw(12.)): the columns follow it and the tiles share the width the grid got.
  • fn gap(self, px: impl Into<f64>) -> Self — The gap between the tiles (px).
  • fn overscan(self, rows: usize) -> Self — The rows built above and below the view (default 1).
  • fn smooth_scroll(self, ms: u32) -> Self — Ease the offset moves of the grid: ms is the duration of a move (the target stays in the Scalar <id>.scroll).
  • fn touch_scroll(self) -> Self — Pan with a touch drag (see [El::touch_scroll]).
  • fn overscroll(self, on: bool) -> Self — Rubber-band at the ends (see [El::overscroll]).
  • fn smooth_wheel(self, ms: u32) -> Self — Ease the wheel's moves too (see [El::smooth_wheel]).
  • fn reorderable(self, on_move: impl Fn(&mut Store, usize, usize) + 'static) -> Self — The tiles of the grid can be reordered by the user: on_move(from, to) runs when a tile lands on a new place (the app moves it in its own list).
  • fn build(self) -> El — The grid itself.

Trait implementations: From<VirtualGrid>

Enums

enumaster_blueprint::ui::Axis

pub enum Axis { Vertical, Horizontal }

The axis the items of a container flow along.

Variants

  • Vertical — The items stack downwards (a list, a grid).
  • Horizontal — The items run to the right (a shelf, a tab strip).

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::Col

pub enum Col { Role, Tint, Mix, Raw, Ink, MixFit, Edge }

A colour: a theme role (default), a translucent role, a mix of two roles, or a raw escape-hatch colour. Resolved against the active theme at render.

Methods

  • fn resolve(self, th: &Theme) -> Srgb8

Variants

  • Role
  • Tint
  • Mix
  • Raw
  • Ink — A role as text: nudged in lightness until it meets the theme's text contrast on every surface.
  • MixFit — mix(a, b, t) with t reduced until a's content colour stays readable on it (avatar gradients).
  • Edge — The boundary of an input: the border role strengthened to 3:1 against every surface ([Theme::edge]).

Trait implementations: Clone, Copy, Debug, From<Col>, From<Role>, From<Srgb8>, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::Pointer

pub enum Pointer { Mouse, Touch }

What the pointer is.

Variants

  • Mouse — A mouse or a trackpad: a drag past the slop lifts the item at once.
  • Touch — A finger: a long press lifts the item, a drag scrolls the list.

Trait implementations: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::Say

pub enum Say { PickedUp, Position, Moved, Dropped, DroppedOn, Cancelled, Hint }

What the toolkit says about a reorder: the app turns it into words (a language).

Methods

  • fn english(&self) -> String — The English words (the default).

Variants

  • PickedUp — An item was lifted: its name, its place (1 based) and the number of items.
  • Position — The lifted item is over another place.
  • Moved — The item landed on a new place of its container.
  • Dropped — The item landed where it was.
  • DroppedOn — The item landed on another container: the container's name and the place (1 based).
  • Cancelled — The move was cancelled and the item went back.
  • Hint — How to move an item with the keyboard: the key that picks it up and drops it ("Space", or "Space or Enter" when the item has no click of its own).

Trait implementations: Clone, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::UiError

pub enum UiError { Layout, DuplicateId, Invalid, NativeFontsRequired, Render }

Every refusal says what was wrong and what to change.

Variants

  • Layout — A layout refusal (duplicate layout id, min > max, bad number...).
  • DuplicateId — Two elements carry the same .id(..).
  • Invalid — An element or component was given a value it cannot draw.
  • NativeFontsRequired — Text needs real shaping; the bundled fonts are only available with the feature.
  • Render — The renderer refused (capacity, vector limits, ...).

Trait implementations: Clone, Debug, Display, Error, From<Error>, From<LayoutError>, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::a11y::A11yRule

pub enum A11yRule { Unlabelled, LowContrast, FocusOrder, SmallTarget, LowComponentContrast, UnknownBackdrop }

What a check looks for.

Methods

  • fn name(self) -> &'static str

Variants

  • Unlabelled — An interactive element without a label.
  • LowContrast — Text whose contrast is below the theme's threshold (3:1 for large text).
  • FocusOrder — Tab order moves backwards on screen (up, or left within a row).
  • SmallTarget — An interactive element smaller than 24x24 px.
  • LowComponentContrast — An interactive element whose fill and border both sit below 3:1 against what is behind it (WCAG 1.4.11): [UiTree::audit_non_text_contrast] reports it for every control, [UiTree::audit_a11y] for the input fields only (their boundary is what identifies them, see [FIELD_KINDS]).
  • UnknownBackdrop — The backdrop under a text is not fully known (a picture or another paint the audit cannot read): a warning, never an issue.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::choreo::PageTransition

pub enum PageTransition { Push, ZoomThrough, FadeThrough, Dissolve, Hero }

A page transition: the cut that moves the frame and the motion that moves the page's elements.

Methods

  • fn cut(self) -> Option<Cut> — The cut that carries the frame (none for [PageTransition::Hero], which morphs instead).
  • fn motion(self) -> PageMotion — The motion the page's own elements make: where they come from.
  • fn ease(self) -> Ease — The curve the page's motion follows (the cut's own curve).

Variants

  • Push — The old page leaves with a parallax while the new one comes in.
  • ZoomThrough — The new page zooms up through the old one.
  • FadeThrough — A soft cross-fade with a touch of scale (the Material fade-through).
  • Dissolve — The old page breaks up and the new one resolves from it.
  • Hero — The shared element (hero) morphs between the two screens; the rest of the page changes at once.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::choreo::Spring

pub enum Spring { Snappy, Gentle, Bouncy }

The spring responses a [Transition] can follow.

Methods

  • fn response_ms(self) -> u32 — The response time in ms (how long the spring needs to travel).
  • fn damping(self) -> f64 — The damping ratio: 1 settles without overshoot, below 1 overshoots.
  • fn at(self, t: f64) -> f64 — The travel at t (0..=1 of the response): 0 at the start, 1 at the end, more than 1 while it overshoots. The curve is the closed-form solution of a damped oscillator, so it is the same every time (no simulation, no state).

Variants

  • Snappy — Quick, with a touch of overshoot (a card that arrives and settles).
  • Gentle — Slow and settled: it never overshoots.
  • Bouncy — A visible wobble: it overshoots and comes back.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::controls::Ime

pub enum Ime { Start, Update, Commit, Cancel }

One IME composition event, as a platform input method delivers it.

Variants

  • Start — A composition begins over the current selection.
  • Update — The preedit string changed (shown underlined).
  • Commit — The composition ended with this final text.
  • Cancel — The composition was abandoned.

Trait implementations: Clone, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::controls::Input

pub enum Input { Key, Ime }

Input delivered to a focused element's [El::on_input] handler.

Variants

  • Key
  • Ime

Trait implementations: Clone, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::cut::Kind

pub enum Kind { Dissolve, Wipe, Iris, Pixelate, Push, Fade }

The six looks.

Variants

  • Dissolve
  • Wipe
  • Iris
  • Pixelate
  • Push
  • Fade

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::deco::Color

pub enum Color { Role, Ui, Rgba, Mix, Shade, Alpha }

A theme-aware colour.

Methods

  • fn role(r: Role) -> Color
  • fn hex(rgb: u32) -> Color
  • fn mix(a: Color, b: Color, t: f32) -> Color
  • fn lighten(self, amount: f32) -> Color
  • fn alpha(self, a: f32) -> Color
  • fn parse(s: &str) -> Result<Color, String> — Parse accent, #rgb, #rrggbb, #rrggbbaa, with optional modifiers +20 (lighten 20 %), -20 (darken), /50 (alpha 50 %), and a~b / a~b@30 (mix of two, 50 % or 30 % of the way to b).
  • fn resolve(&self, th: &Theme) -> [u8; 4]

Variants

  • Role
  • Ui — Any element colour (a tint, a mix, an ink colour).
  • Rgba
  • Mix — a toward b by t (sRGB).
  • Shade — base lightened (> 0, toward white) or darkened (< 0, toward black) by amount (-1..=1).
  • Alpha — base with its alpha multiplied by a.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::deco::Fill

pub enum Fill { Solid, Linear, Radial }

A colour fill.

Methods

  • fn solid(c: Color) -> Fill
  • fn linear(colors: impl IntoIterator<Item = Color>, angle: f32, scope: Scope) -> Fill — An evenly spaced linear gradient across colors.
  • fn radial(colors: impl IntoIterator<Item = Color>, scope: Scope) -> Fill
  • fn scope(&self) -> Option<Scope>

Variants

  • Solid
  • Linear — Colour stops at 0..=1, angle in degrees (0 = left to right, 90 = top to bottom), over scope.
  • Radial — A radial gradient centred at at (0..=1 of the scope's box), reaching the farthest corner.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::deco::LineKind

pub enum LineKind { Solid, Dotted, Dashed, Wavy, Double }

Methods

  • fn parse(s: &str) -> Option<LineKind>

Variants

  • Solid
  • Dotted
  • Dashed
  • Wavy — The error squiggle.
  • Double

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::deco::Mode

pub enum Mode { Dark, Light }

Which theme mode a rule is for.

Methods

  • fn of(th: &Theme) -> Mode

Variants

  • Dark
  • Light

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::deco::RevealMode

pub enum RevealMode { Typewriter, Fade, Rise, Wave, Cascade, Blur, Scale }

Methods

  • fn parse(s: &str) -> Option<RevealMode>
  • const ALL: [(RevealMode, &'static str); 7]

Variants

  • Typewriter — One glyph after another, hard; the caret leads.
  • Fade
  • Rise — Glyphs rise into place while they fade in.
  • Wave — A diagonal wave of glyphs rising with a little overshoot.
  • Cascade — Line by line, each line's glyphs left to right.
  • Blur — Glyphs come out of a blur.
  • Scale — Glyphs grow from 60 % with a small overshoot.

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::deco::Scope

pub enum Scope { Token, Line, Block }

How far a gradient reaches: one token, one line, or the whole block.

Methods

  • fn parse(s: &str) -> Option<Scope>

Variants

  • Token
  • Line
  • Block

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::deco::Sel

pub enum Sel { All, Class, Chars, Bytes, Lines, Text, Cols }

Which text a rule applies to. Ranges are in characters of the whole source unless said otherwise; lines count from 0.

Variants

  • All
  • Class
  • Chars
  • Bytes
  • Lines — Lines a..b (0-based, end exclusive), the whole of each.
  • Text — Every occurrence of this text.
  • Cols — One line's characters a..b ((line, a..b)).

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::deco::layer::Kind

pub enum Kind { Code, Text, Rich }

What the text is, beyond its characters.

Variants

  • Code
  • Text
  • Rich — Per-character face and size runs of a rich text: (chars, font, size); one line per \n, no wrapping.

Trait implementations: Clone, Debug

enumaster_blueprint::ui::deco::lex::Class

pub enum Class { Plain, Keyword, Constant, String, Escape, Number, Comment, Function, Type, Punctuation, Property, Operator, Variable, Attribute, Flag, Heading, Emphasis, Strong, Link, Quote }

What a span of source is, for colouring.

Methods

  • const ALL: [Class; 20]
  • fn name(self) -> &'static str
  • fn parse(s: &str) -> Option<Class> — A class by name (with the usual aliases: fn, str, num, punct, prop, op, var, const).

Variants

  • Plain
  • Keyword
  • Constant — true, false, null, undefined, None...
  • String
  • Escape — An escape inside a string (\n).
  • Number
  • Comment
  • Function
  • Type
  • Punctuation
  • Property
  • Operator
  • Variable
  • Attribute — @decorator, #[derive], [Attribute].
  • Flag — A command-line flag: --release, -Force.
  • Heading — Markdown: a heading line.
  • Emphasis
  • Strong
  • Link
  • Quote

Trait implementations: Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, StructuralPartialEq

enumaster_blueprint::ui::deco::lex::Lang

pub enum Lang { Js, Ts, Sh, Ps, Cs, Rust, Json, Md, C, Java, Go, Py, Toml, Plain, Generic }

The languages (aliases resolved).

Methods

  • fn parse(name: &str) -> Lang

Variants

  • Js
  • Ts
  • Sh
  • Ps
  • Cs
  • Rust
  • Json
  • Md
  • C
  • Java
  • Go
  • Py
  • Toml
  • Plain
  • Generic

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::deco::paint::CPaint

pub enum CPaint { Solid, Grad }

Methods

  • fn compile(f: &Fill, th: &Theme) -> CPaint
  • fn mid(&self) -> [u8; 4] — The colour at the middle of the gradient (what a line in "the text colour" uses).

Variants

  • Solid
  • Grad

Trait implementations: Clone, Debug

enumaster_blueprint::ui::deco::paint::Kind

pub enum Kind { Lin, Rad }

Variants

  • Lin
  • Rad

Trait implementations: Clone, Debug

enumaster_blueprint::ui::deco::style::Color

pub enum Color { Role, Ui, Rgba, Mix, Shade, Alpha }

A theme-aware colour.

Methods

  • fn role(r: Role) -> Color
  • fn hex(rgb: u32) -> Color
  • fn mix(a: Color, b: Color, t: f32) -> Color
  • fn lighten(self, amount: f32) -> Color
  • fn alpha(self, a: f32) -> Color
  • fn parse(s: &str) -> Result<Color, String> — Parse accent, #rgb, #rrggbb, #rrggbbaa, with optional modifiers +20 (lighten 20 %), -20 (darken), /50 (alpha 50 %), and a~b / a~b@30 (mix of two, 50 % or 30 % of the way to b).
  • fn resolve(&self, th: &Theme) -> [u8; 4]

Variants

  • Role
  • Ui — Any element colour (a tint, a mix, an ink colour).
  • Rgba
  • Mix — a toward b by t (sRGB).
  • Shade — base lightened (> 0, toward white) or darkened (< 0, toward black) by amount (-1..=1).
  • Alpha — base with its alpha multiplied by a.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::deco::style::Fill

pub enum Fill { Solid, Linear, Radial }

A colour fill.

Methods

  • fn solid(c: Color) -> Fill
  • fn linear(colors: impl IntoIterator<Item = Color>, angle: f32, scope: Scope) -> Fill — An evenly spaced linear gradient across colors.
  • fn radial(colors: impl IntoIterator<Item = Color>, scope: Scope) -> Fill
  • fn scope(&self) -> Option<Scope>

Variants

  • Solid
  • Linear — Colour stops at 0..=1, angle in degrees (0 = left to right, 90 = top to bottom), over scope.
  • Radial — A radial gradient centred at at (0..=1 of the scope's box), reaching the farthest corner.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::deco::style::LineKind

pub enum LineKind { Solid, Dotted, Dashed, Wavy, Double }

Methods

  • fn parse(s: &str) -> Option<LineKind>

Variants

  • Solid
  • Dotted
  • Dashed
  • Wavy — The error squiggle.
  • Double

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::deco::style::Mode

pub enum Mode { Dark, Light }

Which theme mode a rule is for.

Methods

  • fn of(th: &Theme) -> Mode

Variants

  • Dark
  • Light

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::deco::style::RevealMode

pub enum RevealMode { Typewriter, Fade, Rise, Wave, Cascade, Blur, Scale }

Methods

  • fn parse(s: &str) -> Option<RevealMode>
  • const ALL: [(RevealMode, &'static str); 7]

Variants

  • Typewriter — One glyph after another, hard; the caret leads.
  • Fade
  • Rise — Glyphs rise into place while they fade in.
  • Wave — A diagonal wave of glyphs rising with a little overshoot.
  • Cascade — Line by line, each line's glyphs left to right.
  • Blur — Glyphs come out of a blur.
  • Scale — Glyphs grow from 60 % with a small overshoot.

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::deco::style::Scope

pub enum Scope { Token, Line, Block }

How far a gradient reaches: one token, one line, or the whole block.

Methods

  • fn parse(s: &str) -> Option<Scope>

Variants

  • Token
  • Line
  • Block

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::deco::style::Sel

pub enum Sel { All, Class, Chars, Bytes, Lines, Text, Cols }

Which text a rule applies to. Ranges are in characters of the whole source unless said otherwise; lines count from 0.

Variants

  • All
  • Class
  • Chars
  • Bytes
  • Lines — Lines a..b (0-based, end exclusive), the whole of each.
  • Text — Every occurrence of this text.
  • Cols — One line's characters a..b ((line, a..b)).

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fluidfx::FluidPointer

pub enum FluidPointer { Drag, Hover, Off }

How an interactive fluid reads the pointer.

Variants

  • Drag — Stir while the button is held (press and drag).
  • Hover — Stir whenever the pointer moves over it.
  • Off — Ignore the pointer.

Trait implementations: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::focus::Dir

pub enum Dir { Up, Down, Left, Right }

A direction of travel.

Methods

  • fn opposite(self) -> Dir — The other way.
  • fn mirrored(self) -> Dir — The same line seen in a mirror: left and right swap, up and down stay.
  • fn key(self) -> Key — The arrow key that drives this direction.
  • fn of(key: Key) -> Option<Dir> — The direction of an arrow key.

Variants

  • Up — Towards the top of the screen.
  • Down — Towards the bottom of the screen.
  • Left — Towards the left of the screen.
  • Right — Towards the right of the screen.

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::focus::Pad

pub enum Pad { DpadUp, DpadDown, DpadLeft, DpadRight, A, B, X, Y, LB, RB, Start, Select }

A gamepad or remote button.

Methods

  • fn dir(self) -> Option<Dir> — The direction a D-pad button drives (None for the other buttons).

Variants

  • DpadUp — The D-pad up.
  • DpadDown — The D-pad down.
  • DpadLeft — The D-pad left.
  • DpadRight — The D-pad right.
  • A — The primary button (A on a game pad, OK on a remote): activate.
  • B — The secondary button (B, Back): go back, close a dialog.
  • X — A side button (X on a game pad).
  • Y — Another side button (Y on a game pad).
  • LB — The left shoulder: the previous focus group.
  • RB — The right shoulder: the next focus group.
  • Start — The start button.
  • Select — The select button.

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::Backdrop3d

pub enum Backdrop3d { Transparent, Solid, Gradient }

What is behind the scene.

Variants

  • Transparent — Nothing: the picture composites over the UI.
  • Solid
  • Gradient

Trait implementations: Clone, Debug

enumaster_blueprint::ui::fx::Cache

pub enum Cache { Keep, Recent, Never }

How a layer's picture is cached across frames.

Variants

  • Keep — Keep many (static pictures keyed by their parameters).
  • Recent — Keep only a few recent ones (a new picture every frame: animated gradients).
  • Never — Do not cache (the layer builds a cheap recording itself).

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::Emitter

pub enum Emitter { Point, Line, Rect, Ring, Fill }

Where particles are born. Fractions are of the element box.

Variants

  • Point — One spot (0.5, 0.5 is the centre).
  • Line — Anywhere along a segment.
  • Rect — Anywhere inside [x, y, w, h].
  • Ring — On a circle: centre fractions and radius in px.
  • Fill — Anywhere in the box.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::Glyphs

pub enum Glyphs { Alnum, Symbols, Binary, Blocks, Custom }

Where scramble glyphs come from.

Variants

  • Alnum — A-Z0-9.
  • Symbols — #%&*+=?/<>-style punctuation.
  • Binary
  • Blocks — Block elements and shades.
  • Custom

Trait implementations: Clone, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::Made

pub enum Made { Pix, Rec }

What a layer produces: a picture, or a ready recording (sprite fields).

Variants

  • Pix
  • Rec

enumaster_blueprint::ui::fx::Pattern3d

pub enum Pattern3d { None, Checker, Grid }

Surface pattern in world x/z, filtered so it does not shimmer.

Variants

  • None
  • Checker
  • Grid

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::Quality3d

pub enum Quality3d { Draft, Normal, High }

Render quality: supersampling, shadow resolution, fog steps.

Variants

  • Draft — 1x1 samples: fast previews.
  • Normal — 3x3 samples.
  • High — 4x4 samples, bigger shadow map.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::Reveal

pub enum Reveal { LeftToRight, RightToLeft, Random }

The order glyphs settle in.

Variants

  • LeftToRight
  • RightToLeft
  • Random — A seeded shuffle.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::Slot

pub enum Slot { Under, Over, Replace }

Where a layer paints relative to the element's own fill and children.

Variants

  • Under — Before the fill (backgrounds: gradients, glass).
  • Over — After the element's own fill, border and shapes, below its children (sheen, borders).
  • Replace — Replaces the element's fill, border, shapes and children with the picture (tilt).

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::distort::BlockOp

pub enum BlockOp { Shift, Invert, Swap, Tint }

What happens to a pixel inside a corrupted block of a glitch.

Variants

  • Shift — Only the displacement.
  • Invert
  • Swap — Channels rotated (r, g, b -> g, b, r).
  • Tint — Washed toward a colour (0..=1 channels).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::distort::Edge

pub enum Edge { Clamp, Clear }

What lies beyond the picture.

Variants

  • Clamp — Repeat the border pixels (a full-screen picture).
  • Clear — Transparent (an element's own picture).

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::distort::WarpKind

pub enum WarpKind { Element, Overlay }

What a warp belongs to: the element's own picture, or the screen painted below an overlay.

Variants

  • Element — The element's own picture: the warp sits inside the element's box.
  • Overlay — The screen painted below an overlay: the warp covers the overlay's box.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::Curve

pub enum Curve { Linear, Smooth, In, Out, InOut, Bezier, Steps }

The shape of one segment between two stops (applied after the midpoint).

Methods

  • fn apply(self, u: f64) -> f64

Variants

  • Linear
  • Smooth — Smoothstep: flat at both stops.
  • In — Slow start (quadratic).
  • Out — Slow end.
  • InOut — Slow start and end (cubic).
  • Bezier — CSS cubic-bezier(x1, y1, x2, y2).
  • Steps — n hard steps.

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::Dither

pub enum Dither { None, Ign, Blue }

How a gradient is quantised to 8 bits.

Variants

  • None — Plain rounding (bands on slow ramps; for comparisons and pixel-exact tests).
  • Ign — Interleaved gradient noise.
  • Blue — A 64x64 blue-noise tile. The default.

Trait implementations: Clone, Copy, Debug, Default, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::FreeBlend

pub enum FreeBlend { Shepard, Rbf }

How the pinned colours blend.

Variants

  • Shepard — Shepard weights (spread / distance)^power: each colour holds near its point and flattens there (power 2-4; higher = more distinct pools). The default (power 2.6).
  • Rbf — Gaussian radial basis functions solved to pass through every point exactly; smoother and more liquid between points, may overshoot (gamut mapped).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::Geom

pub enum Geom { Linear, Radial, Conic, Diamond, Square, Spiral, Burst, Path }

The shape of a t field.

Variants

  • Linear — Straight bands at angle degrees (0 = left to right, 90 = top to bottom). The ramp runs corner to corner along that direction (CSS linear-gradient sizing).
  • Radial — Circles or ellipses about center; radius is [rx, ry] as fractions of the box width and height (CSS farthest-corner when None). focal puts t = 0 off centre (a light source seen at an angle; SVG fx/fy).
  • Conic — An angular sweep about center starting at angle degrees (clockwise). seam degrees before the start the last colour blends back into the first, so an open ramp has no edge.
  • Diamond — |dx| + |dy|: a diamond, size = 1 reaches the middle of each side.
  • Square — max(|dx|, |dy|): nested boxes the shape of the element.
  • Spiral — An Archimedean spiral: arms turns of the ramp per revolution, twist ramps from centre to the box's half-size.
  • Burst — Distance in from the element's rounded edge over depth logical px (Photoshop's "shape burst"): t = 0 on the edge, 1 at depth inside.
  • Path — Along a path (pts box fractions; cubic Bézier chains p0, c1, c2, p1, .. with curved): t from the arc length of the nearest point on it or the distance to it (see PathMap). closed joins the end back to the start.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::GradToken

pub enum GradToken { Hero, Backdrop, Accent, Aurora, Sunset, Glass, Metal, Holo }

The art-directed gradients every theme can derive from its accent and background.

Methods

  • const ALL: [GradToken; 8]

Variants

  • Hero — A lush mesh for hero sections.
  • Backdrop — A quiet radial glow behind a page.
  • Accent — Accent to secondary, for buttons and highlights.
  • Aurora — Northern lights in the theme's hues.
  • Sunset — A warm horizon derived from the accent's neighbours.
  • Glass — A translucent sheen for glass panels.
  • Metal — Liquid chrome tinted by the accent.
  • Holo — Holographic foil.

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::HuePath

pub enum HuePath { Shorter, Longer, Increasing, Decreasing }

How a hue travels between two stops in OKLCH (CSS Color 4 <hue-interpolation-method>).

Methods

  • fn unwrap(self, a: f64, b: f64) -> f64 — b unwrapped relative to a so that a plain lerp from a takes this path.

Variants

  • Shorter — The short way round (at most 180°). The default.
  • Longer — The long way round (a rainbow between two neighbours).
  • Increasing — Always counter-clockwise on the hue wheel (hue grows).
  • Decreasing — Always clockwise (hue shrinks).

Trait implementations: Clone, Copy, Debug, Default, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::MeshColor

pub enum MeshColor { Bilinear, Bicubic }

How colour fills a patch.

Variants

  • Bilinear — Bilinear between the four corners (PDF type 6): soft creases along the seams.
  • Bicubic — Bicubic with derivatives shared across seams: smooth everywhere. The default.

Trait implementations: Clone, Copy, Debug, Default, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::PathMap

pub enum PathMap { Along, Distance }

How a path drives t.

Variants

  • Along — The arc length of the nearest point: 0 at the start of the path, 1 at its end (a closed path comes back round to 0, so a looped ramp has no seam there).
  • Distance — The distance to the path: 0 on it, 1 at this many logical px.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::Source

pub enum Source { Field, Mesh, Freeform, Lush, Proc, Named }

What a gradient is made of.

Variants

  • Field — A t field through the ramp.
  • Mesh
  • Freeform
  • Lush — A generated mesh: colours and a seed.
  • Proc
  • Named — A gradient of the theme's palette (see [GradToken]).

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::Space

pub enum Space { Srgb, Linear, Oklab, Oklch }

The space a gradient's colours are mixed in.

Methods

  • fn from_lin(self, c: [f64; 3]) -> [f64; 3] — A linear-light colour to this space's coordinates.
  • fn to_oklab(self, c: [f64; 3]) -> [f64; 3] — This space's coordinates to OKLab (gamut mapping happens there).
  • fn to_lin(self, c: [f64; 3]) -> [f64; 3] — This space's coordinates to in-gamut linear light.

Variants

  • Srgb — Gamma-encoded sRGB (what CSS 2 and most toolkits do): muddy, dark mid-points.
  • Linear — Linear light: physically additive, light mid-points, desaturated mixes.
  • Oklab — OKLab: perceptually even lightness and clean mid-points. The default.
  • Oklch — OKLCH (polar OKLab): keeps chroma along the way, hue travels by the given path.

Trait implementations: Clone, Copy, Debug, Default, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::Spread

pub enum Spread { Pad, Repeat, Reflect }

What happens past the ends of the ramp.

Methods

  • fn apply(self, t: f32) -> f32

Variants

  • Pad — Hold the end colours.
  • Repeat — Start again (fract).
  • Reflect — Go back and forth (no hard edge at the repeat).

Trait implementations: Clone, Copy, Debug, Default, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::TextMotion

pub enum TextMotion { Shimmer, Sweep, Wave }

How the colours of a gradient text move, glyph by glyph. The ramp runs across the ink of the text, left to right; period is seconds per cycle.

Methods

  • fn shimmer() -> TextMotion
  • fn sweep() -> TextMotion
  • fn wave() -> TextMotion

Variants

  • Shimmer — A soft highlight sweeps across the text, reaching each glyph a little after the one before (band: its width as a fraction of the text; strength: 0..=1), then rests for the last third of the period.
  • Sweep — The ramp travels through the text: every glyph takes the colour at its centre, so the colours step from letter to letter (use a looped ramp).
  • Wave — Each glyph's colour swings along the ramp by amount, a wave running through the word.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::color::HuePath

pub enum HuePath { Shorter, Longer, Increasing, Decreasing }

How a hue travels between two stops in OKLCH (CSS Color 4 <hue-interpolation-method>).

Methods

  • fn unwrap(self, a: f64, b: f64) -> f64 — b unwrapped relative to a so that a plain lerp from a takes this path.

Variants

  • Shorter — The short way round (at most 180°). The default.
  • Longer — The long way round (a rainbow between two neighbours).
  • Increasing — Always counter-clockwise on the hue wheel (hue grows).
  • Decreasing — Always clockwise (hue shrinks).

Trait implementations: Clone, Copy, Debug, Default, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::color::Space

pub enum Space { Srgb, Linear, Oklab, Oklch }

The space a gradient's colours are mixed in.

Methods

  • fn from_lin(self, c: [f64; 3]) -> [f64; 3] — A linear-light colour to this space's coordinates.
  • fn to_oklab(self, c: [f64; 3]) -> [f64; 3] — This space's coordinates to OKLab (gamut mapping happens there).
  • fn to_lin(self, c: [f64; 3]) -> [f64; 3] — This space's coordinates to in-gamut linear light.

Variants

  • Srgb — Gamma-encoded sRGB (what CSS 2 and most toolkits do): muddy, dark mid-points.
  • Linear — Linear light: physically additive, light mid-points, desaturated mixes.
  • Oklab — OKLab: perceptually even lightness and clean mid-points. The default.
  • Oklch — OKLCH (polar OKLab): keeps chroma along the way, hue travels by the given path.

Trait implementations: Clone, Copy, Debug, Default, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::dither::Dither

pub enum Dither { None, Ign, Blue }

How a gradient is quantised to 8 bits.

Variants

  • None — Plain rounding (bands on slow ramps; for comparisons and pixel-exact tests).
  • Ign — Interleaved gradient noise.
  • Blue — A 64x64 blue-noise tile. The default.

Trait implementations: Clone, Copy, Debug, Default, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::freeform::Blend

pub enum Blend { Shepard, Rbf }

How the pinned colours blend.

Variants

  • Shepard — Shepard weights (spread / distance)^power: each colour holds near its point and flattens there (power 2-4; higher = more distinct pools). The default (power 2.6).
  • Rbf — Gaussian radial basis functions solved to pass through every point exactly; smoother and more liquid between points, may overshoot (gamut mapped).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::geom::Geom

pub enum Geom { Linear, Radial, Conic, Diamond, Square, Spiral, Burst, Path }

The shape of a t field.

Variants

  • Linear — Straight bands at angle degrees (0 = left to right, 90 = top to bottom). The ramp runs corner to corner along that direction (CSS linear-gradient sizing).
  • Radial — Circles or ellipses about center; radius is [rx, ry] as fractions of the box width and height (CSS farthest-corner when None). focal puts t = 0 off centre (a light source seen at an angle; SVG fx/fy).
  • Conic — An angular sweep about center starting at angle degrees (clockwise). seam degrees before the start the last colour blends back into the first, so an open ramp has no edge.
  • Diamond — |dx| + |dy|: a diamond, size = 1 reaches the middle of each side.
  • Square — max(|dx|, |dy|): nested boxes the shape of the element.
  • Spiral — An Archimedean spiral: arms turns of the ramp per revolution, twist ramps from centre to the box's half-size.
  • Burst — Distance in from the element's rounded edge over depth logical px (Photoshop's "shape burst"): t = 0 on the edge, 1 at depth inside.
  • Path — Along a path (pts box fractions; cubic Bézier chains p0, c1, c2, p1, .. with curved): t from the arc length of the nearest point on it or the distance to it (see PathMap). closed joins the end back to the start.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::geom::Spread

pub enum Spread { Pad, Repeat, Reflect }

What happens past the ends of the ramp.

Methods

  • fn apply(self, t: f32) -> f32

Variants

  • Pad — Hold the end colours.
  • Repeat — Start again (fract).
  • Reflect — Go back and forth (no hard edge at the repeat).

Trait implementations: Clone, Copy, Debug, Default, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::mesh::MeshColor

pub enum MeshColor { Bilinear, Bicubic }

How colour fills a patch.

Variants

  • Bilinear — Bilinear between the four corners (PDF type 6): soft creases along the seams.
  • Bicubic — Bicubic with derivatives shared across seams: smooth everywhere. The default.

Trait implementations: Clone, Copy, Debug, Default, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::path::PathMap

pub enum PathMap { Along, Distance }

How a path drives t.

Variants

  • Along — The arc length of the nearest point: 0 at the start of the path, 1 at its end (a closed path comes back round to 0, so a looped ramp has no seam there).
  • Distance — The distance to the path: 0 on it, 1 at this many logical px.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::procedural::Kind

pub enum Kind { Warp, Aurora, Silk, Metal, Iridescent }

Which procedural field.

Variants

  • Warp — Domain warp; strength ~ 4 is IQ's classic, 1 is a gentle flow.
  • Aurora — ribbons curtains (2-5).
  • Silk — Folds at angle degrees.
  • Metal
  • Iridescent — tint 0..=1: how much the ramp colours the film (0 = pure interference colours).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::gradient2::ramp::Curve

pub enum Curve { Linear, Smooth, In, Out, InOut, Bezier, Steps }

The shape of one segment between two stops (applied after the midpoint).

Methods

  • fn apply(self, u: f64) -> f64

Variants

  • Linear
  • Smooth — Smoothstep: flat at both stops.
  • In — Slow start (quadratic).
  • Out — Slow end.
  • InOut — Slow start and end (cubic).
  • Bezier — CSS cubic-bezier(x1, y1, x2, y2).
  • Steps — n hard steps.

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::kinetic::Glyphs

pub enum Glyphs { Alnum, Symbols, Binary, Blocks, Custom }

Where scramble glyphs come from.

Variants

  • Alnum — A-Z0-9.
  • Symbols — #%&*+=?/<>-style punctuation.
  • Binary
  • Blocks — Block elements and shades.
  • Custom

Trait implementations: Clone, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::kinetic::Mode

pub enum Mode { Decode, Typewriter, Stagger }

How the glyphs arrive.

Variants

  • Decode — Random glyphs flicker in every slot and settle into the real ones.
  • Typewriter — One glyph at a time, optionally with a blinking caret.
  • Stagger — Each glyph fades, slides and scales in on an overshooting spring.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::kinetic::Reveal

pub enum Reveal { LeftToRight, RightToLeft, Random }

The order glyphs settle in.

Variants

  • LeftToRight
  • RightToLeft
  • Random — A seeded shuffle.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::particles::Emitter

pub enum Emitter { Point, Line, Rect, Ring, Fill }

Where particles are born. Fractions are of the element box.

Variants

  • Point — One spot (0.5, 0.5 is the centre).
  • Line — Anywhere along a segment.
  • Rect — Anywhere inside [x, y, w, h].
  • Ring — On a circle: centre fractions and radius in px.
  • Fill — Anywhere in the box.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::particles::Shape

pub enum Shape { Dot, Flake }

Look of one particle.

Variants

  • Dot — Soft disc with a halo falloff (dust, embers, stars, sparks).
  • Flake — Hard-edged tumbling square (confetti): the width follows |cos| of a flip phase.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::post::Focus

pub enum Focus { Rect, Id, Z }

What stays sharp in a depth-of-field.

Variants

  • Rect — A rectangle [x, y, w, h] in logical screen px.
  • Id — The element with this .id() (its box of the previous frame).
  • Z — A depth z (the .depth(z) of the depth lane): elements at that depth are sharp, others blur with their distance in depth (Dof::range is then in depth units: the distance at which the blur is full). Needs the depth registry (see [report_depth]).

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::post::LutError

pub enum LutError { Utf8, NoSize, Size, Rows, Number }

Why a .cube file was refused.

Variants

  • Utf8
  • NoSize — No LUT_3D_SIZE (1D LUTs are not supported).
  • Size
  • Rows — Wrong number of rows.
  • Number

Trait implementations: Clone, Debug, Display, Eq, Error, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::post::PostLook

pub enum PostLook { TealOrange, Noir, WarmFilm, CoolNight, BleachBypass }

A built-in 3D LUT look (procedural, 33^3, display-referred).

Methods

  • const ALL: [Look; 5]
  • fn name(self) -> &'static str
  • fn lut(self) -> Arc<Lut3> — The look as a table (built once per thread).
  • fn map(self, c: [f32; 3]) -> [f32; 3] — The look as a function of display colour.
  • fn grade(self) -> Grade — The look as a [Grade] instead of a table: an approximation for when the pipeline should skip the 3D lookup.

Variants

  • TealOrange
  • Noir
  • WarmFilm
  • CoolNight
  • BleachBypass

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::post::PostTone

pub enum PostTone { None, Filmic, Aces, Hable, Reinhard }

The tone curve that maps scene light (which bloom and exposure can push above 1) to the display.

Methods

  • fn apply(self, x: f32) -> f32 — The curve on one linear channel, 0 at 0 and 1 at 1; values above 1 may exceed 1 (clipped by the caller).

Variants

  • None — Clip.
  • Filmic — Identity up to a knee at 0.85, then a shoulder that lands exactly on 1.0 at 1.0: mid-tones (and text contrast) are untouched, UI white stays white, brighter light clips. The default.
  • Aces — ACES (Narkowicz fit) with its pre-exposure, scaled so 1.0 stays 1.0: crushed toe, strong shoulder, the "film" look.
  • Hable — The Uncharted 2 filmic curve (a long toe and a soft shoulder), scaled so 1.0 stays 1.0.
  • Reinhard — x / (1 + x) scaled so 1.0 stays 1.0.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::post_color::Look

pub enum Look { TealOrange, Noir, WarmFilm, CoolNight, BleachBypass }

A built-in 3D LUT look (procedural, 33^3, display-referred).

Methods

  • const ALL: [Look; 5]
  • fn name(self) -> &'static str
  • fn lut(self) -> Arc<Lut3> — The look as a table (built once per thread).
  • fn map(self, c: [f32; 3]) -> [f32; 3] — The look as a function of display colour.
  • fn grade(self) -> Grade — The look as a [Grade] instead of a table: an approximation for when the pipeline should skip the 3D lookup.

Variants

  • TealOrange
  • Noir
  • WarmFilm
  • CoolNight
  • BleachBypass

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::post_color::LutError

pub enum LutError { Utf8, NoSize, Size, Rows, Number }

Why a .cube file was refused.

Variants

  • Utf8
  • NoSize — No LUT_3D_SIZE (1D LUTs are not supported).
  • Size
  • Rows — Wrong number of rows.
  • Number

Trait implementations: Clone, Debug, Display, Eq, Error, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::post_color::Tone

pub enum Tone { None, Filmic, Aces, Hable, Reinhard }

The tone curve that maps scene light (which bloom and exposure can push above 1) to the display.

Methods

  • fn apply(self, x: f32) -> f32 — The curve on one linear channel, 0 at 0 and 1 at 1; values above 1 may exceed 1 (clipped by the caller).

Variants

  • None — Clip.
  • Filmic — Identity up to a knee at 0.85, then a shoulder that lands exactly on 1.0 at 1.0: mid-tones (and text contrast) are untouched, UI white stays white, brighter light clips. The default.
  • Aces — ACES (Narkowicz fit) with its pre-exposure, scaled so 1.0 stays 1.0: crushed toe, strong shoulder, the "film" look.
  • Hable — The Uncharted 2 filmic curve (a long toe and a soft shoulder), scaled so 1.0 stays 1.0.
  • Reinhard — x / (1 + x) scaled so 1.0 stays 1.0.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::scene3d::Backdrop3d

pub enum Backdrop3d { Transparent, Solid, Gradient }

What is behind the scene.

Variants

  • Transparent — Nothing: the picture composites over the UI.
  • Solid
  • Gradient

Trait implementations: Clone, Debug

enumaster_blueprint::ui::fx::scene3d::Pattern3d

pub enum Pattern3d { None, Checker, Grid }

Surface pattern in world x/z, filtered so it does not shimmer.

Variants

  • None
  • Checker
  • Grid

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::scene3d::Quality3d

pub enum Quality3d { Draft, Normal, High }

Render quality: supersampling, shadow resolution, fog steps.

Variants

  • Draft — 1x1 samples: fast previews.
  • Normal — 3x3 samples.
  • High — 4x4 samples, bigger shadow map.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::fx::scene3d::render::Bg

pub enum Bg { Transparent, Solid, Gradient }

Variants

  • Transparent
  • Solid
  • Gradient

Trait implementations: Clone, Debug

enumaster_blueprint::ui::fx::scene3d::render::LKind

pub enum LKind { Dir, Point, Spot }

Variants

  • Dir — Unit direction toward the light.
  • Point
  • Spot

Trait implementations: Clone, Copy, Debug

enumaster_blueprint::ui::fx::scene3d::render::Pattern

pub enum Pattern { None, Checker, Grid }

Variants

  • None
  • Checker — Filtered checker on world x/z: scale is the cell size, contrast how far the dark cells go (0..1).
  • Grid — Thin lines on world x/z every scale.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::icons::Icon

pub enum Icon { Search, Settings, Home, User, Bell, Check, X, Plus, Minus, ChevronLeft, ChevronRight, ChevronUp, ChevronDown, ArrowLeft, ArrowRight, ArrowUp, ArrowDown, Menu, MoreHorizontal, MoreVertical, Edit, Trash, Copy, Download, Upload, Refresh, Filter, Sort, Calendar, Clock, Star, Heart, Info, Warning, CheckCircle, Error, Help, Lock, Unlock, Eye, EyeOff, Play, Pause, Stop, Folder, File, Image, Link, External, Mail, Chat, Phone, MapPin, Cloud, Wifi, Battery, Power, Cpu, Printer, Thermometer, Layers, Grid, List, Chart, LogOut, Sun, Moon, Send, Paperclip, Smile, AtSign, Hash, Bookmark, Tag, Share, Maximize, Minimize, Sidebar, Columns, Sliders, Terminal, Code, GitBranch, Package, Zap, Activity, TrendingUp, TrendingDown, Award, Shield, Key, UserPlus, Users, Globe, Save, Undo, Redo, ZoomIn, ZoomOut, Camera, Mic, Volume, VolumeOff, Database, Server, Cart, CreditCard, Flag }

A built-in icon. Icon::ALL lists them all; Icon::name() is the kebab-case name.

Methods

  • fn from_name(name: &str) -> Option<Icon> — Look an icon up by its kebab-case name; a few aliases work too (close, gear, logout, pin).
  • const ALL: &'static [Icon] — Every built-in icon, in declaration order.
  • fn name(self) -> &'static str — Kebab-case name ("chevron-left").
  • fn path_data(self) -> &'static str — SVG path data on the 24-unit grid.

Variants

  • Search
  • Settings
  • Home
  • User
  • Bell
  • Check
  • X
  • Plus
  • Minus
  • ChevronLeft
  • ChevronRight
  • ChevronUp
  • ChevronDown
  • ArrowLeft
  • ArrowRight
  • ArrowUp
  • ArrowDown
  • Menu
  • MoreHorizontal
  • MoreVertical
  • Edit
  • Trash
  • Copy
  • Download
  • Upload
  • Refresh
  • Filter
  • Sort
  • Calendar
  • Clock
  • Star
  • Heart
  • Info
  • Warning
  • CheckCircle
  • Error
  • Help
  • Lock
  • Unlock
  • Eye
  • EyeOff
  • Play
  • Pause
  • Stop
  • Folder
  • File
  • Image
  • Link
  • External
  • Mail
  • Chat
  • Phone
  • MapPin
  • Cloud
  • Wifi
  • Battery
  • Power
  • Cpu
  • Printer
  • Thermometer
  • Layers
  • Grid
  • List
  • Chart
  • LogOut
  • Sun
  • Moon
  • Send
  • Paperclip
  • Smile
  • AtSign
  • Hash
  • Bookmark
  • Tag
  • Share
  • Maximize
  • Minimize
  • Sidebar
  • Columns
  • Sliders
  • Terminal
  • Code
  • GitBranch
  • Package
  • Zap
  • Activity
  • TrendingUp
  • TrendingDown
  • Award
  • Shield
  • Key
  • UserPlus
  • Users
  • Globe
  • Save
  • Undo
  • Redo
  • ZoomIn
  • ZoomOut
  • Camera
  • Mic
  • Volume
  • VolumeOff
  • Database
  • Server
  • Cart
  • CreditCard
  • Flag

Trait implementations: Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, StructuralPartialEq

enumaster_blueprint::ui::image::ImageFit

pub enum ImageFit { Contain, Cover, Fill }

How a picture fills the box of its element.

Variants

  • Contain — The whole picture, scaled to fit inside the box and centred (bars where the shapes differ). The default.
  • Cover — Scaled until it covers the box, centred, the overflow cropped.
  • Fill — Stretched to the box, whatever its shape.

Trait implementations: Clone, Copy, Debug, Default, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::inputs::Weekday

pub enum Weekday { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday }

A day of the week (the first column of a [DatePicker]).

Variants

  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday

Trait implementations: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::kine::Impulse

pub enum Impulse { Radial, Segment, Body }

One shove.

Variants

  • Radial — Away from at: momentum j at the point, falling off as (1 - d / radius)^2 out to radius px.
  • Segment — Along a -> b for every body near the segment: momentum j, falling off over width px from the segment.
  • Body — A direct hit on the body id: momentum j applied at the world point at (its centre if None), so an off-centre hit spins it.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::kine::JointKind

pub enum JointKind { Hinge, Spring, Distance, Rope, Slider }

How two things are tied together.

Variants

  • Hinge — A pin: the two anchor points are held together; both bodies may swing about it.
  • Spring — A spring between the anchors: rest length, natural frequency squared (s^-2, per reduced mass), damping ratio.
  • Distance — A rigid rod: the anchors stay len apart.
  • Rope — A rope: the anchors may come closer but never farther than max_len.
  • Slider — A slider rail: B's anchor moves along axis (a unit vector in A's own frame) and only along it; min..=max bound how far from A's anchor (px along the axis; infinite = unbounded).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::kine::body::JointKind

pub enum JointKind { Hinge, Spring, Distance, Rope, Slider }

How two things are tied together.

Variants

  • Hinge — A pin: the two anchor points are held together; both bodies may swing about it.
  • Spring — A spring between the anchors: rest length, natural frequency squared (s^-2, per reduced mass), damping ratio.
  • Distance — A rigid rod: the anchors stay len apart.
  • Rope — A rope: the anchors may come closer but never farther than max_len.
  • Slider — A slider rail: B's anchor moves along axis (a unit vector in A's own frame) and only along it; min..=max bound how far from A's anchor (px along the axis; infinite = unbounded).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::kine::effect::Origin

pub enum Origin { Pointer, Centre }

Where an emission starts.

Variants

  • Pointer — Where the pointer was when it fired.
  • Centre — The centre of the element that carries the emitter (its home, when it is a body).

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::kine::field::Falloff

pub enum Falloff { Flat, Linear, Smooth, Gauss, Inverse, Inverse2 }

How a push or pull weakens with distance d (px), given the field's radius (px).

Methods

  • fn at(self, d: f64, radius: f64) -> f64 — The weight 0..=1 at distance d for a field of radius.

Variants

  • Flat — Full strength everywhere inside the radius, nothing outside.
  • Linear — Straight line from 1 at the centre to 0 at the radius.
  • Smooth — A smooth bell from 1 at the centre to 0 at the radius.
  • Gauss — A gaussian: about 0.14 at the radius.
  • Inverse — 1 / (1 + d/radius): a long tail, cut to 0 at 4 radii.
  • Inverse2 — 1 / (1 + (d/radius)²): gravity-like, cut to 0 at 4 radii.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::kine::push::Impulse

pub enum Impulse { Radial, Segment, Body }

One shove.

Variants

  • Radial — Away from at: momentum j at the point, falling off as (1 - d / radius)^2 out to radius px.
  • Segment — Along a -> b for every body near the segment: momentum j, falling off over width px from the segment.
  • Body — A direct hit on the body id: momentum j applied at the world point at (its centre if None), so an off-centre hit spins it.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::kine::shatter::ShatterPattern

pub enum ShatterPattern { Voronoi, Triangles, Radial }

How the picture is cut.

Variants

  • Voronoi — About n Voronoi cells.
  • Triangles — About n triangles.
  • Radial — Cracks radiating from the impact point: rings and spokes.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::kine::solve::End

pub enum End { Body, Pt }

One end of a constraint.

Variants

  • Body
  • Pt — A fixed point in the world.

Trait implementations: Clone, Copy, Debug

enumaster_blueprint::ui::kine::solve::LinkKind

pub enum LinkKind { Pin, Distance, Rope, Plane, Limit }

Variants

  • Pin
  • Distance
  • Rope
  • Plane — The anchors stay on a line: the component of b - a along n (given in A's frame) is held at 0 (a slider rail).
  • Limit — The component of b - a along dir (A's frame) stays within lo..=hi (the stops of a rail).

Trait implementations: Clone, Copy, Debug

enumaster_blueprint::ui::kine::swarm::Kind

pub enum Kind { Confetti, Spark, Dust, Snow, Sand, Droplet }

What a particle is.

Variants

  • Confetti
  • Spark
  • Dust
  • Snow
  • Sand
  • Droplet

Trait implementations: Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, StructuralPartialEq

enumaster_blueprint::ui::kine::swarm::Source

pub enum Source { Top, Point, Fountain, Area }

Where a shower comes from.

Variants

  • Top — Across the whole top edge, falling.
  • Point — A burst from one point (radial, within dir).
  • Fountain — A steady jet from one point.
  • Area — Born inside a rectangle [x, y, w, h], nearly at rest (snow that begins in mid-air).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::live::Place

pub enum Place { Center, Below, Above, BottomRight, BottomEnd, TopEnd, TopStart, BottomStart, TopCenter, BottomCenter, Start, End, Bottom }

Where a floating [Layer] sits.

Variants

  • Center — Centred in the screen (dialogs).
  • Below — Under the anchor element, start edges aligned (menus; the left edges, or the right ones in a right-to-left app).
  • Above — Above the anchor element (tooltips).
  • BottomRight — Bottom-right corner of the screen (toasts; the bottom-left one in a right-to-left app): the physical name of [Place::BottomEnd], which is the same place.
  • BottomEnd — Bottom end corner of the screen (toasts): bottom-right, bottom-left in a right-to-left app.
  • TopEnd — Top end corner of the screen (toasts): top-right, top-left in a right-to-left app.
  • TopStart — Top start corner of the screen (toasts): top-left, top-right in a right-to-left app.
  • BottomStart — Bottom start corner of the screen (toasts): bottom-left, bottom-right in a right-to-left app.
  • TopCenter — Top edge, centred horizontally (toasts, banners).
  • BottomCenter — Bottom edge, centred horizontally (toasts, snackbars).
  • Start — Start screen edge, full height (a drawer): the left edge, the right one in a right-to-left app.
  • End — End screen edge, full height (a drawer): the right edge, the left one in a right-to-left app.
  • Bottom — Bottom screen edge, full width (a bottom sheet).

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::live::Skin

pub enum Skin { Fill, Ring, None }

How an interactive element shows hover / pressed / focus / disabled.

Variants

  • Fill — Fill follows the theme state layers; focus draws the ring (default).
  • Ring — Only the focus ring.
  • None — The element draws its own states.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::motion::Prop

pub enum Prop { Opacity, Offset, Scale, Fill, Number }

An animatable property.

Variants

  • Opacity — .opacity(a): alpha of the element and its subtree (0..=1).
  • Offset — .translate(x, y): visual offset in px, applied after layout.
  • Scale — .scale(k): visual scale about the element's centre, applied after layout.
  • Fill — .fill(c): solid fill colour.
  • Number — [text_number] value.

Trait implementations: Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, StructuralPartialEq

enumaster_blueprint::ui::motion::Val

pub enum Val { Num, Pair, Col }

A property value, used by [El::enter].

Variants

  • Num
  • Pair
  • Col

Trait implementations: Clone, Copy, Debug, From<(f64, f64)>, From<Col>, From<Role>, From<f64>, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::A11yRule

pub enum A11yRule { Unlabelled, LowContrast, FocusOrder, SmallTarget, LowComponentContrast, UnknownBackdrop }

What a check looks for.

Methods

  • fn name(self) -> &'static str

Variants

  • Unlabelled — An interactive element without a label.
  • LowContrast — Text whose contrast is below the theme's threshold (3:1 for large text).
  • FocusOrder — Tab order moves backwards on screen (up, or left within a row).
  • SmallTarget — An interactive element smaller than 24x24 px.
  • LowComponentContrast — An interactive element whose fill and border both sit below 3:1 against what is behind it (WCAG 1.4.11): [UiTree::audit_non_text_contrast] reports it for every control, [UiTree::audit_a11y] for the input fields only (their boundary is what identifies them, see [FIELD_KINDS]).
  • UnknownBackdrop — The backdrop under a text is not fully known (a picture or another paint the audit cannot read): a warning, never an issue.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Action

pub enum Action { Set, Toggle, Add, Custom, Seq, Push, RemoveAt }

A typed state mutation.

Methods

  • fn emit(e: impl Into<Emission>) -> Action — Emit a field (and its visible part) at the pointer when the action runs. Needs [kine_fx()] in the root overlay. Action::emit(Shockwave::new(V2::ZERO)): the origin given is replaced by the pointer.
  • fn set(name: impl AsRef<str>, value: impl Into<Value>) -> Self
  • fn toggle(name: impl AsRef<str>) -> Self
  • fn inc(name: impl AsRef<str>, by: i64) -> Self
  • fn add(name: impl AsRef<str>, by: f64) -> Self
  • fn copy(text: impl AsRef<str>) -> Self — Put text on the app clipboard (the one App::set_clipboard plugs the host's into) and announce "Copied". The app moves it out of the reserved Text key ~copy once the action has run, so it works from a click, a key or a timer.
  • fn copy_key(key: impl AsRef<str>) -> Self — [Action::copy] of whatever Text key holds when the action runs.
  • fn paste_into(key: impl AsRef<str>) -> Self — Replace Text store key key with the clipboard's text (CRLF becomes LF; a text field's caret goes to the end of it) and announce "Pasted". An empty clipboard changes nothing and announces "Clipboard is empty"; a key that holds something other than Text is an action error.
  • fn custom(f: impl Fn(&mut Store) + 'static) -> Self
  • fn seq(actions: impl IntoIterator<Item = Action>) -> Self
  • fn push(name: impl AsRef<str>, value: impl Into<Value>) -> Self — Append a value to a list key: Action::push("log", "hello") (Store::with("log", Vec::<String>::new())).
  • fn push_with(name: impl AsRef<str>, f: impl Fn(&Store) -> Option<Value> + 'static) -> Self — Append a value computed from the store (a record built from the draft, a timestamp...); returning None appends nothing. Chain a Action::set(draft, "") in [Action::seq] to clear the input.
  • fn remove_at(name: impl AsRef<str>, index: usize) -> Self — Remove item index of a list key.
  • fn clear(name: impl AsRef<str>) -> Self — Empty a list key.
  • fn scroll_to_end(id: &str) -> Self — Re-stick a stick_to_bottom() scroll with .id(id) to the end (a "jump to latest" button, or after sending).
  • fn set_theme(name: &str) -> Self — Switch the app theme by name (\"paper-light\", a built-in or one registered with App::register_theme). The App applies it without rebuilding: store, focus and motion survive.
  • fn set_title(title: &str) -> Self — Set the window title (the reserved ~title store key). A native window follows it at runtime; headless it is only the key. An empty title restores the one the window was opened with.
  • fn toggle_theme(a: &str, b: &str) -> Self — Flip between two themes by name: Action::toggle_theme("mission-dark", "paper-light").
  • fn clamped(self, min: f64, max: f64) -> Self — Clamp the result of an [Action::inc]/[Action::add] to [min, max].
  • fn apply(&self, store: &mut Store) -> Result<(), String> — Apply to store; a missing key or type mismatch is an Err and leaves that step's value unchanged.

Variants

  • Set
  • Toggle
  • Add — Add to an int (by an int) or scalar (by int or scalar), optionally clamped.
  • Custom
  • Seq
  • Push — Append the value computed from the store to a list (None appends nothing).
  • RemoveAt — Remove item index of a list (out of range is a no-op).

Trait implementations: Clone, Debug

enumaster_blueprint::ui::prelude::Align

pub enum Align { Start, Center, End, Stretch, Baseline }

Variants

  • Start
  • Center
  • End
  • Stretch
  • Baseline

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Axis

pub enum Axis { Vertical, Horizontal }

The axis the items of a container flow along.

Variants

  • Vertical — The items stack downwards (a list, a grid).
  • Horizontal — The items run to the right (a shelf, a tab strip).

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Backdrop3d

pub enum Backdrop3d { Transparent, Solid, Gradient }

What is behind the scene.

Variants

  • Transparent — Nothing: the picture composites over the UI.
  • Solid
  • Gradient

Trait implementations: Clone, Debug

enumaster_blueprint::ui::prelude::BackdropKind

pub enum BackdropKind { Aurora, Mesh, Bokeh, Dusk, Grain, Topo, Grid, Starfield }

The kinds of generated backdrop.

Methods

  • fn name(self) -> &'static str — A short name for the preset ("aurora", "dusk"), for keys and for the gallery.
  • const ALL: [BackdropKind; 8] — Every preset, in gallery order.

Variants

  • Aurora — Soft flowing gradient bands (a northern sky).
  • Mesh — Multi-point gradient blobs (a mesh gradient).
  • Bokeh — Soft light circles with depth (out-of-focus lights).
  • Dusk — A dusk sky: a horizon, a low sun and a dark land.
  • Grain — A smooth gradient with dithering, so it has no bands.
  • Topo — Topographic contour lines over a shaded field.
  • Grid — A glowing grid (synthwave, tech).
  • Starfield — A starfield over a faint nebula.

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Col

pub enum Col { Role, Tint, Mix, Raw, Ink, MixFit, Edge }

A colour: a theme role (default), a translucent role, a mix of two roles, or a raw escape-hatch colour. Resolved against the active theme at render.

Methods

  • fn resolve(self, th: &Theme) -> Srgb8

Variants

  • Role
  • Tint
  • Mix
  • Raw
  • Ink — A role as text: nudged in lightness until it meets the theme's text contrast on every surface.
  • MixFit — mix(a, b, t) with t reduced until a's content colour stays readable on it (avatar gradients).
  • Edge — The boundary of an input: the border role strengthened to 3:1 against every surface ([Theme::edge]).

Trait implementations: Clone, Copy, Debug, From<Col>, From<Role>, From<Srgb8>, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Collapse

pub enum Collapse { Hide, Top, Bottom, Drawer }

What a sidebar becomes on Compact screens.

Variants

  • Hide — Dropped.
  • Top — A navigation strip above the main area (see [tab_bar]).
  • Bottom — A navigation strip below the main area.
  • Drawer — A bar with a menu button; while open the sidebar shows full-width under the bar (see [drawer]).

Trait implementations: Clone, Debug

enumaster_blueprint::ui::prelude::ColorSpace

pub enum ColorSpace { Srgb, Linear, Oklab, Oklch }

The space a gradient's colours are mixed in.

Methods

  • fn from_lin(self, c: [f64; 3]) -> [f64; 3] — A linear-light colour to this space's coordinates.
  • fn to_oklab(self, c: [f64; 3]) -> [f64; 3] — This space's coordinates to OKLab (gamut mapping happens there).
  • fn to_lin(self, c: [f64; 3]) -> [f64; 3] — This space's coordinates to in-gamut linear light.

Variants

  • Srgb — Gamma-encoded sRGB (what CSS 2 and most toolkits do): muddy, dark mid-points.
  • Linear — Linear light: physically additive, light mid-points, desaturated mixes.
  • Oklab — OKLab: perceptually even lightness and clean mid-points. The default.
  • Oklch — OKLCH (polar OKLab): keeps chroma along the way, hue travels by the given path.

Trait implementations: Clone, Copy, Debug, Default, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Cond

pub enum Cond { Is, AtLeast, AtMost }

Which size classes a .when(..) applies to. Size alone means exactly that class.

Methods

  • fn matches(self, s: Size) -> bool

Variants

  • Is
  • AtLeast
  • AtMost

Trait implementations: Clone, Copy, Debug, Eq, From<Size>, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Device

pub enum Device { Handheld240, Strip320, Watch320, PhoneNotch, PhoneTall, PhoneLandscape, FoldFolded, FoldUnfolded, TabletIpad, Laptop1366, LaptopFhd, DesktopQhd, Monitor4k, UltraWide21, UltraWide32, SignagePortrait, Tv4k, Tv8k, Retroid }

A known surface. The presets are the awkward ones: tiny handhelds, notched phones, foldables, an ultra-wide, a portrait kiosk, a 10-foot TV.

Methods

  • const ALL: [Device; 19] — Every preset, in a stable order.
  • fn name(self) -> &'static str — A stable, lowercase name.
  • fn viewport(self) -> Viewport — The surface of this device.

Variants

  • Handheld240 — 240x160 handheld (a pocket console).
  • Strip320 — 320x240 watch-ish strip.
  • Watch320 — 320x320 watch.
  • PhoneNotch — A notched phone (logical 390x844 at 3x).
  • PhoneTall — A tall Android phone (logical 360x780 at 3x).
  • PhoneLandscape — The same phone sideways.
  • FoldFolded — A foldable, folded (the outer screen).
  • FoldUnfolded — A foldable, unfolded (the inner screen, with the crease).
  • TabletIpad — A 10.9" tablet (logical 1024x1366 at 2x).
  • Laptop1366 — A 1366x768 laptop panel.
  • LaptopFhd — A 1080p laptop panel at 1.25x.
  • DesktopQhd — A 1440p desktop panel at 1.5x.
  • Monitor4k — A 4K desktop monitor at 1x.
  • UltraWide21 — A 21:9 ultra-wide (3440x1440).
  • UltraWide32 — A 32:9 ultra-wide (5120x1440).
  • SignagePortrait — A 9:16 portrait kiosk (1080x1920).
  • Tv4k — A 4K TV seen from the couch.
  • Tv8k — An 8K TV seen from the couch.
  • Retroid — A 5.5" 1080p handheld console.

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Dir

pub enum Dir { Up, Down, Left, Right }

A direction of travel.

Methods

  • fn opposite(self) -> Dir — The other way.
  • fn mirrored(self) -> Dir — The same line seen in a mirror: left and right swap, up and down stay.
  • fn key(self) -> Key — The arrow key that drives this direction.
  • fn of(key: Key) -> Option<Dir> — The direction of an arrow key.

Variants

  • Up — Towards the top of the screen.
  • Down — Towards the bottom of the screen.
  • Left — Towards the left of the screen.
  • Right — Towards the right of the screen.

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Direction

pub enum Direction { Ltr, Rtl }

The reading direction of a subtree: left-to-right (the default) or right-to-left. A node inherits the direction of its parent unless it sets its own (see [Node::dir]).

In a right-to-left subtree the children of a container are placed from the right edge to the left, Start is the right edge and End the left one, the columns of a grid run right to left, a horizontal scroll starts at the right and the text of a line is aligned to the right when it is Start.

Methods

  • fn is_rtl(self) -> bool — Whether this is right-to-left.
  • fn flipped(self) -> Self — The other direction.

Variants

  • Ltr
  • Rtl

Trait implementations: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Distance

pub enum Distance { Handheld, Desk, Couch }

How far the user sits from the screen (the 10-foot UI is a different design).

Methods

  • fn label(self) -> &'static str — A stable, lowercase name.

Variants

  • Handheld — In the hand, 25-40 cm.
  • Desk — On a desk, 50-70 cm.
  • Couch — Across the room, 2-4 m (a TV).

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Dither

pub enum Dither { None, Ign, Blue }

How a gradient is quantised to 8 bits.

Variants

  • None — Plain rounding (bands on slow ramps; for comparisons and pixel-exact tests).
  • Ign — Interleaved gradient noise.
  • Blue — A 64x64 blue-noise tile. The default.

Trait implementations: Clone, Copy, Debug, Default, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Ease

pub enum Ease { Linear, Standard, Emphasized, Decelerate, Accelerate, Spring }

One of the theme easing curves.

Variants

  • Linear
  • Standard — 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::ui::prelude::Emitter

pub enum Emitter { Point, Line, Rect, Ring, Fill }

Where particles are born. Fractions are of the element box.

Variants

  • Point — One spot (0.5, 0.5 is the centre).
  • Line — Anywhere along a segment.
  • Rect — Anywhere inside [x, y, w, h].
  • Ring — On a circle: centre fractions and radius in px.
  • Fill — Anywhere in the box.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::EmptyState

pub enum EmptyState { Cards, Search, Sprout, Box }

The kinds of empty-state illustration.

Methods

  • fn name(self) -> &'static str — A short name for the illustration.
  • const ALL: [EmptyState; 4] — Every illustration, in gallery order.

Variants

  • Cards — A fan of cards: nothing has been added yet.
  • Search — A magnifier over a few dots: nothing was found.
  • Sprout — A sprout: nothing has grown here yet.
  • Box — An open box: the list is empty.

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::FluidPointer

pub enum FluidPointer { Drag, Hover, Off }

How an interactive fluid reads the pointer.

Variants

  • Drag — Stir while the button is held (press and drag).
  • Hover — Stir whenever the pointer moves over it.
  • Off — Ignore the pointer.

Trait implementations: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::FreeBlend

pub enum FreeBlend { Shepard, Rbf }

How the pinned colours blend.

Variants

  • Shepard — Shepard weights (spread / distance)^power: each colour holds near its point and flattens there (power 2-4; higher = more distinct pools). The default (power 2.6).
  • Rbf — Gaussian radial basis functions solved to pass through every point exactly; smoother and more liquid between points, may overshoot (gamut mapped).

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Glyphs

pub enum Glyphs { Alnum, Symbols, Binary, Blocks, Custom }

Where scramble glyphs come from.

Variants

  • Alnum — A-Z0-9.
  • Symbols — #%&*+=?/<>-style punctuation.
  • Binary
  • Blocks — Block elements and shades.
  • Custom

Trait implementations: Clone, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::GradToken

pub enum GradToken { Hero, Backdrop, Accent, Aurora, Sunset, Glass, Metal, Holo }

The art-directed gradients every theme can derive from its accent and background.

Methods

  • const ALL: [GradToken; 8]

Variants

  • Hero — A lush mesh for hero sections.
  • Backdrop — A quiet radial glow behind a page.
  • Accent — Accent to secondary, for buttons and highlights.
  • Aurora — Northern lights in the theme's hues.
  • Sunset — A warm horizon derived from the accent's neighbours.
  • Glass — A translucent sheen for glass panels.
  • Metal — Liquid chrome tinted by the accent.
  • Holo — Holographic foil.

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Height

pub enum Height { Short, Regular, Tall }

The height class of a logical height: short (a strip), regular (a screen), tall (a phone held up).

Methods

  • const ALL: [Height; 3] — Every height class, in index order (the store key ~height holds the index plus one).
  • fn from_index(i: i64) -> Option<Height> — The class at an index (None when the index is unknown or out of range).
  • fn classify(h: f64) -> Height — The class of a logical height.
  • fn label(self) -> &'static str — A stable, lowercase name.

Variants

  • Short — Under 480 logical px.
  • Regular — 480 to 900 logical px.
  • Tall — 900 logical px and over.

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::HuePath

pub enum HuePath { Shorter, Longer, Increasing, Decreasing }

How a hue travels between two stops in OKLCH (CSS Color 4 <hue-interpolation-method>).

Methods

  • fn unwrap(self, a: f64, b: f64) -> f64 — b unwrapped relative to a so that a plain lerp from a takes this path.

Variants

  • Shorter — The short way round (at most 180°). The default.
  • Longer — The long way round (a rainbow between two neighbours).
  • Increasing — Always counter-clockwise on the hue wheel (hue grows).
  • Decreasing — Always clockwise (hue shrinks).

Trait implementations: Clone, Copy, Debug, Default, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Icon

pub enum Icon { Search, Settings, Home, User, Bell, Check, X, Plus, Minus, ChevronLeft, ChevronRight, ChevronUp, ChevronDown, ArrowLeft, ArrowRight, ArrowUp, ArrowDown, Menu, MoreHorizontal, MoreVertical, Edit, Trash, Copy, Download, Upload, Refresh, Filter, Sort, Calendar, Clock, Star, Heart, Info, Warning, CheckCircle, Error, Help, Lock, Unlock, Eye, EyeOff, Play, Pause, Stop, Folder, File, Image, Link, External, Mail, Chat, Phone, MapPin, Cloud, Wifi, Battery, Power, Cpu, Printer, Thermometer, Layers, Grid, List, Chart, LogOut, Sun, Moon, Send, Paperclip, Smile, AtSign, Hash, Bookmark, Tag, Share, Maximize, Minimize, Sidebar, Columns, Sliders, Terminal, Code, GitBranch, Package, Zap, Activity, TrendingUp, TrendingDown, Award, Shield, Key, UserPlus, Users, Globe, Save, Undo, Redo, ZoomIn, ZoomOut, Camera, Mic, Volume, VolumeOff, Database, Server, Cart, CreditCard, Flag }

A built-in icon. Icon::ALL lists them all; Icon::name() is the kebab-case name.

Methods

  • fn from_name(name: &str) -> Option<Icon> — Look an icon up by its kebab-case name; a few aliases work too (close, gear, logout, pin).
  • const ALL: &'static [Icon] — Every built-in icon, in declaration order.
  • fn name(self) -> &'static str — Kebab-case name ("chevron-left").
  • fn path_data(self) -> &'static str — SVG path data on the 24-unit grid.

Variants

  • Search
  • Settings
  • Home
  • User
  • Bell
  • Check
  • X
  • Plus
  • Minus
  • ChevronLeft
  • ChevronRight
  • ChevronUp
  • ChevronDown
  • ArrowLeft
  • ArrowRight
  • ArrowUp
  • ArrowDown
  • Menu
  • MoreHorizontal
  • MoreVertical
  • Edit
  • Trash
  • Copy
  • Download
  • Upload
  • Refresh
  • Filter
  • Sort
  • Calendar
  • Clock
  • Star
  • Heart
  • Info
  • Warning
  • CheckCircle
  • Error
  • Help
  • Lock
  • Unlock
  • Eye
  • EyeOff
  • Play
  • Pause
  • Stop
  • Folder
  • File
  • Image
  • Link
  • External
  • Mail
  • Chat
  • Phone
  • MapPin
  • Cloud
  • Wifi
  • Battery
  • Power
  • Cpu
  • Printer
  • Thermometer
  • Layers
  • Grid
  • List
  • Chart
  • LogOut
  • Sun
  • Moon
  • Send
  • Paperclip
  • Smile
  • AtSign
  • Hash
  • Bookmark
  • Tag
  • Share
  • Maximize
  • Minimize
  • Sidebar
  • Columns
  • Sliders
  • Terminal
  • Code
  • GitBranch
  • Package
  • Zap
  • Activity
  • TrendingUp
  • TrendingDown
  • Award
  • Shield
  • Key
  • UserPlus
  • Users
  • Globe
  • Save
  • Undo
  • Redo
  • ZoomIn
  • ZoomOut
  • Camera
  • Mic
  • Volume
  • VolumeOff
  • Database
  • Server
  • Cart
  • CreditCard
  • Flag

Trait implementations: Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, StructuralPartialEq

enumaster_blueprint::ui::prelude::ImageFit

pub enum ImageFit { Contain, Cover, Fill }

How a picture fills the box of its element.

Variants

  • Contain — The whole picture, scaled to fit inside the box and centred (bars where the shapes differ). The default.
  • Cover — Scaled until it covers the box, centred, the overflow cropped.
  • Fill — Stretched to the box, whatever its shape.

Trait implementations: Clone, Copy, Debug, Default, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Ime

pub enum Ime { Start, Update, Commit, Cancel }

One IME composition event, as a platform input method delivers it.

Variants

  • Start — A composition begins over the current selection.
  • Update — The preedit string changed (shown underlined).
  • Commit — The composition ended with this final text.
  • Cancel — The composition was abandoned.

Trait implementations: Clone, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Input

pub enum Input { Key, Ime }

Input delivered to a focused element's [El::on_input] handler.

Variants

  • Key
  • Ime

Trait implementations: Clone, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Justify

pub enum Justify { Start, Center, End, SpaceBetween, SpaceAround, SpaceEvenly }

Variants

  • Start
  • Center
  • End
  • SpaceBetween
  • SpaceAround
  • SpaceEvenly

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Len

pub enum Len { Px, Dp, Pct, Vw, Vh, Vmin, Vmax, Em, Rem, Fr, Clamp, Min, Max }

A length with a unit, resolved at layout time against a [LenCtx] and the parent's content box (percentages). The f64 setters of [Node] mean [Len::Px].

Methods

  • fn clamp(min: Len, preferred: Len, max: Len) -> Len — CSS clamp(min, preferred, max): the preferred length held between the two bounds. Resolved at layout time, so the bounds may use any unit.
  • fn min(a: Len, b: Len) -> Len — The smaller of two lengths (resolved at layout time).
  • fn max(a: Len, b: Len) -> Len — The larger of two lengths (resolved at layout time).
  • fn is_px(&self) -> bool — Whether the length is plain logical pixels.
  • fn has_fr(&self) -> bool — Whether the length holds an fr (valid only in a grid track).
  • fn has_pct(&self) -> bool — Whether the length depends on the percentage basis.
  • fn resolve_opt(&self, basis: Option<f64>, ctx: &LenCtx) -> Option<f64> — The length in logical px, or None when it cannot be known: a percentage of an indefinite basis, or a viewport unit while the viewport is unknown (vw/vh = 0). basis is the percentage basis: the parent's content box on the axis the length is used on. A clamp whose bounds cross lets the minimum win, like CSS.
  • fn resolve(&self, basis: f64, ctx: &LenCtx) -> f64 — The length in logical px against a definite basis; an unknown length (see [Len::resolve_opt]) is 0.

Variants

  • Px — Logical pixels.
  • Dp — Device-independent pixels: 1 dp is 1 logical px in the logical solver.
  • Pct — Percent of the parent's content box on that axis.
  • Vw — Percent of the viewport width.
  • Vh — Percent of the viewport height.
  • Vmin — Percent of the smaller viewport side.
  • Vmax — Percent of the larger viewport side.
  • Em — Multiples of the context's em.
  • Rem — Multiples of the context's rem.
  • Fr — A share of the free space (grid tracks only).
  • Clamp — clamp(min, preferred, max).
  • Min — The smaller of two lengths.
  • Max — The larger of two lengths.

Trait implementations: Clone, Debug, From<f64>, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Look

pub enum Look { Button, Tonal, Ghost, Plain, Field, Surface, Glass, Badge, AppBar, Track, Raised }

How the theme's skin dresses a control.

Methods

  • fn role(&self) -> Option<Role> — The role this look is painted in.
  • fn is_face(&self) -> bool — True for a face the skin paints (a button, a field, a surface).

Variants

  • Button — A solid button in a role (the accent by default): a vertical gradient, a lit rim, a coloured halo, a soft contact shadow and the role's ink.
  • Tonal — A tonal button in a role: a soft tinted face, a hairline edge.
  • Ghost — A quiet button: no face until it is hovered.
  • Plain — The face the control's builder made: the skin dresses the control (a field's inset, a surface's lit top) but keeps the builder's own colours.
  • Field — An input: a debossed face with a hairline edge.
  • Surface — A raised surface (a card, a panel, a dialog): a lit top, a tight contact shadow and a wide ambient halo.
  • Glass — A glass surface over a rich background (frosted, translucent).
  • Badge — A badge or a pill: a soft tinted face with a hairline edge.
  • AppBar — The app bar: the page's header. It keeps its own gradient in the flat material, stands out of the page in the soft one and is frosted in the glass one.
  • Track — A groove the control sits in (a segmented track, a slider track, an off switch): a debossed face, no edge of its own.
  • Raised — A raised knob that sits in a groove (the selected segment, the switch knob): the page's own colour, lifted by the shadow pair.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::MeshColor

pub enum MeshColor { Bilinear, Bicubic }

How colour fills a patch.

Variants

  • Bilinear — Bilinear between the four corners (PDF type 6): soft creases along the seams.
  • Bicubic — Bicubic with derivatives shared across seams: smooth everywhere. The default.

Trait implementations: Clone, Copy, Debug, Default, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Mode

pub enum Mode { Light, Dark }

Light or dark appearance.

Variants

  • Light
  • Dark

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::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::ui::prelude::Orientation

pub enum Orientation { Portrait, Landscape, Square }

Which way the surface points.

Variants

  • Portrait
  • Landscape
  • Square

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Pad

pub enum Pad { DpadUp, DpadDown, DpadLeft, DpadRight, A, B, X, Y, LB, RB, Start, Select }

A gamepad or remote button.

Methods

  • fn dir(self) -> Option<Dir> — The direction a D-pad button drives (None for the other buttons).

Variants

  • DpadUp — The D-pad up.
  • DpadDown — The D-pad down.
  • DpadLeft — The D-pad left.
  • DpadRight — The D-pad right.
  • A — The primary button (A on a game pad, OK on a remote): activate.
  • B — The secondary button (B, Back): go back, close a dialog.
  • X — A side button (X on a game pad).
  • Y — Another side button (Y on a game pad).
  • LB — The left shoulder: the previous focus group.
  • RB — The right shoulder: the next focus group.
  • Start — The start button.
  • Select — The select button.

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::PageTransition

pub enum PageTransition { Push, ZoomThrough, FadeThrough, Dissolve, Hero }

A page transition: the cut that moves the frame and the motion that moves the page's elements.

Methods

  • fn cut(self) -> Option<Cut> — The cut that carries the frame (none for [PageTransition::Hero], which morphs instead).
  • fn motion(self) -> PageMotion — The motion the page's own elements make: where they come from.
  • fn ease(self) -> Ease — The curve the page's motion follows (the cut's own curve).

Variants

  • Push — The old page leaves with a parallax while the new one comes in.
  • ZoomThrough — The new page zooms up through the old one.
  • FadeThrough — A soft cross-fade with a touch of scale (the Material fade-through).
  • Dissolve — The old page breaks up and the new one resolves from it.
  • Hero — The shared element (hero) morphs between the two screens; the rest of the page changes at once.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::PathMap

pub enum PathMap { Along, Distance }

How a path drives t.

Variants

  • Along — The arc length of the nearest point: 0 at the start of the path, 1 at its end (a closed path comes back round to 0, so a looped ramp has no seam there).
  • Distance — The distance to the path: 0 on it, 1 at this many logical px.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Pattern3d

pub enum Pattern3d { None, Checker, Grid }

Surface pattern in world x/z, filtered so it does not shimmer.

Variants

  • None
  • Checker
  • Grid

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Place

pub enum Place { Center, Below, Above, BottomRight, BottomEnd, TopEnd, TopStart, BottomStart, TopCenter, BottomCenter, Start, End, Bottom }

Where a floating [Layer] sits.

Variants

  • Center — Centred in the screen (dialogs).
  • Below — Under the anchor element, start edges aligned (menus; the left edges, or the right ones in a right-to-left app).
  • Above — Above the anchor element (tooltips).
  • BottomRight — Bottom-right corner of the screen (toasts; the bottom-left one in a right-to-left app): the physical name of [Place::BottomEnd], which is the same place.
  • BottomEnd — Bottom end corner of the screen (toasts): bottom-right, bottom-left in a right-to-left app.
  • TopEnd — Top end corner of the screen (toasts): top-right, top-left in a right-to-left app.
  • TopStart — Top start corner of the screen (toasts): top-left, top-right in a right-to-left app.
  • BottomStart — Bottom start corner of the screen (toasts): bottom-left, bottom-right in a right-to-left app.
  • TopCenter — Top edge, centred horizontally (toasts, banners).
  • BottomCenter — Bottom edge, centred horizontally (toasts, snackbars).
  • Start — Start screen edge, full height (a drawer): the left edge, the right one in a right-to-left app.
  • End — End screen edge, full height (a drawer): the right edge, the left one in a right-to-left app.
  • Bottom — Bottom screen edge, full width (a bottom sheet).

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Pointer

pub enum Pointer { Mouse, Touch }

What the pointer is.

Variants

  • Mouse — A mouse or a trackpad: a drag past the slop lifts the item at once.
  • Touch — A finger: a long press lifts the item, a drag scrolls the list.

Trait implementations: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Prop

pub enum Prop { Opacity, Offset, Scale, Fill, Number }

An animatable property.

Variants

  • Opacity — .opacity(a): alpha of the element and its subtree (0..=1).
  • Offset — .translate(x, y): visual offset in px, applied after layout.
  • Scale — .scale(k): visual scale about the element's centre, applied after layout.
  • Fill — .fill(c): solid fill colour.
  • Number — [text_number] value.

Trait implementations: Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, StructuralPartialEq

enumaster_blueprint::ui::prelude::Quality3d

pub enum Quality3d { Draft, Normal, High }

Render quality: supersampling, shadow resolution, fog steps.

Variants

  • Draft — 1x1 samples: fast previews.
  • Normal — 3x3 samples.
  • High — 4x4 samples, bigger shadow map.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::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

  • None
  • Sm
  • Md
  • Lg
  • Xl
  • Full — 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::ui::prelude::Repeat

pub enum Repeat { AutoFill, AutoFit }

How a repeat() fills its tracks: AutoFill keeps the empty ones, AutoFit collapses them and lets the rest grow into the free space.

Variants

  • AutoFill
  • AutoFit

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Reveal

pub enum Reveal { LeftToRight, RightToLeft, Random }

The order glyphs settle in.

Variants

  • LeftToRight
  • RightToLeft
  • Random — A seeded shuffle.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::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

  • Background
  • Surface
  • SurfaceRaised
  • Border
  • Text
  • TextMuted
  • Accent
  • Success
  • Warning
  • Danger
  • Info
  • OnAccent
  • OnSuccess
  • OnWarning
  • OnDanger
  • OnInfo
  • Secondary
  • OnSecondary

Trait implementations: Clone, Copy, Debug, Eq, From<Role>, Hash, Ord, PartialEq, PartialOrd, RoleExt, StructuralPartialEq

enumaster_blueprint::ui::prelude::Say

pub enum Say { PickedUp, Position, Moved, Dropped, DroppedOn, Cancelled, Hint }

What the toolkit says about a reorder: the app turns it into words (a language).

Methods

  • fn english(&self) -> String — The English words (the default).

Variants

  • PickedUp — An item was lifted: its name, its place (1 based) and the number of items.
  • Position — The lifted item is over another place.
  • Moved — The item landed on a new place of its container.
  • Dropped — The item landed where it was.
  • DroppedOn — The item landed on another container: the container's name and the place (1 based).
  • Cancelled — The move was cancelled and the item went back.
  • Hint — How to move an item with the keyboard: the key that picks it up and drops it ("Space", or "Space or Enter" when the item has no click of its own).

Trait implementations: Clone, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::ShatterPattern

pub enum ShatterPattern { Voronoi, Triangles, Radial }

How the picture is cut.

Variants

  • Voronoi — About n Voronoi cells.
  • Triangles — About n triangles.
  • Radial — Cracks radiating from the impact point: rings and spokes.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Size

pub enum Size { Compact, Medium, Expanded, Large }

A width class. Boundaries come from the theme ([Responsive]).

Methods

  • fn up(self) -> Cond — This class or anything wider: .when(Size::Medium.up(), ..).
  • fn down(self) -> Cond — This class or anything narrower: .when(Size::Medium.down(), ..).
  • fn pick<T>(self, compact: T, medium: T, expanded: T, large: T) -> T — One value per class: grid(size.pick(1, 2, 3, 4), ..).

Variants

  • Compact — Phones: width < 600.
  • Medium — Tablets, small windows: < 1024.
  • Expanded — Laptops: < 1440.
  • Large — Desktops and wider.

Trait implementations: Clone, Copy, Debug, Eq, From<Size>, Hash, Ord, PartialEq, PartialOrd, StructuralPartialEq

enumaster_blueprint::ui::prelude::Skin

pub enum Skin { Fill, Ring, None }

How an interactive element shows hover / pressed / focus / disabled.

Variants

  • Fill — Fill follows the theme state layers; focus draws the ring (default).
  • Ring — Only the focus ring.
  • None — The element draws its own states.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Spread

pub enum Spread { Pad, Repeat, Reflect }

What happens past the ends of the ramp.

Methods

  • fn apply(self, t: f32) -> f32

Variants

  • Pad — Hold the end colours.
  • Repeat — Start again (fract).
  • Reflect — Go back and forth (no hard edge at the repeat).

Trait implementations: Clone, Copy, Debug, Default, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Spring

pub enum Spring { Snappy, Gentle, Bouncy }

The spring responses a [Transition] can follow.

Methods

  • fn response_ms(self) -> u32 — The response time in ms (how long the spring needs to travel).
  • fn damping(self) -> f64 — The damping ratio: 1 settles without overshoot, below 1 overshoots.
  • fn at(self, t: f64) -> f64 — The travel at t (0..=1 of the response): 0 at the start, 1 at the end, more than 1 while it overshoots. The curve is the closed-form solution of a damped oscillator, so it is the same every time (no simulation, no state).

Variants

  • Snappy — Quick, with a touch of overshoot (a card that arrives and settles).
  • Gentle — Slow and settled: it never overshoots.
  • Bouncy — A visible wobble: it overshoots and comes back.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::StopCurve

pub enum StopCurve { Linear, Smooth, In, Out, InOut, Bezier, Steps }

The shape of one segment between two stops (applied after the midpoint).

Methods

  • fn apply(self, u: f64) -> f64

Variants

  • Linear
  • Smooth — Smoothstep: flat at both stops.
  • In — Slow start (quadratic).
  • Out — Slow end.
  • InOut — Slow start and end (cubic).
  • Bezier — CSS cubic-bezier(x1, y1, x2, y2).
  • Steps — n hard steps.

Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::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::ui::prelude::TextAlign

pub enum TextAlign { Start, Center, End }

Horizontal alignment of each line of a multi-line text within its box.

Variants

  • Start
  • Center
  • End

Trait implementations: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::TextMotion

pub enum TextMotion { Shimmer, Sweep, Wave }

How the colours of a gradient text move, glyph by glyph. The ramp runs across the ink of the text, left to right; period is seconds per cycle.

Methods

  • fn shimmer() -> TextMotion
  • fn sweep() -> TextMotion
  • fn wave() -> TextMotion

Variants

  • Shimmer — A soft highlight sweeps across the text, reaching each glyph a little after the one before (band: its width as a fraction of the text; strength: 0..=1), then rests for the last third of the period.
  • Sweep — The ramp travels through the text: every glyph takes the colour at its centre, so the colours step from letter to letter (use a looped ramp).
  • Wave — Each glyph's colour swings along the ramp by amount, a wave running through the word.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Track

pub enum Track { Px, Fr, Auto, Minmax, Repeat }

A grid track: a fixed size, a share of the free space, a content size, a minmax(min, max) bound or a repeat(auto-fill | auto-fit, track) run.

Variants

  • Px
  • Fr
  • Auto
  • Minmax — minmax(min, max): at least min, at most max. A Fr max shares the free space; any other max is a hard limit.
  • Repeat — repeat(auto-fill | auto-fit, track): the track repeats as often as fits.

Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::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

  • Caption
  • Body
  • Label
  • Title
  • Headline
  • Display

Trait implementations: Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, StructuralPartialEq

enumaster_blueprint::ui::prelude::UiError

pub enum UiError { Layout, DuplicateId, Invalid, NativeFontsRequired, Render }

Every refusal says what was wrong and what to change.

Variants

  • Layout — A layout refusal (duplicate layout id, min > max, bad number...).
  • DuplicateId — Two elements carry the same .id(..).
  • Invalid — An element or component was given a value it cannot draw.
  • NativeFontsRequired — Text needs real shaping; the bundled fonts are only available with the feature.
  • Render — The renderer refused (capacity, vector limits, ...).

Trait implementations: Clone, Debug, Display, Error, From<Error>, From<LayoutError>, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Val

pub enum Val { Num, Pair, Col }

A property value, used by [El::enter].

Variants

  • Num
  • Pair
  • Col

Trait implementations: Clone, Copy, Debug, From<(f64, f64)>, From<Col>, From<Role>, From<f64>, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Value

pub enum Value { Bool, Int, Scalar, Text, Color, List, Record }

A typed app-state value.

Methods

  • fn field(&self, name: &str) -> Option<&Value> — Field name of a [Value::Record].
  • fn as_text(&self) -> &str — The text of a Text value ("" for anything else).
  • fn as_int(&self) -> i64 — The int of an Int value (0 for anything else).
  • fn text(&self, name: &str) -> &str — Text field name of a record, "" when missing.
  • fn int(&self, name: &str) -> i64 — Int field name of a record, 0 when missing.
  • fn to_literal(&self, ty: ValueType) -> Option<Literal> — The graph literal for a parameter of type ty, if representable.

Variants

  • Bool
  • Int
  • Scalar
  • Text
  • Color
  • List — An ordered list of values (a message log, rows): grow it with [Action::push] / [Store::push], shrink it with [Action::remove_at] / [Store::remove_at].
  • Record — A named-field record, usually a list item: build with [record], read with [Value::field].

Trait implementations: Clone, Debug, From<&str>, From<String>, From<Vec<&str>>, From<Vec<String>>, From<Vec<Value>>, From<[u8; 4]>, From<bool>, From<f64>, From<i32>, From<i64>, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::Weekday

pub enum Weekday { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday }

A day of the week (the first column of a [DatePicker]).

Variants

  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday

Trait implementations: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::WrapMode

pub enum WrapMode { Greedy, Balance, Pretty }

How the line breaker places the breaks.

Variants

  • Greedy — Greedy: every line takes as much as fits (the default).
  • Balance — Balance: keep the line count and narrow the lines to the narrowest width that still fits them (for headings and titles).
  • Pretty — Pretty: keep the line count and re-break the tail so the last line is not a short orphan.

Trait implementations: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::WrapRules

pub enum WrapRules { Ascii, Unicode }

Which break opportunities the line breaker may use.

Variants

  • Ascii — ASCII spaces only: the classic greedy wrap (the default).
  • Unicode — A pragmatic subset of UAX #14: after hyphens, en and em dashes, after the slashes of a URL or a path, at every CJK boundary (never before a closing punctuation), at a zero width space (U+200B) and at a soft hyphen (U+00AD, which shows a hyphen when the line breaks there). A no-break space (U+00A0) and a word joiner (U+2060) are non-breaks.

Trait implementations: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::particles::Emitter

pub enum Emitter { Point, Line, Rect, Ring, Fill }

Where particles are born. Fractions are of the element box.

Variants

  • Point — One spot (0.5, 0.5 is the centre).
  • Line — Anywhere along a segment.
  • Rect — Anywhere inside [x, y, w, h].
  • Ring — On a circle: centre fractions and radius in px.
  • Fill — Anywhere in the box.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::particles::Shape

pub enum Shape { Dot, Flake }

Look of one particle.

Variants

  • Dot — Soft disc with a halo falloff (dust, embers, stars, sparks).
  • Flake — Hard-edged tumbling square (confetti): the width follows |cos| of a flip phase.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::scene3d::Backdrop3d

pub enum Backdrop3d { Transparent, Solid, Gradient }

What is behind the scene.

Variants

  • Transparent — Nothing: the picture composites over the UI.
  • Solid
  • Gradient

Trait implementations: Clone, Debug

enumaster_blueprint::ui::prelude::scene3d::Pattern3d

pub enum Pattern3d { None, Checker, Grid }

Surface pattern in world x/z, filtered so it does not shimmer.

Variants

  • None
  • Checker
  • Grid

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::scene3d::Quality3d

pub enum Quality3d { Draft, Normal, High }

Render quality: supersampling, shadow resolution, fog steps.

Variants

  • Draft — 1x1 samples: fast previews.
  • Normal — 3x3 samples.
  • High — 4x4 samples, bigger shadow map.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::prelude::scene3d::render::Bg

pub enum Bg { Transparent, Solid, Gradient }

Variants

  • Transparent
  • Solid
  • Gradient

Trait implementations: Clone, Debug

enumaster_blueprint::ui::prelude::scene3d::render::LKind

pub enum LKind { Dir, Point, Spot }

Variants

  • Dir — Unit direction toward the light.
  • Point
  • Spot

Trait implementations: Clone, Copy, Debug

enumaster_blueprint::ui::prelude::scene3d::render::Pattern

pub enum Pattern { None, Checker, Grid }

Variants

  • None
  • Checker — Filtered checker on world x/z: scale is the cell size, contrast how far the dark cells go (0..1).
  • Grid — Thin lines on world x/z every scale.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::responsive::Collapse

pub enum Collapse { Hide, Top, Bottom, Drawer }

What a sidebar becomes on Compact screens.

Variants

  • Hide — Dropped.
  • Top — A navigation strip above the main area (see [tab_bar]).
  • Bottom — A navigation strip below the main area.
  • Drawer — A bar with a menu button; while open the sidebar shows full-width under the bar (see [drawer]).

Trait implementations: Clone, Debug

enumaster_blueprint::ui::responsive::Cond

pub enum Cond { Is, AtLeast, AtMost }

Which size classes a .when(..) applies to. Size alone means exactly that class.

Methods

  • fn matches(self, s: Size) -> bool

Variants

  • Is
  • AtLeast
  • AtMost

Trait implementations: Clone, Copy, Debug, Eq, From<Size>, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::responsive::Size

pub enum Size { Compact, Medium, Expanded, Large }

A width class. Boundaries come from the theme ([Responsive]).

Methods

  • fn up(self) -> Cond — This class or anything wider: .when(Size::Medium.up(), ..).
  • fn down(self) -> Cond — This class or anything narrower: .when(Size::Medium.down(), ..).
  • fn pick<T>(self, compact: T, medium: T, expanded: T, large: T) -> T — One value per class: grid(size.pick(1, 2, 3, 4), ..).

Variants

  • Compact — Phones: width < 600.
  • Medium — Tablets, small windows: < 1024.
  • Expanded — Laptops: < 1440.
  • Large — Desktops and wider.

Trait implementations: Clone, Copy, Debug, Eq, From<Size>, Hash, Ord, PartialEq, PartialOrd, StructuralPartialEq

enumaster_blueprint::ui::scenery::BackdropKind

pub enum BackdropKind { Aurora, Mesh, Bokeh, Dusk, Grain, Topo, Grid, Starfield }

The kinds of generated backdrop.

Methods

  • fn name(self) -> &'static str — A short name for the preset ("aurora", "dusk"), for keys and for the gallery.
  • const ALL: [BackdropKind; 8] — Every preset, in gallery order.

Variants

  • Aurora — Soft flowing gradient bands (a northern sky).
  • Mesh — Multi-point gradient blobs (a mesh gradient).
  • Bokeh — Soft light circles with depth (out-of-focus lights).
  • Dusk — A dusk sky: a horizon, a low sun and a dark land.
  • Grain — A smooth gradient with dithering, so it has no bands.
  • Topo — Topographic contour lines over a shaded field.
  • Grid — A glowing grid (synthwave, tech).
  • Starfield — A starfield over a faint nebula.

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::scenery::EmptyState

pub enum EmptyState { Cards, Search, Sprout, Box }

The kinds of empty-state illustration.

Methods

  • fn name(self) -> &'static str — A short name for the illustration.
  • const ALL: [EmptyState; 4] — Every illustration, in gallery order.

Variants

  • Cards — A fan of cards: nothing has been added yet.
  • Search — A magnifier over a few dots: nothing was found.
  • Sprout — A sprout: nothing has grown here yet.
  • Box — An open box: the list is empty.

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::skin::Look

pub enum Look { Button, Tonal, Ghost, Plain, Field, Surface, Glass, Badge, AppBar, Track, Raised }

How the theme's skin dresses a control.

Methods

  • fn role(&self) -> Option<Role> — The role this look is painted in.
  • fn is_face(&self) -> bool — True for a face the skin paints (a button, a field, a surface).

Variants

  • Button — A solid button in a role (the accent by default): a vertical gradient, a lit rim, a coloured halo, a soft contact shadow and the role's ink.
  • Tonal — A tonal button in a role: a soft tinted face, a hairline edge.
  • Ghost — A quiet button: no face until it is hovered.
  • Plain — The face the control's builder made: the skin dresses the control (a field's inset, a surface's lit top) but keeps the builder's own colours.
  • Field — An input: a debossed face with a hairline edge.
  • Surface — A raised surface (a card, a panel, a dialog): a lit top, a tight contact shadow and a wide ambient halo.
  • Glass — A glass surface over a rich background (frosted, translucent).
  • Badge — A badge or a pill: a soft tinted face with a hairline edge.
  • AppBar — The app bar: the page's header. It keeps its own gradient in the flat material, stands out of the page in the soft one and is frosted in the glass one.
  • Track — A groove the control sits in (a segmented track, a slider track, an off switch): a debossed face, no edge of its own.
  • Raised — A raised knob that sits in a groove (the selected segment, the switch knob): the page's own colour, lifted by the shadow pair.

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::text_input::Ime

pub enum Ime { Start, Update, Commit, Cancel }

One IME composition event, as a platform input method delivers it.

Variants

  • Start — A composition begins over the current selection.
  • Update — The preedit string changed (shown underlined).
  • Commit — The composition ended with this final text.
  • Cancel — The composition was abandoned.

Trait implementations: Clone, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::text_input::Input

pub enum Input { Key, Ime }

Input delivered to a focused element's [El::on_input] handler.

Variants

  • Key
  • Ime

Trait implementations: Clone, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::viewport::Device

pub enum Device { Handheld240, Strip320, Watch320, PhoneNotch, PhoneTall, PhoneLandscape, FoldFolded, FoldUnfolded, TabletIpad, Laptop1366, LaptopFhd, DesktopQhd, Monitor4k, UltraWide21, UltraWide32, SignagePortrait, Tv4k, Tv8k, Retroid }

A known surface. The presets are the awkward ones: tiny handhelds, notched phones, foldables, an ultra-wide, a portrait kiosk, a 10-foot TV.

Methods

  • const ALL: [Device; 19] — Every preset, in a stable order.
  • fn name(self) -> &'static str — A stable, lowercase name.
  • fn viewport(self) -> Viewport — The surface of this device.

Variants

  • Handheld240 — 240x160 handheld (a pocket console).
  • Strip320 — 320x240 watch-ish strip.
  • Watch320 — 320x320 watch.
  • PhoneNotch — A notched phone (logical 390x844 at 3x).
  • PhoneTall — A tall Android phone (logical 360x780 at 3x).
  • PhoneLandscape — The same phone sideways.
  • FoldFolded — A foldable, folded (the outer screen).
  • FoldUnfolded — A foldable, unfolded (the inner screen, with the crease).
  • TabletIpad — A 10.9" tablet (logical 1024x1366 at 2x).
  • Laptop1366 — A 1366x768 laptop panel.
  • LaptopFhd — A 1080p laptop panel at 1.25x.
  • DesktopQhd — A 1440p desktop panel at 1.5x.
  • Monitor4k — A 4K desktop monitor at 1x.
  • UltraWide21 — A 21:9 ultra-wide (3440x1440).
  • UltraWide32 — A 32:9 ultra-wide (5120x1440).
  • SignagePortrait — A 9:16 portrait kiosk (1080x1920).
  • Tv4k — A 4K TV seen from the couch.
  • Tv8k — An 8K TV seen from the couch.
  • Retroid — A 5.5" 1080p handheld console.

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::viewport::Distance

pub enum Distance { Handheld, Desk, Couch }

How far the user sits from the screen (the 10-foot UI is a different design).

Methods

  • fn label(self) -> &'static str — A stable, lowercase name.

Variants

  • Handheld — In the hand, 25-40 cm.
  • Desk — On a desk, 50-70 cm.
  • Couch — Across the room, 2-4 m (a TV).

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::viewport::Form

pub enum Form { Watch, Strip, Handheld, Phone, PhoneLandscape, Foldable, Tablet, Laptop, Desktop, UltraWide, Signage, Tv }

The form factor of a surface: what the layout should look like.

Methods

  • const ALL: [Form; 12] — Every form, in index order (the store key ~form holds the index plus one).
  • fn from_index(i: i64) -> Option<Form> — The form at an index (None when the index is unknown or out of range).
  • fn label(self) -> &'static str — A stable, lowercase name.

Variants

  • Watch — A tiny square-ish screen (a watch).
  • Strip — A wide, short strip (a watch-ish strip, a 240x160 handheld).
  • Handheld — A handheld console (held, with a gamepad).
  • Phone — A phone, held upright.
  • PhoneLandscape — A phone, held sideways.
  • Foldable — A folding surface (a hinge runs through it).
  • Tablet — A tablet.
  • Laptop — A laptop screen.
  • Desktop — A desktop monitor.
  • UltraWide — A very wide screen (21:9 and wider).
  • Signage — A tall portrait screen (9:16 signage).
  • Tv — A television across the room.

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::viewport::Height

pub enum Height { Short, Regular, Tall }

The height class of a logical height: short (a strip), regular (a screen), tall (a phone held up).

Methods

  • const ALL: [Height; 3] — Every height class, in index order (the store key ~height holds the index plus one).
  • fn from_index(i: i64) -> Option<Height> — The class at an index (None when the index is unknown or out of range).
  • fn classify(h: f64) -> Height — The class of a logical height.
  • fn label(self) -> &'static str — A stable, lowercase name.

Variants

  • Short — Under 480 logical px.
  • Regular — 480 to 900 logical px.
  • Tall — 900 logical px and over.

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::viewport::Orientation

pub enum Orientation { Portrait, Landscape, Square }

Which way the surface points.

Variants

  • Portrait
  • Landscape
  • Square

Trait implementations: Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

enumaster_blueprint::ui::viewport::VCond

pub enum VCond { Form, Input, Height }

The condition a viewport hook tests.

Methods

  • fn matches(&self, vp: &Viewport) -> bool — Does the viewport match?

Variants

  • Form — The form factor is exactly this.
  • Input — The input set has this device.
  • Height — The height class is exactly this.

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

Traits

traitaster_blueprint::ui::RoleExt

pub trait RoleExt

Role::Accent.tint(0.16), Role::Surface.mix(Role::Accent, 0.2).

Required and provided methods

  • fn tint(self, alpha: f64) -> Col
  • fn mix(self, other: Role, t: f64) -> Col
  • fn ink(self) -> Col — The role as readable text on any surface: text("Idle").color(Role::Info.ink()).

traitaster_blueprint::ui::charts::ChartExt

pub trait ChartExt

Modifiers for the chart constructors.

Required and provided methods

  • fn values(self) -> El — Bar value labels (bar_chart, hbar_chart).
  • fn no_values(self) -> El — Hide the value labels (hbar_chart shows them by default).
  • fn markers(self) -> El — Point markers on every data point (line_chart, area_chart).
  • fn no_legend(self) -> El — Hide the legend (line_chart, area_chart; shown for 2+ series by default).
  • fn diameter(self, px: f64) -> El — Diameter in px (donut_chart, pie_chart; default 150).
  • fn x_title(self, title: &str) -> El — A caption under the category labels (bar_chart, line_chart, area_chart, grouped and stacked bars).
  • fn y_title(self, title: &str) -> El — A caption above the value axis, at its left edge (same charts as [ChartExt::x_title]); also read out with the chart's description.
  • fn short_labels(self, short: &[&str]) -> El — Short category labels ("Jan" for "January"): shown instead of the labels when those would not fit their categories (the chart thins the labels that still do not fit). One per category. Same charts as [ChartExt::x_title] plus hbar_chart, where they replace the labels when the label column would take over 40% of the width.
  • fn unit(self, unit: &str) -> El — A unit after every value the chart writes: the bar and tooltip texts, the legend and the description read 42 ms (a space is put between; .unit("%") gives 42 %, use [ChartExt::value_fmt] for $42 or 42%). The axis ticks stay bare. Every chart but sparkline; a scatter chart puts it on the y values. Call it before [ChartExt::explore].
  • fn value_fmt(self, f: impl Fn(f64) -> String + 'static) -> El — Write the values yourself (.value_fmt(|v| format!("${v:.2}"))): the bar and tooltip texts, the legend, the description and the value-axis ticks. Same charts as [ChartExt::unit]; call it before [ChartExt::explore].
  • fn log_y(self) -> El — A logarithmic value axis (line_chart, area_chart; the y axis of scatter_chart): decade ticks (1, 10, 100, 1k), gridlines per decade. Needs every value above zero and no .right_axis() series; bars are refused (their length would lie).
  • fn reference(self, value: f64, label: &str) -> El — A dashed reference line at value (a target, a limit) with label over its right end ("" for none), on bar_chart, grouped_bar_chart, stacked_bar_chart, line_chart and area_chart. The value axis grows to reach it, the description names it, and up to four can be added.
  • fn top(self, n: usize) -> El — Keep the n largest rows of an hbar_chart, donut_chart or pie_chart (largest first) and fold the rest into one Other row that is their sum, so a long list stays readable: 40 hosts become the top 8 and "Other". Nothing changes when there are at most n + 1 rows (folding a single row would only rename it). Needs values >= 0 and n >= 1; call it before [ChartExt::explore]. [ChartExt::top_as] names the folded row.
  • fn top_as(self, n: usize, other: &str) -> El — [ChartExt::top] with your own name for the folded row ("Others", "Autres").
  • fn tick_px(self, px: f64) -> El — The size of the tick and value labels in px (bar, line and area charts; default 11, hbar_chart keeps its Caption size).
  • fn scroll_rows(self, s: &Store, key: &str, max_h: f64) -> El — hbar_chart only: show at most max_h px of rows and scroll the rest (wheel, touch drag, Scalar <key>.scroll) instead of growing with the list. Call it last (the result is the scroll around the chart, so .top(..), .values() and .explore(..) come before it); the arrow keys of an explored chart do not scroll the rows into view.
  • fn explore(self, s: &Store, key: &str) -> El — Make the data points explorable (bar_chart, line_chart, area_chart, grouped and stacked bars, scatter_chart): the chart takes the focus under id key; Left/Right step through the points (Home/End jump), Up/Down switch series, Escape clears. A hover over a bar or line chart picks the category under the pointer. The point shows a highlight and a tooltip with its values and is spoken as the chart's value. Store: Int <key>.pt (1-based point, 0 = none), Int <key>.sr (series).
  • fn explore_keyed<I: AsRef<str>>(self, s: &Store, key: &str, ids: &[I]) -> El — [ChartExt::explore] keyed by the data instead of the position: ids holds one stable id per category (a timestamp, a name), and the selected point is remembered by its id in Text <key>.at. A live chart whose window slides (a new sample in, the oldest out) keeps its highlight and tooltip on the same sample, which moves left with it, and shows none once that sample has left the window; the keys step from the point it is on. Hover, the keys and Escape write <key>.at and keep <key>.pt (the index) in step; read <key>.at (the index goes stale while the data slides). For the category charts (not scatter_chart, whose points have no category); a multi-series chart shares one id per category.

traitaster_blueprint::ui::controls::Clipboard

pub trait Clipboard

A text clipboard. [MemoryClipboard] is the headless default; a native host plugs in the real one with App::set_clipboard.

Required and provided methods

  • fn text(&self) -> Option<String> — Current text, None when empty.
  • fn set_text(&mut self, text: &str)

traitaster_blueprint::ui::display::SeriesValue

pub trait SeriesValue

A number usable in a series: any Into<f64> number (f32, i32, u32...) or a reference to one, so &[f64], &Vec<f32>, Vec<i32> and iterators of them all work.

Required and provided methods

  • fn to_f64(self) -> f64

traitaster_blueprint::ui::fx::BackdropExt

pub trait BackdropExt

panel.glass_on(&backdrop, Glass::new()).

Required and provided methods

  • fn glass_on(self, backdrop: &Backdrop, g: Glass) -> El — Frost this element over backdrop (see [Backdrop::glass]).

traitaster_blueprint::ui::fx::BurstExt

pub trait BurstExt

.burst_on_click(Burst::sparks()).

Required and provided methods

  • fn burst_on_click(self, burst: Burst) -> El — Throw burst from the pointer position every time this element is clicked. Needs an .id(); the click also bumps the store counter <id>.burst. Reduced motion shows no burst (a burst is pure travel).

traitaster_blueprint::ui::fx::DepthExt

pub trait DepthExt

Depth and light modifiers for [El].

Required and provided methods

  • fn scene_light(self, light: SceneLight) -> El — Make this element the root of a lit space: every element below reads the light. Elements with an elevation or a depth cast shadows along the light, rounded surfaces get a bevel and glint, glass a streak, and fog banks are lit.
  • fn depth(self, z: f64) -> El — Height above the surface in px (z > 0 raises: casts a shadow, shifts with parallax; z < 0 is a far layer). Without it the theme elevation level stands for 5 px per level.
  • fn rotate3d(self, x_deg: f64, y_deg: f64) -> El — Draw the element rotated about the X and Y axes (degrees) in perspective, and map clicks through the same rotation. Needs an .id() for hit testing. The picture stays inside the element's box.
  • fn perspective(self, px: f64) -> El — Camera distance in px for [DepthExt::rotate3d] (smaller = stronger perspective, default 900, at least 200).
  • fn depth_blur(self) -> El — Defocus the element by its distance from the focal plane z = 0: blur ~ 0.35 px per px of |z|.
  • fn depth_blur_with(self, focus_z: f64, strength: f64) -> El — [DepthExt::depth_blur] with an explicit focal plane and strength (px of blur per px of distance).
  • fn light_follows_pointer(self) -> El — This element's highlights follow the pointer, in a scene whose light does not.
  • fn unlit(self) -> El — Opt this element (and nothing else) out of the scene light's bevel, sheen and shadow.
  • fn lit(self) -> El — Opt this element in to the bevel and sheen even without an elevation or depth.
  • fn casts_light(self, light: PointLight) -> El — This element glows: it lights what is around it (see [PointLight]). Needs the elements to be lit to be painted before the light's pass (the scene root places the pass last; without a scene it follows the element).

traitaster_blueprint::ui::fx::DistortExt

pub trait DistortExt

.distort(..), .glitch(..), .hologram(..).

Required and provided methods

  • fn distort(self, d: Distort) -> El — Shockwave / haze / chromatic aberration on this element's own picture. A shockwave fired by a click needs an .id() (the click bumps <id>.distort); other effects need none.
  • fn glitch(self, g: Glitch) -> El — Glitch this element's picture: a burst per click (<id>.glitch, needs .id()) or .on(key), and/or an ambient flicker.
  • fn hologram(self, h: Hologram) -> El — Scanlines, flicker and a barrel curve on this element's picture.

traitaster_blueprint::ui::fx::GlassExt

pub trait GlassExt

.glass(&background, Glass::new()).

Required and provided methods

  • fn glass_below(self, g: Glass) -> El — Frost whatever the screen paints below this element: every panel, picture and text drawn earlier in paint order, blurred, tinted and saturated like [GlassExt::glass] (which stays the cheaper form when one known background is all there is). Panels frosted below this one show as a flat tint in the picture (the blur does not nest).
  • fn glass(self, backdrop: &El, g: Glass) -> El — Frost this element over backdrop, the full-bleed background of the screen (the same element you draw first in the root overlay).

traitaster_blueprint::ui::fx::GradientExt

pub trait GradientExt

Gradient modifiers.

Required and provided methods

  • fn gradient_border(self, cols: impl IntoIterator<Item = impl Into<Col>>, width: f64) -> El — A gradient outline of width px following the element's corner radius.
  • fn gradient_border_spin(self, cols: impl IntoIterator<Item = impl Into<Col>>, width: f64, deg_per_s: f64) -> El — Like [GradientExt::gradient_border], the colours circling at deg_per_s.
  • fn gradient_text(self, cols: impl IntoIterator<Item = impl Into<Col>>, angle: f64) -> El — Fill the glyphs of a text element with a gradient at angle degrees. The text keeps its label in the semantic tree.
  • fn gradient_text_flow(self, cols: impl IntoIterator<Item = impl Into<Col>>, angle: f64, cycles_per_s: f64) -> El — Gradient text whose bands scroll at cycles_per_s (a shimmer).

traitaster_blueprint::ui::fx::Host

pub trait Host

Renders other elements for layers that need pixels under or inside them.

Required and provided methods

  • fn render_el(&mut self, el: &El, w: f64, h: f64, scale: f64, place: Option<([f64; 2], [f64; 2])>) -> Option<Pix> — Render el alone into a w x h logical box at scale on a transparent clear. place is (origin, screen): where the box really is on the screen, so layers inside it (glass) crop the right backdrop. None if the host cannot (no fonts) or the render failed.
  • fn render_below(&mut self, _layer: usize, _scale: f64) -> Option<Pix> — Render the whole screen as painted below the layer layer (its address, see [FxCtx::render_below]) at scale: everything the screen paints before that element, and not the element, its children or anything after. None if the host cannot.
  • fn render_screen(&mut self, _el: &El, _w: f64, _h: f64, _scale: f64) -> Option<Pix> — Render el as a screen of its own, w x h logical px at scale (layers that look below see el as the whole screen). Opaque as the scene draws it. None if the host cannot ([backdrop::Backdrop]).

traitaster_blueprint::ui::fx::KineticExt

pub trait KineticExt

.kinetic(Kinetic::decode()) on a text element.

Required and provided methods

  • fn kinetic(self, k: Kinetic) -> El — Reveal this text with k. The element keeps its full text as its label; the reveal is decorative. One line, lines split with \n, or a wrapped paragraph (the reveal follows the lines the element breaks into). A rich text is revealed too: the runs keep their face, size and colour, and the lines are the ones the rich layout breaks into. Under reduced motion the text is simply shown.

traitaster_blueprint::ui::fx::PostExt

pub trait PostExt

.post(Post) on an element or a whole screen.

Required and provided methods

  • fn post(self, p: Post) -> El — Post-process this element's own picture (its box; light cannot spill outside it).
  • fn post_screen(self, p: Post) -> El — Post-process the whole screen this element is the root of: overlay([self, post_below(p)]).

traitaster_blueprint::ui::fx::ShaftsExt

pub trait ShaftsExt

Light shafts around one element: .casts_shafts(LightShafts::from(0.8, 0.12)).

Required and provided methods

  • fn casts_shafts(self, l: LightShafts) -> El — The element's own silhouette is the only occluder: the shafts stream around it and are drawn behind it (additively), so the element's pixels do not change. The light is placed as for [LightShafts]: fractions of the screen, .from_el(..) or the pointer.

traitaster_blueprint::ui::fx::SurfaceExt

pub trait SurfaceExt

Pointer-reactive modifiers.

Required and provided methods

  • fn tilt(self, cfg: TiltCard) -> El — 3D tilt toward the pointer with perspective, depth shading and a sheen. Needs an .id().
  • fn spotlight(self, color: impl Into<Col>, radius: f64) -> El — A soft light that follows the pointer over this element (and lights its border). Needs an .id(). radius in px.
  • fn spotlight_blend(self, color: impl Into<Col>, radius: f64, mode: aster_ui::BlendMode) -> El — [SurfaceExt::spotlight] with an explicit blend mode (spotlight is additive: the light brightens the panel under it; SourceOver paints it as an ordinary translucent wash).
  • fn magnetic(self, pull: f64, reach: f64) -> El — The element leans toward the pointer within reach px of its box, by pull (0..1) of the distance. Needs an .id().

traitaster_blueprint::ui::fx::backdrop::BackdropExt

pub trait BackdropExt

panel.glass_on(&backdrop, Glass::new()).

Required and provided methods

  • fn glass_on(self, backdrop: &Backdrop, g: Glass) -> El — Frost this element over backdrop (see [Backdrop::glass]).

traitaster_blueprint::ui::fx::depth::DepthExt

pub trait DepthExt

Depth and light modifiers for [El].

Required and provided methods

  • fn scene_light(self, light: SceneLight) -> El — Make this element the root of a lit space: every element below reads the light. Elements with an elevation or a depth cast shadows along the light, rounded surfaces get a bevel and glint, glass a streak, and fog banks are lit.
  • fn depth(self, z: f64) -> El — Height above the surface in px (z > 0 raises: casts a shadow, shifts with parallax; z < 0 is a far layer). Without it the theme elevation level stands for 5 px per level.
  • fn rotate3d(self, x_deg: f64, y_deg: f64) -> El — Draw the element rotated about the X and Y axes (degrees) in perspective, and map clicks through the same rotation. Needs an .id() for hit testing. The picture stays inside the element's box.
  • fn perspective(self, px: f64) -> El — Camera distance in px for [DepthExt::rotate3d] (smaller = stronger perspective, default 900, at least 200).
  • fn depth_blur(self) -> El — Defocus the element by its distance from the focal plane z = 0: blur ~ 0.35 px per px of |z|.
  • fn depth_blur_with(self, focus_z: f64, strength: f64) -> El — [DepthExt::depth_blur] with an explicit focal plane and strength (px of blur per px of distance).
  • fn light_follows_pointer(self) -> El — This element's highlights follow the pointer, in a scene whose light does not.
  • fn unlit(self) -> El — Opt this element (and nothing else) out of the scene light's bevel, sheen and shadow.
  • fn lit(self) -> El — Opt this element in to the bevel and sheen even without an elevation or depth.
  • fn casts_light(self, light: PointLight) -> El — This element glows: it lights what is around it (see [PointLight]). Needs the elements to be lit to be painted before the light's pass (the scene root places the pass last; without a scene it follows the element).

traitaster_blueprint::ui::fx::distort::DistortExt

pub trait DistortExt

.distort(..), .glitch(..), .hologram(..).

Required and provided methods

  • fn distort(self, d: Distort) -> El — Shockwave / haze / chromatic aberration on this element's own picture. A shockwave fired by a click needs an .id() (the click bumps <id>.distort); other effects need none.
  • fn glitch(self, g: Glitch) -> El — Glitch this element's picture: a burst per click (<id>.glitch, needs .id()) or .on(key), and/or an ambient flicker.
  • fn hologram(self, h: Hologram) -> El — Scanlines, flicker and a barrel curve on this element's picture.

traitaster_blueprint::ui::fx::glass::GlassExt

pub trait GlassExt

.glass(&background, Glass::new()).

Required and provided methods

  • fn glass_below(self, g: Glass) -> El — Frost whatever the screen paints below this element: every panel, picture and text drawn earlier in paint order, blurred, tinted and saturated like [GlassExt::glass] (which stays the cheaper form when one known background is all there is). Panels frosted below this one show as a flat tint in the picture (the blur does not nest).
  • fn glass(self, backdrop: &El, g: Glass) -> El — Frost this element over backdrop, the full-bleed background of the screen (the same element you draw first in the root overlay).

traitaster_blueprint::ui::fx::gradient::GradientExt

pub trait GradientExt

Gradient modifiers.

Required and provided methods

  • fn gradient_border(self, cols: impl IntoIterator<Item = impl Into<Col>>, width: f64) -> El — A gradient outline of width px following the element's corner radius.
  • fn gradient_border_spin(self, cols: impl IntoIterator<Item = impl Into<Col>>, width: f64, deg_per_s: f64) -> El — Like [GradientExt::gradient_border], the colours circling at deg_per_s.
  • fn gradient_text(self, cols: impl IntoIterator<Item = impl Into<Col>>, angle: f64) -> El — Fill the glyphs of a text element with a gradient at angle degrees. The text keeps its label in the semantic tree.
  • fn gradient_text_flow(self, cols: impl IntoIterator<Item = impl Into<Col>>, angle: f64, cycles_per_s: f64) -> El — Gradient text whose bands scroll at cycles_per_s (a shimmer).

traitaster_blueprint::ui::fx::gradient2::GradFx

pub trait GradFx

Gradient modifiers for any element (see the module docs).

Required and provided methods

  • fn grad_fill(self, g: Grad) -> El — Fill the element's box with g (it replaces a solid .fill; children paint over it).
  • fn grad_border(self, g: Grad, width: f64) -> El — A width px border along the element's rounded edge, filled with g (a conic spins when animated).
  • fn grad_border_glow(self, g: Grad, width: f64, glow: f64) -> El — [GradFx::grad_border] plus a soft halo of the ring's colours glow px wide (a "glowing border").
  • fn grad_text(self, g: Grad) -> El — Fill the glyphs of a text element with g (the text keeps its label).
  • fn grad_glow(self, g: Grad, strength: f64, radius: f64) -> El — A halo of g's colours around the element: a coloured shadow / glow of radius px.
  • fn grad_map(self, stops: Stops, amount: f64) -> El — Map the luminance of the element (with its children, an image say) through stops, mixed by amount (1 = fully mapped).
  • fn grad_stroke(self, g: Grad, pts: Vec<[f64; 2]>, curved: bool, width: f64) -> El — A stroke along pts (box fractions), coloured by arc length. curved: the points are cubic Bézier chains (p0, c1, c2, p1, c1, c2, p2, ..).
  • fn grad_surface(self, token: GradToken, fallback: impl Into<Col>) -> El — Fill with the theme's named gradient when the theme opted in ([opt_in_named]); the plain fallback colour otherwise.
  • fn grad_hover_bloom(self, g: Grad, radius: f64) -> El — A soft bloom of g's colours that follows the pointer over the element and fades in on hover (the element needs an .id). g's ramp runs from the pointer (t = 0, its alpha is the bloom's strength) out to radius logical px. A solid .fill becomes the base the bloom lights; text stays on top. Still (and invisible) under reduced motion.
  • fn grad_shape(self, g: Grad, pts: Vec<[f64; 2]>, curved: bool) -> El — Fill the closed shape pts (box fractions; cubic Bézier chains with curved) with g, antialiased. With a [Grad::path] of the same points the colour follows the outline.
  • fn grad_text_motion(self, g: Grad, m: TextMotion) -> El — Gradient text whose colours move glyph by glyph (see [TextMotion]): crisp (the glyphs' coverage is untouched), readable (with g.min_contrast(bg, ratio) every colour it can show is fitted and the text's audited ink is the worst of them), still under reduced motion. g.fps sets how often it changes (60 for a smooth shimmer).
  • fn grad_text_outline(self, g: Grad, width: f64) -> El — A width px outline round the glyphs of a text, coloured by g from the glyph edge (t = 0) outwards (t = 1); the glyphs keep their own ink.

traitaster_blueprint::ui::fx::kinetic::KineticExt

pub trait KineticExt

.kinetic(Kinetic::decode()) on a text element.

Required and provided methods

  • fn kinetic(self, k: Kinetic) -> El — Reveal this text with k. The element keeps its full text as its label; the reveal is decorative. One line, lines split with \n, or a wrapped paragraph (the reveal follows the lines the element breaks into). A rich text is revealed too: the runs keep their face, size and colour, and the lines are the ones the rich layout breaks into. Under reduced motion the text is simply shown.

traitaster_blueprint::ui::fx::light::ShaftsExt

pub trait ShaftsExt

Light shafts around one element: .casts_shafts(LightShafts::from(0.8, 0.12)).

Required and provided methods

  • fn casts_shafts(self, l: LightShafts) -> El — The element's own silhouette is the only occluder: the shafts stream around it and are drawn behind it (additively), so the element's pixels do not change. The light is placed as for [LightShafts]: fractions of the screen, .from_el(..) or the pointer.

traitaster_blueprint::ui::fx::particles::BurstExt

pub trait BurstExt

.burst_on_click(Burst::sparks()).

Required and provided methods

  • fn burst_on_click(self, burst: Burst) -> El — Throw burst from the pointer position every time this element is clicked. Needs an .id(); the click also bumps the store counter <id>.burst. Reduced motion shows no burst (a burst is pure travel).

traitaster_blueprint::ui::fx::post::PostExt

pub trait PostExt

.post(Post) on an element or a whole screen.

Required and provided methods

  • fn post(self, p: Post) -> El — Post-process this element's own picture (its box; light cannot spill outside it).
  • fn post_screen(self, p: Post) -> El — Post-process the whole screen this element is the root of: overlay([self, post_below(p)]).

traitaster_blueprint::ui::fx::surface::SurfaceExt

pub trait SurfaceExt

Pointer-reactive modifiers.

Required and provided methods

  • fn tilt(self, cfg: TiltCard) -> El — 3D tilt toward the pointer with perspective, depth shading and a sheen. Needs an .id().
  • fn spotlight(self, color: impl Into<Col>, radius: f64) -> El — A soft light that follows the pointer over this element (and lights its border). Needs an .id(). radius in px.
  • fn spotlight_blend(self, color: impl Into<Col>, radius: f64, mode: aster_ui::BlendMode) -> El — [SurfaceExt::spotlight] with an explicit blend mode (spotlight is additive: the light brightens the panel under it; SourceOver paints it as an ordinary translucent wash).
  • fn magnetic(self, pull: f64, reach: f64) -> El — The element leans toward the pointer within reach px of its box, by pull (0..1) of the distance. Needs an .id().

traitaster_blueprint::ui::image::ImageExt

pub trait ImageExt

The image modifiers of [El] (they do nothing on an element that is not an [image]).

Required and provided methods

  • fn fit(self, fit: ImageFit) -> El — How the picture fills the box: [ImageFit::Contain] (the default), Cover or Fill.
  • fn alt(self, text: impl AsRef<str>) -> El — Name the picture for assistive tech (and tree.find_label): what it shows, not "image of". Without it the image is decorative.
  • fn pixelated(self) -> El — Nearest-neighbour sampling instead of the smooth filter: pixel art, QR codes, enlarged icons.

traitaster_blueprint::ui::kine::Field

pub trait Field

A force field: something that pushes bodies (and particles, and fluid) while it lives.

t is the time since the field was emitted, in seconds. force is an acceleration in px/s² (the world multiplies by mass where it wants a force); torque is an angular acceleration in rad/s².

Required and provided methods

  • fn force(&self, at: V2, body: Option<&BodyState>, t: f64) -> V2 — The acceleration at at for a body (or a particle: then body is None).
  • fn torque(&self, _at: V2, _body: &BodyState, _t: f64) -> f64 — The angular acceleration on a body.
  • fn alive(&self, t: f64) -> bool — False once the field has died out (the world drops it).
  • fn reach(&self, _t: f64) -> Option<[f64; 4]> — The screen region the field can reach at t (None: everywhere). Used to skip far bodies cheaply.
  • fn key(&self) -> u64 — A stable hash of the field's parameters (caches and determinism checks).

traitaster_blueprint::ui::kine::deform::DeformExt

pub trait DeformExt

.squash(..), .jelly(..), .cloth(..), .shatter(..) on an element with an .id().

Required and provided methods

  • fn squash(self, s: Squash) -> El — Squash and stretch from the element's body velocity (needs .id(); reads kine::body_state(id)).
  • fn jelly(self, j: Jelly) -> El — A soft body: a spring lattice over the picture.
  • fn cloth(self, c: Cloth) -> El — A banner hanging from its top edge.
  • fn shatter(self, s: super::shatter::Shatter) -> El — Break into fragments (or dust) that fly and reassemble.

traitaster_blueprint::ui::kine::effect::Spawn

pub trait Spawn

A field that can be started at a point.

Required and provided methods

  • fn spawn(&self, at: V2) -> Rc<dyn Field> — A copy of the field starting at at.
  • fn visual(&self) -> Option<Visual> — The visible part that goes with it by default.

traitaster_blueprint::ui::kine::swarm::Flow

pub trait Flow

A velocity field that drags particles along (px/s at a screen point).

Required and provided methods

  • fn velocity(&self, at: V2) -> Option<V2>
  • fn live(&self) -> bool — False once the flow is gone.

traitaster_blueprint::ui::prelude::BackdropExt

pub trait BackdropExt

panel.glass_on(&backdrop, Glass::new()).

Required and provided methods

  • fn glass_on(self, backdrop: &Backdrop, g: Glass) -> El — Frost this element over backdrop (see [Backdrop::glass]).

traitaster_blueprint::ui::prelude::BurstExt

pub trait BurstExt

.burst_on_click(Burst::sparks()).

Required and provided methods

  • fn burst_on_click(self, burst: Burst) -> El — Throw burst from the pointer position every time this element is clicked. Needs an .id(); the click also bumps the store counter <id>.burst. Reduced motion shows no burst (a burst is pure travel).

traitaster_blueprint::ui::prelude::ChartExt

pub trait ChartExt

Modifiers for the chart constructors.

Required and provided methods

  • fn values(self) -> El — Bar value labels (bar_chart, hbar_chart).
  • fn no_values(self) -> El — Hide the value labels (hbar_chart shows them by default).
  • fn markers(self) -> El — Point markers on every data point (line_chart, area_chart).
  • fn no_legend(self) -> El — Hide the legend (line_chart, area_chart; shown for 2+ series by default).
  • fn diameter(self, px: f64) -> El — Diameter in px (donut_chart, pie_chart; default 150).
  • fn x_title(self, title: &str) -> El — A caption under the category labels (bar_chart, line_chart, area_chart, grouped and stacked bars).
  • fn y_title(self, title: &str) -> El — A caption above the value axis, at its left edge (same charts as [ChartExt::x_title]); also read out with the chart's description.
  • fn short_labels(self, short: &[&str]) -> El — Short category labels ("Jan" for "January"): shown instead of the labels when those would not fit their categories (the chart thins the labels that still do not fit). One per category. Same charts as [ChartExt::x_title] plus hbar_chart, where they replace the labels when the label column would take over 40% of the width.
  • fn unit(self, unit: &str) -> El — A unit after every value the chart writes: the bar and tooltip texts, the legend and the description read 42 ms (a space is put between; .unit("%") gives 42 %, use [ChartExt::value_fmt] for $42 or 42%). The axis ticks stay bare. Every chart but sparkline; a scatter chart puts it on the y values. Call it before [ChartExt::explore].
  • fn value_fmt(self, f: impl Fn(f64) -> String + 'static) -> El — Write the values yourself (.value_fmt(|v| format!("${v:.2}"))): the bar and tooltip texts, the legend, the description and the value-axis ticks. Same charts as [ChartExt::unit]; call it before [ChartExt::explore].
  • fn log_y(self) -> El — A logarithmic value axis (line_chart, area_chart; the y axis of scatter_chart): decade ticks (1, 10, 100, 1k), gridlines per decade. Needs every value above zero and no .right_axis() series; bars are refused (their length would lie).
  • fn reference(self, value: f64, label: &str) -> El — A dashed reference line at value (a target, a limit) with label over its right end ("" for none), on bar_chart, grouped_bar_chart, stacked_bar_chart, line_chart and area_chart. The value axis grows to reach it, the description names it, and up to four can be added.
  • fn top(self, n: usize) -> El — Keep the n largest rows of an hbar_chart, donut_chart or pie_chart (largest first) and fold the rest into one Other row that is their sum, so a long list stays readable: 40 hosts become the top 8 and "Other". Nothing changes when there are at most n + 1 rows (folding a single row would only rename it). Needs values >= 0 and n >= 1; call it before [ChartExt::explore]. [ChartExt::top_as] names the folded row.
  • fn top_as(self, n: usize, other: &str) -> El — [ChartExt::top] with your own name for the folded row ("Others", "Autres").
  • fn tick_px(self, px: f64) -> El — The size of the tick and value labels in px (bar, line and area charts; default 11, hbar_chart keeps its Caption size).
  • fn scroll_rows(self, s: &Store, key: &str, max_h: f64) -> El — hbar_chart only: show at most max_h px of rows and scroll the rest (wheel, touch drag, Scalar <key>.scroll) instead of growing with the list. Call it last (the result is the scroll around the chart, so .top(..), .values() and .explore(..) come before it); the arrow keys of an explored chart do not scroll the rows into view.
  • fn explore(self, s: &Store, key: &str) -> El — Make the data points explorable (bar_chart, line_chart, area_chart, grouped and stacked bars, scatter_chart): the chart takes the focus under id key; Left/Right step through the points (Home/End jump), Up/Down switch series, Escape clears. A hover over a bar or line chart picks the category under the pointer. The point shows a highlight and a tooltip with its values and is spoken as the chart's value. Store: Int <key>.pt (1-based point, 0 = none), Int <key>.sr (series).
  • fn explore_keyed<I: AsRef<str>>(self, s: &Store, key: &str, ids: &[I]) -> El — [ChartExt::explore] keyed by the data instead of the position: ids holds one stable id per category (a timestamp, a name), and the selected point is remembered by its id in Text <key>.at. A live chart whose window slides (a new sample in, the oldest out) keeps its highlight and tooltip on the same sample, which moves left with it, and shows none once that sample has left the window; the keys step from the point it is on. Hover, the keys and Escape write <key>.at and keep <key>.pt (the index) in step; read <key>.at (the index goes stale while the data slides). For the category charts (not scatter_chart, whose points have no category); a multi-series chart shares one id per category.

traitaster_blueprint::ui::prelude::Clipboard

pub trait Clipboard

A text clipboard. [MemoryClipboard] is the headless default; a native host plugs in the real one with App::set_clipboard.

Required and provided methods

  • fn text(&self) -> Option<String> — Current text, None when empty.
  • fn set_text(&mut self, text: &str)

traitaster_blueprint::ui::prelude::DeformExt

pub trait DeformExt

.squash(..), .jelly(..), .cloth(..), .shatter(..) on an element with an .id().

Required and provided methods

  • fn squash(self, s: Squash) -> El — Squash and stretch from the element's body velocity (needs .id(); reads kine::body_state(id)).
  • fn jelly(self, j: Jelly) -> El — A soft body: a spring lattice over the picture.
  • fn cloth(self, c: Cloth) -> El — A banner hanging from its top edge.
  • fn shatter(self, s: super::shatter::Shatter) -> El — Break into fragments (or dust) that fly and reassemble.

traitaster_blueprint::ui::prelude::DepthExt

pub trait DepthExt

Depth and light modifiers for [El].

Required and provided methods

  • fn scene_light(self, light: SceneLight) -> El — Make this element the root of a lit space: every element below reads the light. Elements with an elevation or a depth cast shadows along the light, rounded surfaces get a bevel and glint, glass a streak, and fog banks are lit.
  • fn depth(self, z: f64) -> El — Height above the surface in px (z > 0 raises: casts a shadow, shifts with parallax; z < 0 is a far layer). Without it the theme elevation level stands for 5 px per level.
  • fn rotate3d(self, x_deg: f64, y_deg: f64) -> El — Draw the element rotated about the X and Y axes (degrees) in perspective, and map clicks through the same rotation. Needs an .id() for hit testing. The picture stays inside the element's box.
  • fn perspective(self, px: f64) -> El — Camera distance in px for [DepthExt::rotate3d] (smaller = stronger perspective, default 900, at least 200).
  • fn depth_blur(self) -> El — Defocus the element by its distance from the focal plane z = 0: blur ~ 0.35 px per px of |z|.
  • fn depth_blur_with(self, focus_z: f64, strength: f64) -> El — [DepthExt::depth_blur] with an explicit focal plane and strength (px of blur per px of distance).
  • fn light_follows_pointer(self) -> El — This element's highlights follow the pointer, in a scene whose light does not.
  • fn unlit(self) -> El — Opt this element (and nothing else) out of the scene light's bevel, sheen and shadow.
  • fn lit(self) -> El — Opt this element in to the bevel and sheen even without an elevation or depth.
  • fn casts_light(self, light: PointLight) -> El — This element glows: it lights what is around it (see [PointLight]). Needs the elements to be lit to be painted before the light's pass (the scene root places the pass last; without a scene it follows the element).

traitaster_blueprint::ui::prelude::DistortExt

pub trait DistortExt

.distort(..), .glitch(..), .hologram(..).

Required and provided methods

  • fn distort(self, d: Distort) -> El — Shockwave / haze / chromatic aberration on this element's own picture. A shockwave fired by a click needs an .id() (the click bumps <id>.distort); other effects need none.
  • fn glitch(self, g: Glitch) -> El — Glitch this element's picture: a burst per click (<id>.glitch, needs .id()) or .on(key), and/or an ambient flicker.
  • fn hologram(self, h: Hologram) -> El — Scanlines, flicker and a barrel curve on this element's picture.

traitaster_blueprint::ui::prelude::GlassExt

pub trait GlassExt

.glass(&background, Glass::new()).

Required and provided methods

  • fn glass_below(self, g: Glass) -> El — Frost whatever the screen paints below this element: every panel, picture and text drawn earlier in paint order, blurred, tinted and saturated like [GlassExt::glass] (which stays the cheaper form when one known background is all there is). Panels frosted below this one show as a flat tint in the picture (the blur does not nest).
  • fn glass(self, backdrop: &El, g: Glass) -> El — Frost this element over backdrop, the full-bleed background of the screen (the same element you draw first in the root overlay).

traitaster_blueprint::ui::prelude::GradFx

pub trait GradFx

Gradient modifiers for any element (see the module docs).

Required and provided methods

  • fn grad_fill(self, g: Grad) -> El — Fill the element's box with g (it replaces a solid .fill; children paint over it).
  • fn grad_border(self, g: Grad, width: f64) -> El — A width px border along the element's rounded edge, filled with g (a conic spins when animated).
  • fn grad_border_glow(self, g: Grad, width: f64, glow: f64) -> El — [GradFx::grad_border] plus a soft halo of the ring's colours glow px wide (a "glowing border").
  • fn grad_text(self, g: Grad) -> El — Fill the glyphs of a text element with g (the text keeps its label).
  • fn grad_glow(self, g: Grad, strength: f64, radius: f64) -> El — A halo of g's colours around the element: a coloured shadow / glow of radius px.
  • fn grad_map(self, stops: Stops, amount: f64) -> El — Map the luminance of the element (with its children, an image say) through stops, mixed by amount (1 = fully mapped).
  • fn grad_stroke(self, g: Grad, pts: Vec<[f64; 2]>, curved: bool, width: f64) -> El — A stroke along pts (box fractions), coloured by arc length. curved: the points are cubic Bézier chains (p0, c1, c2, p1, c1, c2, p2, ..).
  • fn grad_surface(self, token: GradToken, fallback: impl Into<Col>) -> El — Fill with the theme's named gradient when the theme opted in ([opt_in_named]); the plain fallback colour otherwise.
  • fn grad_hover_bloom(self, g: Grad, radius: f64) -> El — A soft bloom of g's colours that follows the pointer over the element and fades in on hover (the element needs an .id). g's ramp runs from the pointer (t = 0, its alpha is the bloom's strength) out to radius logical px. A solid .fill becomes the base the bloom lights; text stays on top. Still (and invisible) under reduced motion.
  • fn grad_shape(self, g: Grad, pts: Vec<[f64; 2]>, curved: bool) -> El — Fill the closed shape pts (box fractions; cubic Bézier chains with curved) with g, antialiased. With a [Grad::path] of the same points the colour follows the outline.
  • fn grad_text_motion(self, g: Grad, m: TextMotion) -> El — Gradient text whose colours move glyph by glyph (see [TextMotion]): crisp (the glyphs' coverage is untouched), readable (with g.min_contrast(bg, ratio) every colour it can show is fitted and the text's audited ink is the worst of them), still under reduced motion. g.fps sets how often it changes (60 for a smooth shimmer).
  • fn grad_text_outline(self, g: Grad, width: f64) -> El — A width px outline round the glyphs of a text, coloured by g from the glyph edge (t = 0) outwards (t = 1); the glyphs keep their own ink.

traitaster_blueprint::ui::prelude::GradientExt

pub trait GradientExt

Gradient modifiers.

Required and provided methods

  • fn gradient_border(self, cols: impl IntoIterator<Item = impl Into<Col>>, width: f64) -> El — A gradient outline of width px following the element's corner radius.
  • fn gradient_border_spin(self, cols: impl IntoIterator<Item = impl Into<Col>>, width: f64, deg_per_s: f64) -> El — Like [GradientExt::gradient_border], the colours circling at deg_per_s.
  • fn gradient_text(self, cols: impl IntoIterator<Item = impl Into<Col>>, angle: f64) -> El — Fill the glyphs of a text element with a gradient at angle degrees. The text keeps its label in the semantic tree.
  • fn gradient_text_flow(self, cols: impl IntoIterator<Item = impl Into<Col>>, angle: f64, cycles_per_s: f64) -> El — Gradient text whose bands scroll at cycles_per_s (a shimmer).

traitaster_blueprint::ui::prelude::ImageExt

pub trait ImageExt

The image modifiers of [El] (they do nothing on an element that is not an [image]).

Required and provided methods

  • fn fit(self, fit: ImageFit) -> El — How the picture fills the box: [ImageFit::Contain] (the default), Cover or Fill.
  • fn alt(self, text: impl AsRef<str>) -> El — Name the picture for assistive tech (and tree.find_label): what it shows, not "image of". Without it the image is decorative.
  • fn pixelated(self) -> El — Nearest-neighbour sampling instead of the smooth filter: pixel art, QR codes, enlarged icons.

traitaster_blueprint::ui::prelude::KineticExt

pub trait KineticExt

.kinetic(Kinetic::decode()) on a text element.

Required and provided methods

  • fn kinetic(self, k: Kinetic) -> El — Reveal this text with k. The element keeps its full text as its label; the reveal is decorative. One line, lines split with \n, or a wrapped paragraph (the reveal follows the lines the element breaks into). A rich text is revealed too: the runs keep their face, size and colour, and the lines are the ones the rich layout breaks into. Under reduced motion the text is simply shown.

traitaster_blueprint::ui::prelude::PostExt

pub trait PostExt

.post(Post) on an element or a whole screen.

Required and provided methods

  • fn post(self, p: Post) -> El — Post-process this element's own picture (its box; light cannot spill outside it).
  • fn post_screen(self, p: Post) -> El — Post-process the whole screen this element is the root of: overlay([self, post_below(p)]).

traitaster_blueprint::ui::prelude::RoleExt

pub trait RoleExt

Role::Accent.tint(0.16), Role::Surface.mix(Role::Accent, 0.2).

Required and provided methods

  • fn tint(self, alpha: f64) -> Col
  • fn mix(self, other: Role, t: f64) -> Col
  • fn ink(self) -> Col — The role as readable text on any surface: text("Idle").color(Role::Info.ink()).

traitaster_blueprint::ui::prelude::SeriesValue

pub trait SeriesValue

A number usable in a series: any Into<f64> number (f32, i32, u32...) or a reference to one, so &[f64], &Vec<f32>, Vec<i32> and iterators of them all work.

Required and provided methods

  • fn to_f64(self) -> f64

traitaster_blueprint::ui::prelude::ShaftsExt

pub trait ShaftsExt

Light shafts around one element: .casts_shafts(LightShafts::from(0.8, 0.12)).

Required and provided methods

  • fn casts_shafts(self, l: LightShafts) -> El — The element's own silhouette is the only occluder: the shafts stream around it and are drawn behind it (additively), so the element's pixels do not change. The light is placed as for [LightShafts]: fractions of the screen, .from_el(..) or the pointer.

traitaster_blueprint::ui::prelude::SurfaceExt

pub trait SurfaceExt

Pointer-reactive modifiers.

Required and provided methods

  • fn tilt(self, cfg: TiltCard) -> El — 3D tilt toward the pointer with perspective, depth shading and a sheen. Needs an .id().
  • fn spotlight(self, color: impl Into<Col>, radius: f64) -> El — A soft light that follows the pointer over this element (and lights its border). Needs an .id(). radius in px.
  • fn spotlight_blend(self, color: impl Into<Col>, radius: f64, mode: aster_ui::BlendMode) -> El — [SurfaceExt::spotlight] with an explicit blend mode (spotlight is additive: the light brightens the panel under it; SourceOver paints it as an ordinary translucent wash).
  • fn magnetic(self, pull: f64, reach: f64) -> El — The element leans toward the pointer within reach px of its box, by pull (0..1) of the distance. Needs an .id().

traitaster_blueprint::ui::prelude::ViewportExt

pub trait ViewportExt

The viewport, readable inside App::screen(|s| ..): the app keeps it in the reserved store keys ~w, ~h, ~size. (Before the first frame they read 0, so the first build sees Compact.)

Required and provided methods

  • fn viewport(&self) -> (u32, u32) — Logical width and height in px.
  • fn size_class(&self) -> Size — Size class under the theme's breakpoints.
  • fn form(&self) -> Option<super::viewport::Form> — The form factor of the current viewport (~form); None before the first frame.
  • fn height_class(&self) -> Option<super::viewport::Height> — The height class of the current viewport (~height); None before the first frame.

traitaster_blueprint::ui::prelude::particles::BurstExt

pub trait BurstExt

.burst_on_click(Burst::sparks()).

Required and provided methods

  • fn burst_on_click(self, burst: Burst) -> El — Throw burst from the pointer position every time this element is clicked. Needs an .id(); the click also bumps the store counter <id>.burst. Reduced motion shows no burst (a burst is pure travel).

traitaster_blueprint::ui::responsive::ViewportExt

pub trait ViewportExt

The viewport, readable inside App::screen(|s| ..): the app keeps it in the reserved store keys ~w, ~h, ~size. (Before the first frame they read 0, so the first build sees Compact.)

Required and provided methods

  • fn viewport(&self) -> (u32, u32) — Logical width and height in px.
  • fn size_class(&self) -> Size — Size class under the theme's breakpoints.
  • fn form(&self) -> Option<super::viewport::Form> — The form factor of the current viewport (~form); None before the first frame.
  • fn height_class(&self) -> Option<super::viewport::Height> — The height class of the current viewport (~height); None before the first frame.

traitaster_blueprint::ui::text_input::Clipboard

pub trait Clipboard

A text clipboard. [MemoryClipboard] is the headless default; a native host plugs in the real one with App::set_clipboard.

Required and provided methods

  • fn text(&self) -> Option<String> — Current text, None when empty.
  • fn set_text(&mut self, text: &str)

Type aliases

typeaster_blueprint::ui::fx::scene3d::Vec3

pub type Vec3 = [f64; 3];

3D point or direction in world units.

typeaster_blueprint::ui::fx::scene3d::mesh::P2

pub type P2 = [f32; 2];

typeaster_blueprint::ui::fx::scene3d::vec::M4

pub type M4 = [[f32; 4]; 4];

typeaster_blueprint::ui::fx::scene3d::vec::V3

pub type V3 = [f32; 3];

typeaster_blueprint::ui::inputs::Ymd

pub type Ymd = (i32, u32, u32);

A calendar date (year, month 1..=12, day 1..=31).

typeaster_blueprint::ui::kine::solve::PairMap

pub type PairMap = std::collections::HashMap<(usize, usize), (f64, f64), std::hash::BuildHasherDefault<PairHasher>>;

Warm-start impulses by body pair.

typeaster_blueprint::ui::prelude::Ymd

pub type Ymd = (i32, u32, u32);

A calendar date (year, month 1..=12, day 1..=31).

typeaster_blueprint::ui::prelude::scene3d::Vec3

pub type Vec3 = [f64; 3];

3D point or direction in world units.

typeaster_blueprint::ui::prelude::scene3d::mesh::P2

pub type P2 = [f32; 2];

typeaster_blueprint::ui::prelude::scene3d::vec::M4

pub type M4 = [[f32; 4]; 4];

typeaster_blueprint::ui::prelude::scene3d::vec::V3

pub type V3 = [f32; 3];

Functions

fnaster_blueprint::ui::col

pub fn col(children: impl IntoIterator<Item = El>) -> El

Vertical stack. Children stretch across the width by default.

fnaster_blueprint::ui::grid

pub fn grid(columns: usize, children: impl IntoIterator<Item = El>) -> El

columns equal 1fr columns, children placed row-major.

fnaster_blueprint::ui::grid_tracks

pub fn grid_tracks(tracks: impl IntoIterator<Item = layout::Track>, children: impl IntoIterator<Item = El>) -> El

Grid with explicit tracks: grid_tracks([Track::Px(240.), Track::Fr(1.)], ..).

fnaster_blueprint::ui::overlay

pub fn overlay(children: impl IntoIterator<Item = El>) -> El

Children share one box, later on top. Position with .place(h, v).

fnaster_blueprint::ui::paragraph

pub fn paragraph(s: impl AsRef<str>) -> El

A paragraph: body text that word-wraps to the width it is given (and grows taller to fit). Same as text(s).wrap(); add .max_lines(n), .text_align(..), .style(..).

fnaster_blueprint::ui::rect

pub fn rect(w: impl Into<f64>, h: impl Into<f64>) -> El

Exact-size empty box (px), rigid: flex shrink never squashes it (dots, bars, spacers of known size). Use .fill(..) to paint it.

fnaster_blueprint::ui::render

pub fn render(theme: &design::Theme, size: (u32, u32), scale: f64, root: &super::el::El) -> Result<headless::Image, super::error::UiError>

One call: ui::render(&theme, (w, h), scale, &root) -> Image.

fnaster_blueprint::ui::render_png

pub fn render_png(theme: &design::Theme, size: (u32, u32), scale: f64, root: &super::el::El, path: impl AsRef<std::path::Path>) -> Result<(), super::error::UiError>

[render] and write the PNG.

fnaster_blueprint::ui::rgba

pub fn rgba(r: u8, g: u8, b: u8, a: u8) -> Col

A raw colour with alpha (escape hatch): rgba(255, 0, 0, 128).

fnaster_blueprint::ui::rich

pub fn rich(spans: impl IntoIterator<Item = Span>) -> El

A rich text: the inline runs of one paragraph, laid out as one text. The lines break across the runs, the runs of a line share one baseline, and every run keeps its own face, size and colour.

fnaster_blueprint::ui::row

pub fn row(children: impl IntoIterator<Item = El>) -> El

Horizontal stack. Children are centred vertically by default.

fnaster_blueprint::ui::scroll

pub fn scroll(child: El) -> El

Clip + offset around one child (vertical by default, .horizontal(), .offset(x, y)).

fnaster_blueprint::ui::set_bake_threads

pub fn set_bake_threads(workers: usize)

Worker threads for baking a frame's missing effects (0 = auto: available parallelism up to 8, 1 = serial, like the rasteriser's set_default_raster_threads). Pixels never depend on it.

fnaster_blueprint::ui::spacer

pub fn spacer() -> El

Flexible gap (grow 1).

fnaster_blueprint::ui::span

pub fn span(s: impl Into<String>) -> Span

A run of text in the element's own face, size and colour.

fnaster_blueprint::ui::text

pub fn text(s: impl AsRef<str>) -> El

One line of text, Body style, Role::Text. Restyle with .style(Type::..), .color(..).

fnaster_blueprint::ui::wrap

pub fn wrap(children: impl IntoIterator<Item = El>) -> El

Horizontal stack that breaks onto new lines (.gap_xy(item, line)).

fnaster_blueprint::ui::autocomplete::autocomplete

pub fn autocomplete(s: &interact::Store, key: impl AsRef<str>, input: super::text_input::TextInput, suggestions: &[&str]) -> El

Wrap a configured [TextInput] (.label(..), .rule(..), ...) so that typing lists the suggestions that fuzzy-match the text, best first, at most six, in a list under the field (<key>.menu, rows <key>.opt.<i>, role option). Down / Up move the highlight (<key>.hi, 1-based, 0 = none; typing drops it; Down also brings the list back after Escape), Enter takes the highlighted one (with none highlighted Enter is left to the field, for a form's submit), Escape closes the list (<key>.shut holds the text it was closed at, so typing opens it again), a click takes a row and the field keeps the focus. Free text stays: the value is whatever is in the field. The field has the flag open while the list shows.

fnaster_blueprint::ui::charts::area_chart

pub fn area_chart(series: &[Series], labels: &[&str]) -> super::el::El

[line_chart] with a translucent area under every line.

fnaster_blueprint::ui::charts::bar_chart

pub fn bar_chart<V: Copy + Into<f64>>(values: &[V], labels: &[&str]) -> super::el::El

Bar chart: values to gradient bars with category labels, a nice 0..max axis with 5 ticks and gridlines, the peak highlighted in Warning with a glow. Negative values hang down from a zero line in Danger (the axis then covers the range and zero, with nice steps). It fills the height its parent gives it (min 120 px); labels may be empty. Add .values() ([ChartExt]) for a value label above every bar.

fnaster_blueprint::ui::charts::donut_chart

pub fn donut_chart<L: AsRef<str>, V: Copy + Into<f64>>(items: &[(L, V)], centre: &str) -> super::el::El

Donut chart: ring slices (clockwise from 12 o'clock), a centre label (empty for none; a \n starts a muted caption line) and a legend with value and percent. Values must be >= 0 and not all 0.

fnaster_blueprint::ui::charts::fmt_axis

pub fn fmt_axis(v: f64, step: f64) -> String

Axis label: integers stay integers, steps below 1 get decimals, thousands become k.

fnaster_blueprint::ui::charts::fmt_value

pub fn fmt_value(v: f64) -> String

Value label for a bar: 42, 3.5, 12k.

fnaster_blueprint::ui::charts::grouped_bar_chart

pub fn grouped_bar_chart(series: &[Series], labels: &[&str]) -> super::el::El

Grouped bar chart: one bar per series side by side inside every category, a shared nice 0..max axis with gridlines, a legend for 2+ series. Values must be >= 0. .values() labels every bar; .no_legend(), .tick_px(..).

fnaster_blueprint::ui::charts::hbar_chart

pub fn hbar_chart<V: Copy + Into<f64>>(values: &[V], labels: &[&str]) -> super::el::El

Horizontal bar chart: one row per value (label, bar, value). labels may be empty. Negative values hang left from a zero line in Danger.

fnaster_blueprint::ui::charts::line_chart

pub fn line_chart(series: &[Series], labels: &[&str]) -> super::el::El

Line chart: one polyline per series with a nice y axis (ticks, gridlines), category labels, a legend for 2+ series and the last value of each series highlighted. labels (one per value, or empty) are the x categories. Values may be negative. Add .markers() for a dot on every point, .no_legend().

fnaster_blueprint::ui::charts::pie_chart

pub fn pie_chart<L: AsRef<str>, V: Copy + Into<f64>>(items: &[(L, V)]) -> super::el::El

Pie chart: like [donut_chart] without the hole.

fnaster_blueprint::ui::charts::point

pub fn point(i: usize, n: usize, v: f64, range: [f64; 2], [w, h, pad]: [f64; 3]) -> [f64; 2]

Pixel position of sample i of n for a value in lo..=hi, inside pad of a w x h box. A single sample sits in the middle; a flat series sits on the middle line.

fnaster_blueprint::ui::charts::scatter_chart

pub fn scatter_chart(series: &[XySeries]) -> super::el::El

Scatter chart: one dot per (x, y) point, a nice axis for each direction (not forced through zero), gridlines, a legend for 2+ series. Colours cycle Accent, Info, Success, Warning unless .role(..). .x_title(..) / .y_title(..), .no_legend(), .tick_px(..).

fnaster_blueprint::ui::charts::slice_angles

pub fn slice_angles(values: &[f64]) -> Vec<(f64, f64)>

Start and end angle (radians, clockwise from 12 o'clock) of every slice; they tile the full circle.

fnaster_blueprint::ui::charts::sparkline_line

pub fn sparkline_line<V: Copy + Into<f64>>(values: &[V], role: design::Role) -> super::el::El

Polyline sparkline: antialiased line, a soft area under it and the last value highlighted with a dot. 28 px high, as wide as its parent. Values may be negative.

fnaster_blueprint::ui::charts::stacked_bar_chart

pub fn stacked_bar_chart(series: &[Series], labels: &[&str]) -> super::el::El

Stacked bar chart: the series of a category stacked bottom to top (the first series at the bottom). The axis covers the tallest stack; .values() prints the total over every stack. Values must be >= 0.

fnaster_blueprint::ui::choreo::count_up

pub fn count_up(get: impl Fn(&interact::Store) -> f64 + 'static) -> super::el::El

A number that counts up to its value when it first appears (a stat). The value is shown as a whole number with thousands separators.

fnaster_blueprint::ui::choreo::count_up_fmt

pub fn count_up_fmt(get: impl Fn(&interact::Store) -> f64 + 'static, fmt: impl Fn(f64) -> String + 'static) -> super::el::El

A number that counts up to its value when it first appears, shown with your own format.

fnaster_blueprint::ui::choreo::staggered

pub fn staggered(items: impl IntoIterator<Item = super::el::El>) -> super::el::El

A vertical list whose items enter one after another.

fnaster_blueprint::ui::choreo::staggered_cards

pub fn staggered_cards(items: impl IntoIterator<Item = super::el::El>) -> super::el::El

A row of cards whose items enter one after another.

fnaster_blueprint::ui::choreo::staggered_grid

pub fn staggered_grid(columns: usize, items: impl IntoIterator<Item = super::el::El>) -> super::el::El

A grid whose items enter one after another.

fnaster_blueprint::ui::components::app_bar

pub fn app_bar(title: impl AsRef<str>, subtitle: impl AsRef<str>, right: impl IntoIterator<Item = El>) -> El

Top app bar: title + subtitle on the left, right elements on the right. Optional slots, any order: .logo(logo_tile("A", Role::Warning, Role::Secondary)) before the title and .rule(Role::Accent, Role::Secondary) for a 2 px gradient rule along the bottom edge. The bar is rigid: a header never shrinks in a column that is too short (.shrink(1.) lifts that).

fnaster_blueprint::ui::components::avatar

pub fn avatar(initials: impl AsRef<str>, role: design::Role) -> El

Avatar: gradient circle with initials.

fnaster_blueprint::ui::components::badge

pub fn badge(label: impl AsRef<str>, role: design::Role) -> El

Soft status badge: translucent role fill, role-coloured text.

fnaster_blueprint::ui::components::bar_chart

pub fn bar_chart<V: Copy + Into<f64>>(values: &[V], labels: &[&str]) -> super::el::El

Bar chart: values to gradient bars with category labels, a nice 0..max axis with 5 ticks and gridlines, the peak highlighted in Warning with a glow. Negative values hang down from a zero line in Danger (the axis then covers the range and zero, with nice steps). It fills the height its parent gives it (min 120 px); labels may be empty. Add .values() ([ChartExt]) for a value label above every bar.

fnaster_blueprint::ui::components::caption

pub fn caption(title: impl AsRef<str>) -> El

Muted, bold, small uppercase caption for a section inside a card or page (caption("Fleet status")). Use it for a label that introduces a group; plain text(..).style(Type::Caption) is body-sized-down running text (a subtitle, a timestamp), not a heading. Sidebar sections use [nav_title] (the same look).

fnaster_blueprint::ui::components::card

pub fn card(children: impl IntoIterator<Item = El>) -> El

Elevated surface: raised fill, large radius, theme elevation 2 (shadow, hairline edge, Mission accent glow), padding and gap from tokens.

fnaster_blueprint::ui::components::card_compact

pub fn card_compact(children: impl IntoIterator<Item = El>) -> El

A tighter [card] for two-up grids on a phone: medium radius, one elevation step down, 12 px padding and 8 px gap instead of 20 and 12, so a 150 px column still holds a title, a caption and a meter. Same Card kind: .on_click(..) etc. work alike.

fnaster_blueprint::ui::components::chip

pub fn chip(label: impl AsRef<str>) -> El

Neutral chip.

fnaster_blueprint::ui::components::clickable

pub fn clickable(id: impl AsRef<str>, label: impl Into<El>) -> El

A clickable action in one call: a padded, rounded, accent-tinted row around label (a &str becomes bold text; an icon or any element works too) with .id(id), .role("button"), .focusable() and the theme's hover, pressed and focus layers. Attach the effect with [El::action], restyle with [El::tone] / [El::ghost]:

clickable("save", "Save").action(Action::set("saved", true))
clickable("del", "Delete").tone(Role::Danger).action(Action::clear("rows"))
clickable("close", icon(Icon::X).size(18).color(Role::TextMuted)).ghost().label("Close").action(..)

This is a convenience wrapper, not a stock Button; .disabled_if(..) and .selected_if(..) apply as usual.

fnaster_blueprint::ui::components::col_w

pub fn col_w(items: impl IntoIterator<Item = (f64, El)>) -> El

A column whose children split its height by weight with no magic basis: col_w([(10., a), (11., b)]) gives a 10/21 and b 11/21 of the height (after gaps). Each child gets .h(0.).grow(weight), so the share does not depend on content size (a bare .grow(10.) only splits the free space on top of each child's natural height). Content taller than its share overflows it, so keep shares generous. Add .gap(n), .pad(n) as usual.

fnaster_blueprint::ui::components::delta

pub fn delta(value: impl Into<f64>, unit: impl AsRef<str>) -> El

Change indicator: green ▲ 6.4% for positive, red ▼ 3.1% for negative, muted – 0% flat for zero.

fnaster_blueprint::ui::components::delta_fmt

pub fn delta_fmt(value: impl Into<f64>, decimals: usize, unit: impl AsRef<str>, role: design::Role) -> El

[delta_role] with a fixed number of decimals instead of 2 significant digits: delta_fmt(9., 0, " ms over target", Role::Danger) prints ▲ 9 ms over target (delta_role(9., ..) would print 9.0); delta_fmt(6.43, 1, "%", Role::Success) prints ▲ 6.4%.

fnaster_blueprint::ui::components::delta_role

pub fn delta_role(value: impl Into<f64>, unit: impl AsRef<str>, role: design::Role) -> El

[delta] with an explicit colour role (a rising latency is bad: Role::Danger). A zero change is always the neutral – 0% flat in muted ink, whatever the role: nothing moved, so there is no news. The number shows 2 significant digits (9.0); use [delta_fmt] for fixed decimals (9 ms) or [delta_text] for a string you formatted yourself.

fnaster_blueprint::ui::components::delta_text

pub fn delta_text(shown: impl AsRef<str>, direction: impl Into<f64>, role: design::Role) -> El

A delta whose text you formatted yourself (delta_text("9 ms over target", 9., Role::Danger)): shown is printed after the arrow, direction only picks the arrow (positive ▲, negative ▼, zero a neutral –).

fnaster_blueprint::ui::components::divider

pub fn divider() -> El

Horizontal rule across the parent column.

fnaster_blueprint::ui::components::edge_drawer

pub fn edge_drawer(s: &interact::Store, key: impl AsRef<str>, title: impl AsRef<str>, body: impl IntoIterator<Item = El>) -> El

Edge drawer: a panel at the screen edge, shown while Bool key is true. It has the [crate::ui::controls::dialog] behaviour - a scrim over the page, a focus trap, Esc (or the scrim) closes it and the focus goes back where it was - but it sits on an edge of the screen and slides in from it (reduced motion: it is simply there). On Compact screens it becomes a full-width bottom sheet.

body is your own content; put a [clickable] in it to close the drawer.

edge_drawer(s, "detail", "Machine atlas", [text("Debian 12"), clickable("detail.close", "Close")])

fnaster_blueprint::ui::components::edge_drawer_at

pub fn edge_drawer_at(s: &interact::Store, key: impl AsRef<str>, title: impl AsRef<str>, body: impl IntoIterator<Item = El>, place: super::live::Place) -> El

[edge_drawer] at a chosen edge: [Place::Start] (left), [Place::End] (right) or [Place::Bottom] (a full-width bottom sheet). Compact screens always use the bottom sheet.

fnaster_blueprint::ui::components::edge_drawer_full

pub fn edge_drawer_full(s: &interact::Store, key: impl AsRef<str>, title: impl AsRef<str>, body: impl IntoIterator<Item = El>) -> El

[edge_drawer] for a long detail: the panel keeps the full screen height (also as the Compact bottom sheet) and its body scrolls inside it (wheel offset in Scalar <key>.body.scroll, list node <key>.body), so a tall body never leaves the screen. Wide screens still get the right-edge panel.

fnaster_blueprint::ui::components::heading

pub fn heading(title: impl AsRef<str>, subtitle: impl AsRef<str>) -> El

Page/section heading: headline + muted subtitle.

fnaster_blueprint::ui::components::kv_list

pub fn kv_list<K: AsRef<str>, V: AsRef<str>>(pairs: &[(K, V)]) -> El

Key/value rows with hairline dividers: label left (muted), value right.

fnaster_blueprint::ui::components::legend

pub fn legend<L: AsRef<str>>(items: &[(L, design::Role)]) -> El

Legend entry list: dots with labels. One line while it fits; it breaks onto more lines (a wrap) when it does not.

fnaster_blueprint::ui::components::log_list

pub fn log_list<T: AsRef<str>, M: AsRef<str>>(entries: &[(T, M, design::Role)]) -> El

Event log: timestamp, status dot, message per entry.

fnaster_blueprint::ui::components::logo_tile

pub fn logo_tile(initials: impl AsRef<str>, from: design::Role, to: design::Role) -> El

A 36 px rounded gradient tile with a soft inner ring and one or two bold initials, for [El::logo]: logo_tile("A", Role::Warning, Role::Secondary). The initials use the from role's content colour, and the gradient end is fitted so they stay readable in every theme.

fnaster_blueprint::ui::components::meter

pub fn meter(value: impl Into<f64>, role: design::Role) -> El

Progress bar: value is a fraction in 0..=1.

fnaster_blueprint::ui::components::meter_row

pub fn meter_row(label: impl AsRef<str>, value: impl Into<f64>, role: design::Role) -> El

Label, right-aligned percentage and a meter underneath. Replace the right-hand text with .value("1.2 kg") (or hide it with .value("")).

fnaster_blueprint::ui::components::meter_value

pub fn meter_value(value_text: impl AsRef<str>, fraction: impl Into<f64>, role: design::Role) -> El

A meter that grows to fill a row with its value text on the right, no label: meter_value("62%", 0.62, Role::Success). Use it inside cards that already name the quantity.

fnaster_blueprint::ui::components::nav

pub fn nav<I: AsRef<str>>(items: &[I], selected: usize) -> El

Sidebar nav list; selected is the index of the active item. Items are 2 px apart (.gap(1)); loosen with .gap(n) as on any column (nav(&items, 0).gap(4) = 12 px). The list is an ordinary stretched column: it fills the width of its parent inside the parent's padding, so inset it with .pad(n) on the sidebar, not on the nav.

fnaster_blueprint::ui::components::nav_item

pub fn nav_item(label: impl AsRef<str>, selected: bool) -> El

One nav entry: dot + label; the selected one is accent-tinted.

fnaster_blueprint::ui::components::nav_title

pub fn nav_title(title: impl AsRef<str>) -> El

Sidebar section caption (see [caption]).

fnaster_blueprint::ui::components::node_box

pub fn node_box(title: impl AsRef<str>, detail: impl AsRef<str>, role: design::Role) -> El

A pipeline stage box: role accent bar, title, detail line.

fnaster_blueprint::ui::components::panel

pub fn panel(title: impl AsRef<str>, subtitle: impl AsRef<str>, body: impl IntoIterator<Item = El>) -> El

[card] with a title and optional subtitle ("" to omit) above the body.

fnaster_blueprint::ui::components::pill

pub fn pill(label: impl AsRef<str>, role: design::Role) -> El

Solid pill: role fill with its readable On* text colour.

fnaster_blueprint::ui::components::pipeline

pub fn pipeline(columns: Vec<Vec<El>>) -> El

Left-to-right pipeline: each inner Vec is a column of [node_box]es; links with ports and elbows join consecutive columns (1:1, 1:n, n:1, n:n fan). It fills its box by default (grow(1.) along the parent's main axis and stretched across it), so panel("Signal", "", [pipeline(..)]) needs no sizing; .h(px) / .grow(0.) opt out. Ports and wires take the role of the node they belong to (node_box("Fusion", .., Role::Secondary) gets violet ports; an elbow takes the role of the single source, or of the destination for a merge), so colouring the nodes colours the connectors. Each node is centred in an equal cell of its column and ports line up with those centres exactly; see [pipeline_with] for alignment and stagger.

fnaster_blueprint::ui::components::pipeline_with

pub fn pipeline_with(columns: Vec<Vec<El>>, opts: PipelineOpts) -> El

[pipeline] with [PipelineOpts]: pipeline_with(cols, PipelineOpts::new().valign(Align::Start).stagger(0.2)).

fnaster_blueprint::ui::components::row_w

pub fn row_w(items: impl IntoIterator<Item = (f64, El)>) -> El

A row whose children split its width by weight (row_w([(2., chart), (1., load)])) and stretch to the full row height, so side-by-side panels are equally tall. The horizontal twin of [col_w] (.w(0.).grow(weight)).

fnaster_blueprint::ui::components::sparkline

pub fn sparkline<V: Copy + Into<f64>>(values: &[V], role: design::Role) -> El

Tiny column sparkline (last value highlighted), 28 px high by default.

fnaster_blueprint::ui::components::stat

pub fn stat(label: impl AsRef<str>, value: impl AsRef<str>) -> El

Stat tile: caption label over a big value. Append .child(delta(..)), .child(meter(..)) or .child(sparkline(..)).

fnaster_blueprint::ui::components::status

pub fn status(label: impl AsRef<str>, role: design::Role) -> El

Dot + label.

fnaster_blueprint::ui::components::status_dot

pub fn status_dot(role: design::Role) -> El

Small glowing status dot.

fnaster_blueprint::ui::components::table

pub fn table<H: AsRef<str>>(headers: &[H], rows: Vec<Vec<El>>) -> El

Table with a header row and banded rows. Cells are elements ("text".into(), badge(..), ...); every row needs one cell per header. First column is wider.

fnaster_blueprint::ui::components::toggle_chip

pub fn toggle_chip(label: impl AsRef<str>, on: bool) -> El

Toggle-style chip with a status dot: on highlights it in the accent.

fnaster_blueprint::ui::components::vdivider

pub fn vdivider() -> El

Vertical rule inside a row.

fnaster_blueprint::ui::controls::alert

pub fn alert(role: design::Role, title: impl AsRef<str>, body: impl AsRef<str>) -> El

Inline callout for a message about the page: an icon by role (Success a check, Warning a triangle, Danger a cross, anything else an "i"), a bold title and a muted body, on a tint of the role. Heard as an alert (Warning, Danger) or a status (the rest). Append a retry or a link with .child(..); see [alert_dismissible].

fnaster_blueprint::ui::controls::alert_dismissible

pub fn alert_dismissible(s: &interact::Store, key: impl AsRef<str>, role: design::Role, title: impl AsRef<str>, body: impl AsRef<str>) -> El

[alert] with a close button, shown while Bool key is true (.with(key, true)); the button is <key>.close (label "Dismiss") and dismisses it. Escape on the focused button does the same. It fades out and lifts a few px (the theme's exit token, a <key>.ttl countdown on the injected clock: App::advance/settle_all play it out, then key turns false) while the space it held folds shut ([El::collapse_when], wrapper <key>.fold), so the siblings close up instead of jumping; with reduced motion, or without an App, it goes at once. <key>.ttl > 0 means it is leaving.

fnaster_blueprint::ui::controls::checkbox

pub fn checkbox(s: &interact::Store, key: impl AsRef<str>, label: impl AsRef<str>) -> El

Checkbox bound to Bool key.

fnaster_blueprint::ui::controls::checkbox_mixed

pub fn checkbox_mixed(s: &interact::Store, key: impl AsRef<str>, label: impl AsRef<str>, mixed: bool) -> El

[checkbox] with a third, mixed state for a parent box ("select all") over children the app counts itself: while mixed is true it shows a dash and assistive tech hears "mixed"; a press then sets Bool key to true (select everything), otherwise it toggles. key stays the plain Bool.

fnaster_blueprint::ui::controls::data_table

pub fn data_table(s: &interact::Store, key: impl AsRef<str>, cols: &[(&str, f64)], count: usize, row_h: impl Into<f64>, view_h: impl Into<f64>, cell: impl Fn(usize, usize) -> String + 'static) -> El

Virtualised table: header + [list]. cols = (header, width px); cell(row, col) gives the text.

fnaster_blueprint::ui::controls::data_view

pub fn data_view(s: &interact::Store, key: impl AsRef<str>, count: usize, view: impl FnOnce() -> El + 'static) -> DataView

See [DataView].

fnaster_blueprint::ui::controls::dialog

pub fn dialog(s: &interact::Store, key: impl AsRef<str>, title: impl AsRef<str>, body: impl IntoIterator<Item = El>, actions: impl IntoIterator<Item = El>) -> El

Modal dialog shown while Bool key is true: scrim, centred panel, focus trap, Esc/scrim close it. actions are your own clickable elements (e.g. .on_click(Action::set("confirm", false))).

fnaster_blueprint::ui::controls::empty_state

pub fn empty_state(glyph: impl AsRef<str>, title: impl AsRef<str>, hint: impl AsRef<str>) -> El

"Nothing here yet" panel; append a call to action with .child(..).

fnaster_blueprint::ui::controls::empty_state_icon

pub fn empty_state_icon(glyph: super::icons::Icon, title: impl AsRef<str>, hint: impl AsRef<str>) -> El

[empty_state] with a built-in [Icon] in the circle instead of a text glyph: empty_state_icon(Icon::Search, "No matches", "Try another word").

fnaster_blueprint::ui::controls::error_state

pub fn error_state(title: impl AsRef<str>, detail: impl AsRef<str>) -> El

Error panel; append a retry with .child(..).

fnaster_blueprint::ui::controls::filter_chip

pub fn filter_chip(s: &interact::Store, key: impl AsRef<str>, label: impl AsRef<str>) -> El

Filter chip bound to Bool key: a [toggle_chip] that flips it on a press or Space/Enter, is focusable and is heard as a checkbox ("checked" when on). Several chips are several keys; see [filter_chips].

fnaster_blueprint::ui::controls::filter_chips

pub fn filter_chips(s: &interact::Store, prefix: impl AsRef<str>, opts: &[(&str, &str)]) -> El

A wrapping row of [filter_chip]s: each (id, label) option is the Bool <prefix>.<id>. Heard as a group: name it with .label("Kind").

fnaster_blueprint::ui::controls::follow_item

pub fn follow_item(st: &mut interact::Store, id: &str, old_key: impl Fn(usize) -> String, new_count: usize, new_key: impl Fn(usize) -> String) -> bool

Keep the focus on the same item when the order or the contents of a [virtual_grid] or a [shelf] change (a sort, a filter): the tiles are keyed by index, so the focus would stay on the place and meet another item. Call it from the action that changes the data, after the data changed: old_key(i) names the item that sat at index i before, new_key(j) the item at j now, over new_count items. When id ("g", or "lib.2" for the row of a [shelves] page) has the focus, the focus (and <id>.sel) moves to the tile of the same item, which the container then scrolls into view. Returns whether it moved the focus; an item that is gone (filtered out) leaves the focus alone (the container clamps it). A tile the focus is not on is not touched.

fnaster_blueprint::ui::controls::follow_rows

pub fn follow_rows<A: AsRef<str>, B: AsRef<str>>(st: &mut interact::Store, id: &str, old_keys: &[A], new_keys: &[B]) -> bool

Keep the memory of every shelf with its row when the rows of a [shelves] page are inserted, removed or reordered: the shelves are keyed by index (<id>.<row>), so a new shelf at the top would hand its place's sideways offset, remembered column and focus to another shelf. Call it from the action that changes the rows, after they changed: old_keys[r] names the row that sat at index r before, new_keys[j] the row at j now (a name, an id). Each row that is still there takes its offset (<id>.<j>.scroll) and column (<id>.<j>.sel) with it, a new row starts at 0, and when the focus was on a tile of a shelf that is still there it moves to the same tile of the shelf's new place (the page scrolls it into view by itself). Returns whether the focus moved; a shelf that is gone leaves the focus alone (the page clamps it). The vertical offset of the page (<id>.scroll) is not touched.

fnaster_blueprint::ui::controls::hold_button

pub fn hold_button(s: &interact::Store, key: impl AsRef<str>, label: impl AsRef<str>, ms: u32, action: interact::Action) -> El

A button that confirms only when it is held: press and keep the pointer on it (or hold Space or Enter while it has the focus) for ms, and action runs once, as the time runs out. A progress ring and a fill show the hold; letting go earlier cancels and nothing runs. For what is hard to undo (revoke a device, delete a key). Danger toned: [hold_button_role] picks another role.

  • Keys: Scalar <key>.hold (0..1, the progress; four steps under reduced motion, so nothing sweeps) and Bool <key>.holding are written by the app; no key needs initialising. The id is key.
  • Assistive tech: named label, described "Press and hold for 1.5 seconds to confirm"; the app announces "Keep holding to confirm", then "Confirmed" or "Cancelled" in the live region (App::announcements).
  • Assistive tech that only "activates" cannot hold: keyboard users hold Space or Enter, and the description says so.
  • Scripts: app.hold("Revoke", 1500) / app.hold_key(Key::Space, 1500) keep it down for that long on the app clock; a plain click on it is a cancelled press (Cancel(Released)), so click_strict fails instead of passing by accident.
hold_button(s, "revoke", "Hold to revoke", 1500, Action::set("revoked", true))

fnaster_blueprint::ui::controls::hold_button_role

pub fn hold_button_role(s: &interact::Store, key: impl AsRef<str>, role: design::Role, label: impl AsRef<str>, ms: u32, action: interact::Action) -> El

[hold_button] in another role (Role::Warning, Role::Accent).

fnaster_blueprint::ui::controls::list

pub fn list(s: &interact::Store, key: impl AsRef<str>, count: usize, row_h: impl Into<f64>, view_h: impl Into<f64>, row_fn: impl Fn(usize) -> El) -> El

Virtualised, selectable list. Only the visible rows (plus one) are built, so count may be 100k+. Store: Int <key>.sel (-1 = none, init it), Scalar <key>.scroll (px). row(i) builds row i's content. Click selects, Up/Down/Page/Home/End move, wheel scrolls. Rows have ids <key>.row.<i>.

fnaster_blueprint::ui::controls::list_keyed

pub fn list_keyed(s: &interact::Store, key: impl AsRef<str>, count: usize, row_h: impl Into<f64>, view_h: impl Into<f64>, item_key: impl Fn(usize) -> String + 'static, row_fn: impl Fn(usize) -> El) -> El

[list] whose rows have a key of their own (item_key(i): a record id, a file name): the selection is the Text <key>.selkey, not an index, so it follows the item when the list is filtered or re-sorted (the selected row moves, or the selection stays on an item that is filtered out until it comes back), and the rows are <key>.row.<item key>. Up/Down and Page step from the selected item's current place; Home/End pick the first/last. Keys must be unique in the list. <key>.sel still holds the index of the last pick; read the selection from <key>.selkey.

fnaster_blueprint::ui::controls::loading_state

pub fn loading_state(msg: impl AsRef<str>) -> El

Loading panel with three graded dots.

fnaster_blueprint::ui::controls::menu

pub fn menu(s: &interact::Store, key: impl AsRef<str>, label: impl AsRef<str>, items: Vec<(&str, interact::Action)>) -> El

Menu opened from a text trigger; each item runs its [Action] then closes. Store key <key>.open.

fnaster_blueprint::ui::controls::notify

pub fn notify(key: impl AsRef<str>, msg: impl AsRef<str>, ttl_ms: i64) -> interact::Action

Action that raises toast key with msg for ttl_ms (see [toast], App::advance).

fnaster_blueprint::ui::controls::password_field

pub fn password_field(s: &interact::Store, key: impl AsRef<str>, placeholder: impl AsRef<str>) -> TextInput

Password field: the value is masked (••••) in the render and never appears in the UiTree; copy/cut are suppressed; a Show/Hide toggle (<key>.reveal) reveals it.

fnaster_blueprint::ui::controls::radio_group

pub fn radio_group(s: &interact::Store, key: impl AsRef<str>, opts: &[(&str, &str)]) -> El

Radio group: Text key holds the selected value. opts = (value, label). Arrows move and select.

fnaster_blueprint::ui::controls::segmented

pub fn segmented(s: &interact::Store, key: impl AsRef<str>, opts: &[(&str, &str)]) -> El

Segmented control (pill of options): Text key holds the value.

fnaster_blueprint::ui::controls::select

pub fn select(s: &interact::Store, key: impl AsRef<str>, opts: &[(&str, &str)], placeholder: impl AsRef<str>) -> El

Dropdown select: Text key holds the chosen value; opts = (value, label). Enter/Space/Down open, arrows move, a letter jumps to the next option that starts with it (and opens the list), Enter picks, Esc closes. Floats above the screen. The face is at least 180 px wide, so .w(160.) alone cannot make it narrower: use [select_w] for that.

fnaster_blueprint::ui::controls::select_w

pub fn select_w(s: &interact::Store, key: impl AsRef<str>, opts: &[(&str, &str)], placeholder: impl AsRef<str>, min_w: impl Into<f64>) -> El

[select] with a chosen minimum face width in px (the default is 180): select_w(s, "sort", &opts, "Sort", 120.) for a toolbar.

fnaster_blueprint::ui::controls::selectable_text

pub fn selectable_text(s: &interact::Store, key: impl AsRef<str>, value: impl AsRef<str>) -> TextInput

Text a person can select with the pointer or the keyboard and copy (a fingerprint, a command, an address): a read-only, outline-free field that shows value. Drag or Shift-arrows select, Ctrl-A selects all, Ctrl-C copies the selection to the app clipboard; .copy_button() adds a one-click copy of the whole text and .mono() sets it in the monospace face. .multiline(rows) wraps a longer text (a script, a certificate). Needs no store key to be initialised: the text is value. For a label that is only ever read, use text(..).

selectable_text(s, "fp", "SHA256:3f9a...").mono().copy_button().label("CA fingerprint").build()

fnaster_blueprint::ui::controls::setting_row

pub fn setting_row(title: impl AsRef<str>, hint: impl AsRef<str>, control: El) -> El

One settings line: title + hint on the left, the control on the right.

fnaster_blueprint::ui::controls::setting_row_wide

pub fn setting_row_wide(title: impl AsRef<str>, hint: impl AsRef<str>, control: El) -> El

[setting_row] for a wide control (a segmented control, a radio group, a slider): on Compact screens the control moves under the title and hint and takes the full width instead of squeezing the text.

fnaster_blueprint::ui::controls::shelf

pub fn shelf(s: &interact::Store, id: impl AsRef<str>, count: usize, tile_w: impl Into<f64>, tile_h: impl Into<f64>, tile: impl Fn(usize) -> El + 'static) -> Shelf

One horizontally scrolling row of tiles.

The scroll offset is the Scalar <id>.scroll (init it to 0.); the tiles are keyed <id>.<i> and the focused index the Int <id>.sel.

fnaster_blueprint::ui::controls::shelves

pub fn shelves(s: &interact::Store, id: impl AsRef<str>, rows: Vec<(String, usize)>, tile_w: impl Into<f64>, tile_h: impl Into<f64>, tile: impl Fn(usize, usize) -> El + 'static) -> Shelves

A vertically virtualised page of shelves (rows of tiles that scroll sideways).

The page offset is the Scalar <id>.scroll, the offset of a shelf the Scalar <id>.<row>.scroll; the tiles are keyed <id>.<row>.<i> and every shelf is a focus group that remembers its column.

fnaster_blueprint::ui::controls::slider

pub fn slider(s: &interact::Store, key: impl AsRef<str>, min: impl Into<f64>, max: impl Into<f64>, step: impl Into<f64>) -> El

Horizontal slider over Scalar key in min..=max, snapped to step. Click/drag sets the value; arrows step, Page keys step x10, Home/End jump. Give it a width: slider(..).w(240.).

fnaster_blueprint::ui::controls::start_timer

pub fn start_timer(key: impl AsRef<str>, ms: i64) -> interact::Action

Action that sets Bool key and counts it down for ms on the app clock (<key>.ttl); it turns false by itself, and App::on_expire can run an action then. Starting it again restarts the countdown.

fnaster_blueprint::ui::controls::stepper

pub fn stepper(s: &interact::Store, key: impl AsRef<str>, min: i64, max: i64, step: i64) -> El

Number stepper over Int key in min..=max: [-] 3 [+]. Up/Down keys step.

fnaster_blueprint::ui::controls::switch

pub fn switch(s: &interact::Store, key: impl AsRef<str>, label: impl AsRef<str>) -> El

On/off switch bound to Bool key. Whole row (track + label) is the target key.

fnaster_blueprint::ui::controls::tabs

pub fn tabs(s: &interact::Store, key: impl AsRef<str>, opts: &[(&str, &str)]) -> El

Tab strip: Text key holds the selected tab; render the content yourself from s.text(key).

fnaster_blueprint::ui::controls::text_area

pub fn text_area(s: &interact::Store, key: impl AsRef<str>, placeholder: impl AsRef<str>, rows: usize) -> TextInput

Multi-line text area of rows visible lines: wraps, Enter inserts a newline, Up/Down move by visual line, the view scrolls to the caret (and with the wheel).

fnaster_blueprint::ui::controls::text_field

pub fn text_field(s: &interact::Store, key: impl AsRef<str>, placeholder: impl AsRef<str>) -> El

Single-line text field: Text key holds the value, Int <key>.caret / <key>.anchor the caret and selection anchor (chars; anchor -1 = no selection). Editing runs on aster-ui's FieldEditor: typed characters, Backspace/Delete, Left/Right (Ctrl = word), Home/End, Shift extends the selection, Ctrl-A selects all, Ctrl-C/X/V use the app clipboard, Ctrl-Z / Ctrl-Shift-Z undo and redo, IME composition shows underlined, a click places the caret and a drag selects. Placeholder when empty; long text scrolls to its tail. Chain .on_key(Key::Enter, action) for submit. For passwords, text areas, max_length and validation use [text_input].

fnaster_blueprint::ui::controls::text_input

pub fn text_input(s: &interact::Store, key: impl AsRef<str>, placeholder: impl AsRef<str>) -> TextInput

Start a [TextInput] (single line; 240 px intrinsic width that fills a stretching parent or .grow(1.); see the builder methods).

fnaster_blueprint::ui::controls::toast

pub fn toast(s: &interact::Store, key: impl AsRef<str>, role: design::Role) -> El

Toast shown while Bool key is true (initialise it with .with(key, false): a Text/Int key is refused); text in Text <key>.msg. Use [notify] to raise one and App::advance(ms) to expire it.

fnaster_blueprint::ui::controls::toast_action

pub fn toast_action(s: &interact::Store, key: impl AsRef<str>, role: design::Role, label: impl AsRef<str>, action: interact::Action) -> El

[toast] with an action button ("Undo"): <key>.action runs action and closes the toast. Raise it with [notify].

fnaster_blueprint::ui::controls::toast_action_at

pub fn toast_action_at(s: &interact::Store, key: impl AsRef<str>, role: design::Role, place: Place, label: impl AsRef<str>, action: interact::Action) -> El

[toast_action] in a chosen corner or edge (see [toast_at]): toast_action_at(s, "t", Role::Info, Place::TopCenter, "Undo", undo) keeps a phone's toast off the bottom tab bar.

fnaster_blueprint::ui::controls::toast_at

pub fn toast_at(s: &interact::Store, key: impl AsRef<str>, role: design::Role, place: Place) -> El

[toast] in a chosen corner or edge: [Place::BottomEnd] (the default, = BottomRight), [Place::TopEnd], [Place::BottomStart], [Place::TopStart] (the end side is the left one in a right-to-left app, the start side the right one), or the centred [Place::TopCenter] / [Place::BottomCenter]. Any other place centres the toast on the screen.

fnaster_blueprint::ui::controls::tooltip

pub fn tooltip(s: &interact::Store, anchor_key: impl AsRef<str>, tip: impl AsRef<str>) -> El

Tooltip above the element with id anchor_key while it is hovered or focused.

fnaster_blueprint::ui::controls::virtual_grid

pub fn virtual_grid(s: &interact::Store, id: impl AsRef<str>, count: usize, tile_w: impl Into<f64>, tile_h: impl Into<f64>, tile: impl Fn(usize) -> El + 'static) -> VirtualGrid

A virtualised grid of tiles.

The columns follow the width the grid got (or .cols(n), or a minimum tile width in the foundation's units); only the rows in view (plus an overscan) are built, so count may be 100k+. The scroll offset is the Scalar <id>.scroll (init it to 0.); the tiles are keyed <id>.<i> and the focused index is the Int <id>.sel.

fnaster_blueprint::ui::controls::rules::chars

pub fn chars(f: impl Fn(char) -> bool + 'static, msg: impl AsRef<str>) -> Rule

Every character satisfies f (an empty value passes).

fnaster_blueprint::ui::controls::rules::email

pub fn email(msg: impl AsRef<str>) -> Rule

A plausible email address: [email protected], no spaces (an empty value passes).

fnaster_blueprint::ui::controls::rules::max_len

pub fn max_len(n: usize, msg: impl AsRef<str>) -> Rule

At most n characters.

fnaster_blueprint::ui::controls::rules::min_len

pub fn min_len(n: usize, msg: impl AsRef<str>) -> Rule

At least n characters (an empty value passes: combine with [required]).

fnaster_blueprint::ui::controls::rules::number

pub fn number(min: f64, max: f64, msg: impl AsRef<str>) -> Rule

A number in min..=max (an empty value passes).

fnaster_blueprint::ui::controls::rules::pattern

pub fn pattern(mask: impl AsRef<str>, msg: impl AsRef<str>) -> Rule

A mask over the whole value (an empty value passes): # a digit, @ a letter, * any one character, a backslash makes the next mask character literal, anything else matches itself. pattern("##-@@", ..) accepts 12-ab.

fnaster_blueprint::ui::controls::rules::required

pub fn required(msg: impl AsRef<str>) -> Rule

Not empty after trimming.

fnaster_blueprint::ui::data::pagination

pub fn pagination(s: &interact::Store, key: impl AsRef<str>, pages: usize) -> El

Page bar over Int key (0-based current page): previous, numbered pages (with … when there are many) and next. Ids <key>.prev, <key>.next, <key>.p.<n>; Left/Right while a page button is focused move one page.

fnaster_blueprint::ui::deco::code_block

pub fn code_block(src: &str, opts: &CodeOpts, deco: Deco) -> ui::el::El

A code block: a raised surface holding the (scrolling) code, decorated by deco.

The edge fade is part of deco (deco.edge_fade); the presets and [default_deco] set it.

fnaster_blueprint::ui::deco::decorate_text

pub fn decorate_text(e: ui::el::El, base: Option<Style>, deco: Deco) -> ui::el::El

Decorate a text or rich element: the whole-text base style and deco's rules, selectors in characters of the text.

fnaster_blueprint::ui::deco::default_deco

pub fn default_deco() -> Deco

The look of a code block with no preset named: calm theme-role colours.

fnaster_blueprint::ui::deco::role_by_name

pub fn role_by_name(name: &str) -> Option<design::Role>

A theme role by name, with the aliases the view schema accepts.

fnaster_blueprint::ui::deco::cells::normalize

pub fn normalize(src: &str) -> String

Expand tabs (to a multiple of 4 columns), drop \r, so what is lexed is what is drawn.

fnaster_blueprint::ui::deco::cells::resolve

pub fn resolve(src: &str, lang: super::lex::Lang, deco: &super::style::Deco, mode: super::style::Mode) -> Cells

Resolve src as lang with deco's rules for mode.

fnaster_blueprint::ui::deco::layer::decorate

pub fn decorate(el: ui::el::El, sp: std::rc::Rc<Spec>) -> ui::el::El

Decorate el (a text or rich): attach the layers, and the clock when something moves.

fnaster_blueprint::ui::deco::layer::decorate_at

pub fn decorate_at(el: &ui::el::El, sp: &std::rc::Rc<Spec>, t: Option<f64>) -> ui::el::El

Decorate el with the layers at clock time t (none: the still picture). The caller supplies the clock.

fnaster_blueprint::ui::deco::lex::lex

pub fn lex(src: &str, lang: Lang) -> Vec<Tok>

Lex src as lang: spans sorted by start, non-overlapping, never Plain.

fnaster_blueprint::ui::deco::paint::caret_vis

pub fn caret_vis(blink: bool, t: f32) -> f32

A caret's visibility at time t: 1 solid, 0 gone, a short fade between.

fnaster_blueprint::ui::deco::paint::compile

pub fn compile(styles: &[Style], th: &design::Theme, scale: f32, text: [u8; 4], floor: Option<[u8; 4]>) -> Vec<CStyle>

On a light theme a glow is a halo of tinted light on paper: it reads as a smudge unless it is held back, so it is halved.

floor: the surface the text sits on; every text fill is lifted to at least 4.5 : 1 against it, so no preset or colour of the user's can read as low-contrast body text (an outline is flipped to a contrasting tone).

fnaster_blueprint::ui::deco::paint::compile_marks

pub fn compile_marks(marks: &[Mark], th: &design::Theme) -> Vec<CMark>

fnaster_blueprint::ui::deco::paint::dyn_key

pub fn dyn_key(f: &Frame<'_>, t: f32, caret: Option<&CCaret>) -> u64

What the dynamic picture depends on at time t: the wrapped phases of the marching lines and the caret's visibility.

fnaster_blueprint::ui::deco::paint::glow_groups

pub fn glow_groups(cs: &[CStyle]) -> Vec<(Vec<u16>, CGlow)>

The distinct glows of the styles: (style ids, glow) by equal look (pulse aside).

fnaster_blueprint::ui::deco::paint::glow_mask

pub fn glow_mask(f: &Frame<'_>, ids: &[u16], radius: f32) -> Plane

The blurred coverage of the characters whose style is in ids.

fnaster_blueprint::ui::deco::paint::glyph_state

pub fn glyph_state(r: &Reveal, li: usize, col: usize, gi: usize, n: usize, lines: usize, cols: usize) -> GState

The state of the glyph at (line, col), the gi-th of n, p into the reveal.

fnaster_blueprint::ui::deco::paint::lift_contrast

pub fn lift_contrast(c: [u8; 4], bg: [u8; 4], min: f64) -> [u8; 4]

c moved toward white (dark surface) or black (light) until it reads at min : 1 on bg.

fnaster_blueprint::ui::deco::paint::line_period

pub fn line_period(ln: &CLine, em: f32) -> f32

The length of one repeat of a line's pattern in device px (0 for a line that looks the same whatever its phase).

fnaster_blueprint::ui::deco::paint::paint_back

pub fn paint_back(f: &Frame<'_>, marks: &[CMark]) -> Option<ui::fx::Pix>

Bands behind lines, gutter bars and pills.

fnaster_blueprint::ui::deco::paint::paint_band

pub fn paint_band(f: &Frame<'_>, pos: f32, tint: [u8; 4], bar: [u8; 4]) -> ui::fx::Pix

The current-line band behind one line (pos may be between two lines while it eases): one flat, subtle tint like an editor's, and a slim bar in the padding left of the text. No shadow, nothing over the glyphs.

fnaster_blueprint::ui::deco::paint::paint_base

pub fn paint_base(f: &Frame<'_>, o: &BaseOpts<'_>) -> ui::fx::Pix

The glyphs: coloured by their fills, outlined, underlined, revealed, faded at the edge.

fnaster_blueprint::ui::deco::paint::paint_dyn

pub fn paint_dyn(f: &Frame<'_>, t: f32, caret: Option<&CCaret>) -> Option<ui::fx::Pix>

The moving underlines and the caret: a small picture of what changes each frame.

fnaster_blueprint::ui::deco::paint::paint_glow

pub fn paint_glow(masks: &[(CGlow, std::rc::Rc<Plane>)], w: usize, h: usize, pulse_phase: &dyn Fn(&CGlow) -> f32) -> Option<ui::fx::Pix>

The glow picture from its blurred masks: colour, strength and the pulse's level (1 = full).

fnaster_blueprint::ui::deco::paint::paint_sheen

pub fn paint_sheen(f: &Frame<'_>, t: f32) -> Option<(ui::fx::Pix, usize, usize)>

The sheen: a soft band of light over the glyphs whose style shimmers. The picture covers only the band's box: (pixels, x, y) in plane device px; None when the band is resting or off the text.

fnaster_blueprint::ui::deco::paint::q_phase

pub fn q_phase(ln: &CLine, em: f32, t: f32) -> f32

A marching line's phase at time t: wrapped to one repeat and rounded to a quarter pixel, so a marching line is a few dozen pictures that repeat, and the dynamic layer keeps them instead of drawing one per frame.

fnaster_blueprint::ui::deco::paint::reveal_front

pub fn reveal_front(cells: &super::cells::Cells, geo: &Geo, p: f32) -> (usize, usize)

The reveal front for a caret: the (line, col) right after the last revealed glyph, or the start.

fnaster_blueprint::ui::deco::presets::highlight_marks

pub fn highlight_marks(lines: std::ops::Range<usize>) -> Vec<Mark>

The theme-aware look of the highlighted lines: a soft band, a gutter bar and hairlines in the accent.

fnaster_blueprint::ui::deco::presets::preset

pub fn preset(name: &str) -> Option<Deco>

A preset by name (case and -/_ insensitive); None for an unknown name.

fnaster_blueprint::ui::display::avatar_group

pub fn avatar_group(people: &[(&str, design::Role)], max: usize) -> El

Overlapping avatars; more than max collapse into a +N bubble. people = (initials, role). The group is labelled with the count and initials for assistive tech (override with .a11y_label(..)).

fnaster_blueprint::ui::display::kbd

pub fn kbd(key: impl AsRef<str>) -> El

A key cap: kbd("Esc").

fnaster_blueprint::ui::display::kbd_combo

pub fn kbd_combo(keys: &[&str]) -> El

Several key caps in a row: kbd_combo(&["Ctrl", "K"]).

fnaster_blueprint::ui::display::progress_bar

pub fn progress_bar(id: impl AsRef<str>, value: Option<f64>) -> El

Linear progress, 6 px high and as wide as its parent. Some(fraction) is determinate (the bar eases to each new value with the theme NORMAL token); None is indeterminate (a segment that bounces along the track on the injected clock, resting at the start under reduced motion). id must be unique (it tracks the tween); named "Progress" or "Loading" for assistive tech (.a11y_label(..) renames it), with the value as a 0..1 range when determinate.

progress_bar("upload", Some(0.4))
progress_bar("wait", None).a11y_label("Syncing")

fnaster_blueprint::ui::display::progress_bar_role

pub fn progress_bar_role(id: impl AsRef<str>, value: Option<f64>, role: design::Role) -> El

[progress_bar] in another role (Role::Success for done, Role::Danger for failing).

fnaster_blueprint::ui::display::progress_ring

pub fn progress_ring(id: impl AsRef<str>, value: Option<f64>) -> El

Circular progress. Some(fraction) is determinate (the arc eases to each new value with the theme NORMAL token, the centre shows the percent); None is indeterminate (an arc that spins, driven by the injected clock; still under reduced motion). 56 px by default, resize with .size(w, h); .a11y_label(..) names it. id must be unique (it tracks the tween).

progress_ring("up", Some(0.62)).size(80, 80)
progress_ring("wait", None).a11y_label("Loading")

fnaster_blueprint::ui::display::progress_ring_role

pub fn progress_ring_role(id: impl AsRef<str>, value: Option<f64>, role: design::Role) -> El

[progress_ring] in another role (Role::Success for done, Role::Danger for failing).

fnaster_blueprint::ui::display::skeleton

pub fn skeleton(w: impl Into<f64>, h: impl Into<f64>) -> El

A placeholder block (w = 0 fills the width) with a shimmer that sweeps across with the theme SLOW duration x 5 (static under reduced motion).

fnaster_blueprint::ui::display::skeleton_card

pub fn skeleton_card() -> El

Avatar + two lines, the usual list-row placeholder.

fnaster_blueprint::ui::display::skeleton_card_compact

pub fn skeleton_card_compact() -> El

[skeleton_card] sized for a [card_compact]: a smaller avatar and two text lines.

fnaster_blueprint::ui::display::skeleton_chart

pub fn skeleton_chart(h: impl Into<f64>) -> El

A bar chart placeholder, h px high (data_view(..).loading(skeleton_chart(200))): seven shimmering columns standing on a baseline, heard as "Loading chart".

fnaster_blueprint::ui::display::skeleton_circle

pub fn skeleton_circle(d: impl Into<f64>) -> El

A round placeholder (avatar): skeleton_circle(40).

fnaster_blueprint::ui::display::skeleton_list

pub fn skeleton_list(rows: usize) -> El

A list placeholder, rows rows of an avatar and two lines (data_view(..).loading(skeleton_list(6))), heard as "Loading list".

fnaster_blueprint::ui::display::skeleton_text

pub fn skeleton_text(lines: usize) -> El

lines skeleton text lines, the last one shorter.

fnaster_blueprint::ui::display::stat_spark

pub fn stat_spark(label: impl AsRef<str>, value: impl AsRef<str>, change: f64, unit: impl AsRef<str>, series: impl IntoIterator<Item = impl SeriesValue>, role: design::Role) -> El

[stat] with its change and a trend line: stat_spark("Latency", "37 ms", -3.1, "%", &series, Role::Success). The series is any iterable of numbers: &[f64], Vec<i32>, &Vec<f32>, &[u32], an iterator... role colours both the trend line and the change (Role::Success for good news whichever way the number moved, Role::Danger for bad).

fnaster_blueprint::ui::display::timeline

pub fn timeline(items: &[TimelineItem]) -> El

Vertical timeline: a rail with a status node per event, title, time and optional detail.

fnaster_blueprint::ui::field::field

pub fn field(s: &interact::Store, key: impl AsRef<str>, control: impl Into<El>) -> Field

Frame control (a select, date picker, stepper, number input, slider, ...) with .label(..), .hint(..), .required(), .validate(..) and .error(..). key is the id of the control's focusable element, which is the key every one of those controls is built with ("tags.draft" for a tag_input(s, "tags", ..), whose required then means "has a tag"). Text fields have the same options on text_input itself.

fnaster_blueprint::ui::fluidfx::fluid

pub fn fluid(s: &interact::Store, key: &str, spec: FluidSpec) -> super::el::El

An interactive fluid: fills its box with a simulation that the pointer stirs (drag or hover, see [FluidSpec::pointer]) and that the App clock animates. Give it a size (.h(240.), .grow(1.), .cover() inside an overlay) and a unique key, which is also its element id.

overlay([fluid(s, "bg", FluidSpec::ink_pool().rainbow()).cover(), content])

The pointer is read from the store (<key>.px, <key>.py, <key>.pn), so the screen stays a function of the store. Plain Screen renders a still frame.

fnaster_blueprint::ui::fluidfx::fluid_emitters

pub fn fluid_emitters(key: &str, spec: FluidSpec) -> super::el::El

An ambient fluid: the same simulation fed only by the spec's emitters, no pointer, no store. Meant for backgrounds (overlay([fluid_emitters("bg", FluidSpec::smoke()).cover(), content])).

fnaster_blueprint::ui::focus::score

pub fn score(cur: [f64; 4], cand: [f64; 4], dir: Dir) -> Option<(f64, f64, f64)>

How well a candidate box follows dir from the focused box cur: (score, along, overlap). None when the candidate is not in the half-plane of the direction, or when it lies too far across it to be that direction at all.

The score is the distance along the axis plus the weighted offset across it; a candidate that overlaps the focused box across the axis pays nothing for the offset and wins over one that is only near it.

fnaster_blueprint::ui::fx::bloom

pub fn bloom(source: &ui::el::El) -> Bloom

fnaster_blueprint::ui::fx::conic

pub fn conic(cols: impl IntoIterator<Item = impl Into<ui::el::Col>>) -> Conic

fnaster_blueprint::ui::fx::cursor_glow

pub fn cursor_glow(color: impl Into<ui::el::Col>, radius: f64) -> ui::el::El

A soft glow that follows the pointer across the whole screen (put it last in the root overlay). Decorative; absent under reduced motion.

fnaster_blueprint::ui::fx::cursor_glow_blend

pub fn cursor_glow_blend(color: impl Into<ui::el::Col>, radius: f64, mode: aster_ui::BlendMode) -> ui::el::El

[cursor_glow] with an explicit blend mode (cursor_glow is additive).

fnaster_blueprint::ui::fx::distort_below

pub fn distort_below(d: Distort) -> ui::el::El

Distort everything painted before this overlay (put it last in the root overlay to take the whole HUD). A shockwave needs .on(key): a store counter some control bumps; the ring starts at the pointer, or at .at(..).

fnaster_blueprint::ui::fx::flow

pub fn flow(cols: impl IntoIterator<Item = impl Into<ui::el::Col>>) -> Flow

fnaster_blueprint::ui::fx::fog

pub fn fog(f: Fog) -> ui::el::El

A fog element: size it like any decorative layer (.h(..), .size(..), or let it fill an overlay).

fnaster_blueprint::ui::fx::glitch_below

pub fn glitch_below(g: Glitch) -> ui::el::El

Glitch everything painted before this overlay (ambient flicker, or a burst on .on(key)).

fnaster_blueprint::ui::fx::hologram_below

pub fn hologram_below(h: Hologram) -> ui::el::El

A hologram / CRT look over everything painted before this overlay.

fnaster_blueprint::ui::fx::lens_flare

pub fn lens_flare(f: Flare) -> ui::el::El

lens_flare(Flare::new()) as an element.

fnaster_blueprint::ui::fx::light_leak

pub fn light_leak(color: impl Into<ui::el::Col>, at_x: f64, at_y: f64) -> LightLeak

fnaster_blueprint::ui::fx::light_shafts

pub fn light_shafts(l: LightShafts) -> ui::el::El

light_shafts(LightShafts::from(0.7, 0.2)) as an element.

fnaster_blueprint::ui::fx::mesh

pub fn mesh(points: impl IntoIterator<Item = (f64, f64, ui::el::Col)>) -> Mesh

fnaster_blueprint::ui::fx::parallax

pub fn parallax() -> Parallax

parallax().layer(stars, 0.2).layer(nebula, 0.5).layer(hero, -0.3).el().

fnaster_blueprint::ui::fx::particles

pub fn particles(p: Particles) -> ui::el::El

An endless particle field filling its box: overlay([backdrop, particles(Particles::embers())]). Decorative (no semantic node); frozen on one populated frame under reduced motion.

fnaster_blueprint::ui::fx::post_below

pub fn post_below(p: Post) -> ui::el::El

Post-process everything painted before this overlay (put it last in the root overlay). It sees the screen, so it grades the HUD, the glass and the sky together.

fnaster_blueprint::ui::fx::scene3d

pub fn scene3d(scene: Scene3d) -> ui::el::El

A 3D scene as an element. Size it like any element (.w(..), .h(..), .grow(..)); with one side given it keeps the scene's aspect. It is decorative unless the scene has [Scene3d::alt] (or you call .alt(..) on the element).

fnaster_blueprint::ui::fx::shadow_offset

pub fn shadow_offset(az_deg: f64, el_deg: f64, z: f64) -> [f64; 2]

Where the shadow of a shape z px above the ground falls for a light travelling at az_deg and standing el_deg above the surface: z / tan(elevation) px along the travel direction (capped at about 5 z).

fnaster_blueprint::ui::fx::shadow_sigma

pub fn shadow_sigma(z: f64, softness: f64) -> f64

The standard deviation (px) of the penumbra of a shadow cast from height z: a hairline at the contact, wider with height.

fnaster_blueprint::ui::fx::tilt_card

pub fn tilt_card(content: ui::el::El) -> ui::el::El

A tilt card around content with default settings (needs content.id(..)).

fnaster_blueprint::ui::fx::vignette

pub fn vignette(strength: f64, color: impl Into<ui::el::Col>) -> ui::el::El

Darken the edges toward color (usually near-black): strength 0..1.

fnaster_blueprint::ui::fx::atmosphere::bloom

pub fn bloom(source: &ui::el::El) -> Bloom

fnaster_blueprint::ui::fx::atmosphere::bloom_pix

pub fn bloom_pix(src: &super::Pix, threshold: f64, sigma: f64, strength: f64) -> super::Pix

The glow picture for a low-res src: bright pixels, blurred, as a translucent wash.

fnaster_blueprint::ui::fx::atmosphere::light_leak

pub fn light_leak(color: impl Into<ui::el::Col>, at_x: f64, at_y: f64) -> LightLeak

fnaster_blueprint::ui::fx::atmosphere::parallax

pub fn parallax() -> Parallax

parallax().layer(stars, 0.2).layer(nebula, 0.5).layer(hero, -0.3).el().

fnaster_blueprint::ui::fx::atmosphere::vignette

pub fn vignette(strength: f64, color: impl Into<ui::el::Col>) -> ui::el::El

Darken the edges toward color (usually near-black): strength 0..1.

fnaster_blueprint::ui::fx::backdrop::clear_snapshots

pub fn clear_snapshots()

Drop this thread's snapshots.

fnaster_blueprint::ui::fx::backdrop::snapshots_made

pub fn snapshots_made() -> u64

Snapshots rendered on this thread so far (a still screen adds none; for tests and the benches).

fnaster_blueprint::ui::fx::depth::shadow_offset

pub fn shadow_offset(az_deg: f64, el_deg: f64, z: f64) -> [f64; 2]

Where the shadow of a shape z px above the ground falls for a light travelling at az_deg and standing el_deg above the surface: z / tan(elevation) px along the travel direction (capped at about 5 z).

fnaster_blueprint::ui::fx::depth::shadow_sigma

pub fn shadow_sigma(z: f64, softness: f64) -> f64

The standard deviation (px) of the penumbra of a shadow cast from height z: a hairline at the contact, wider with height.

fnaster_blueprint::ui::fx::distort::distort_below

pub fn distort_below(d: Distort) -> ui::el::El

Distort everything painted before this overlay (put it last in the root overlay to take the whole HUD). A shockwave needs .on(key): a store counter some control bumps; the ring starts at the pointer, or at .at(..).

fnaster_blueprint::ui::fx::distort::distort_pix

pub fn distort_pix(src: &super::Pix, scale: f64, n: &NodeDistort) -> super::Pix

Distort a picture the way .distort(..) / .glitch(..) do, for the graph node.

fnaster_blueprint::ui::fx::distort::glitch_below

pub fn glitch_below(g: Glitch) -> ui::el::El

Glitch everything painted before this overlay (ambient flicker, or a burst on .on(key)).

fnaster_blueprint::ui::fx::distort::hologram_below

pub fn hologram_below(h: Hologram) -> ui::el::El

A hologram / CRT look over everything painted before this overlay.

fnaster_blueprint::ui::fx::distort::hologram_pix

pub fn hologram_pix(src: &super::Pix, scale: f64, n: &NodeHolo) -> super::Pix

fnaster_blueprint::ui::fx::distort::set_threads

pub fn set_threads(n: usize)

Worker threads of [warp] (0 = all cores, at most 8). The picture is the same for any count.

fnaster_blueprint::ui::fx::distort::warp

pub fn warp(src: &std::sync::Arc<super::Pix>, plan: &std::sync::Arc<Plan>) -> super::Pix

Re-sample src (device px) through plan. Rows are independent, so they are filled by the pool's workers; the picture is the same for any worker count.

fnaster_blueprint::ui::fx::fog::fog

pub fn fog(f: Fog) -> ui::el::El

A fog element: size it like any decorative layer (.h(..), .size(..), or let it fill an overlay).

fnaster_blueprint::ui::fx::glass::frost

pub fn frost(bg: &super::Pix, lo: f64, g: &Glass, tint: [u8; 4], origin: [f64; 2], size: [f64; 2]) -> super::Pix

Bake the frosted picture for a panel at origin (logical px) from the low-res backdrop bg rendered at lo x the logical size. The result is itself low-res (lo x the panel size); the painter upscales it to device pixels and clips the corners there.

fnaster_blueprint::ui::fx::gradient::conic

pub fn conic(cols: impl IntoIterator<Item = impl Into<ui::el::Col>>) -> Conic

fnaster_blueprint::ui::fx::gradient::flow

pub fn flow(cols: impl IntoIterator<Item = impl Into<ui::el::Col>>) -> Flow

fnaster_blueprint::ui::fx::gradient::mesh

pub fn mesh(points: impl IntoIterator<Item = (f64, f64, ui::el::Col)>) -> Mesh

fnaster_blueprint::ui::fx::gradient2::ensure_text_contrast_over

pub fn ensure_text_contrast_over(text: ui::el::Col, g: &Grad, th: &design::Theme, size: (u32, u32), region: [f64; 4], ratio: f64) -> aster_ui::Srgb8

A text colour readable over gradient g under region: text itself when its worst contrast is already ratio, else text moved in lightness (or white / black) until it is.

fnaster_blueprint::ui::fx::gradient2::fit_contrast

pub fn fit_contrast(fg: [u8; 4], bg: [u8; 4], ratio: f64) -> [u8; 4]

fg moved in OKLab lightness (hue and chroma kept where the gamut allows) until its WCAG contrast against the opaque bg is at least ratio. Unchanged when it already is.

fnaster_blueprint::ui::fx::gradient2::named_enabled

pub fn named_enabled(th: &design::Theme) -> bool

Whether th paints its named gradients: it opted in ([Theme::with_named_gradients], as mission-dusk does) or [opt_in_named] named it on this thread.

fnaster_blueprint::ui::fx::gradient2::oklch

pub fn oklch(l: f64, c: f64, h: f64, alpha: f64) -> ui::el::Col

A colour from OKLCH (l 0..1, c chroma, h degrees), gamut mapped.

fnaster_blueprint::ui::fx::gradient2::opt_in_named

pub fn opt_in_named(theme_name: &str, on: bool)

Let surfaces that ask for a named gradient ([GradFx::grad_surface]) use one in the theme called theme_name (on this thread). Call before building screens.

fnaster_blueprint::ui::fx::gradient2::stop

pub fn stop(at: f64, col: impl Into<ui::el::Col>) -> Stop

A stop at at (0..=1).

fnaster_blueprint::ui::fx::gradient2::theme_gradient

pub fn theme_gradient(th: &design::Theme, token: GradToken) -> Grad

The theme's gradient for token, derived from its accent, secondary and background colours.

fnaster_blueprint::ui::fx::gradient2::theme_gradients

pub fn theme_gradients(th: &design::Theme) -> Vec<(GradToken, Grad)>

Every named gradient of th.

fnaster_blueprint::ui::fx::gradient2::worst_contrast_over

pub fn worst_contrast_over(text: aster_ui::Srgb8, g: &Grad, th: &design::Theme, w: u32, h: u32, region: [f64; 4]) -> f64

The lowest WCAG contrast of text over the part of gradient g under region (box fractions [x, y, w, h]), measured on a w x h px render: the worst point under the text.

fnaster_blueprint::ui::fx::gradient2::color::byte_to_linear

pub fn byte_to_linear(b: u8) -> f32

An sRGB byte to linear light (table).

fnaster_blueprint::ui::fx::gradient2::color::contrast_of

pub fn contrast_of(la: f64, lb: f64) -> f64

WCAG contrast ratio of two relative luminances.

fnaster_blueprint::ui::fx::gradient2::color::gamut_map

pub fn gamut_map(lab: [f64; 3]) -> [f64; 3]

An OKLab colour brought into the sRGB gamut: lightness clamped to 0..=1, then chroma reduced (hue and lightness kept) by bisection until the colour fits, as CSS Color 4's gamut mapping does (without its just-noticeable-difference shortcut, so a mapped colour is always strictly in gamut). Returns linear light.

fnaster_blueprint::ui::fx::gradient2::color::in_gamut

pub fn in_gamut(c: [f64; 3]) -> bool

fnaster_blueprint::ui::fx::gradient2::color::lin_to_oklab

pub fn lin_to_oklab(c: [f64; 3]) -> [f64; 3]

Linear-light RGB to OKLab [L, a, b].

fnaster_blueprint::ui::fx::gradient2::color::lin_to_srgb255

pub fn lin_to_srgb255(v: f32) -> f32

Linear light (0..=1, clamped) to an sRGB-encoded value on 0..=255 as a float (ready to dither): a table of 8192 steps with linear interpolation (error under 0.01 of a level).

fnaster_blueprint::ui::fx::gradient2::color::oklab_to_lin

pub fn oklab_to_lin(c: [f64; 3]) -> [f64; 3]

OKLab to linear-light RGB (may be outside 0..=1: out of the sRGB gamut).

fnaster_blueprint::ui::fx::gradient2::color::oklab_to_lin_f32

pub fn oklab_to_lin_f32(c: [f32; 3]) -> [f32; 3]

The same as [oklab_to_lin] in f32 (the per-pixel path of meshes and freeform fields).

fnaster_blueprint::ui::fx::gradient2::color::oklab_to_oklch

pub fn oklab_to_oklch(c: [f64; 3]) -> [f64; 3]

OKLab to OKLCH [L, C, h°] (h in 0..360; achromatic colours report h = 0).

fnaster_blueprint::ui::fx::gradient2::color::oklch_to_oklab

pub fn oklch_to_oklab(c: [f64; 3]) -> [f64; 3]

fnaster_blueprint::ui::fx::gradient2::color::srgb8_to_lin

pub fn srgb8_to_lin(c: [u8; 4]) -> ([f64; 3], f64)

An sRGB byte colour to linear light [r, g, b] and alpha 0..=1.

fnaster_blueprint::ui::fx::gradient2::color::to_linear

pub fn to_linear(v: f64) -> f64

sRGB transfer, encoded 0..=1 to linear light.

fnaster_blueprint::ui::fx::gradient2::color::to_srgb

pub fn to_srgb(v: f64) -> f64

Linear light to encoded sRGB 0..=1 (unclamped input allowed; the result is clamped).

fnaster_blueprint::ui::fx::gradient2::color::wcag_luminance

pub fn wcag_luminance(lin: [f64; 3]) -> f64

WCAG 2 relative luminance of a linear-light colour.

fnaster_blueprint::ui::fx::gradient2::dither::blue_tile

pub fn blue_tile() -> &'static [f32]

The blue-noise tile: a threshold in 0..1 per pixel, every value (rank + 0.5) / 4096 once.

fnaster_blueprint::ui::fx::gradient2::dither::column_means

pub fn column_means(rows: &[Vec<f32>]) -> Vec<f32>

The column averages of a stack of rows.

fnaster_blueprint::ui::fx::gradient2::dither::ign

pub fn ign(x: u32, y: u32) -> f32

Interleaved gradient noise at a pixel, 0..1.

fnaster_blueprint::ui::fx::gradient2::dither::quantise_row

pub fn quantise_row(src: &[[f32; 4]], thr: &[f32], dst: &mut [u8])

Quantise a row of float sRGB values (0..=255, straight alpha) to bytes with the row's thresholds.

fnaster_blueprint::ui::fx::gradient2::dither::row_thresholds

pub fn row_thresholds(d: Dither, y: u32, w: usize, out: &mut Vec<f32>)

The thresholds of one row (-0.5..0.5, added before rounding), x from 0.

fnaster_blueprint::ui::fx::gradient2::dither::visible_steps

pub fn visible_steps(rows: &[Vec<f32>], min_run: usize) -> usize

Visible bands across a horizontal ramp: every column is averaged over all rows (what the eye integrates over a tall band), and each run of at least min_run columns with the very same average counts as one flat band. A rounded 8-bit ramp is a staircase of such runs; a dithered one has none (its column averages vary smoothly).

fnaster_blueprint::ui::fx::gradient2::field::coarse

pub fn coarse(w: u32, h: u32, budget: usize, max_step: u32) -> (usize, usize)

The coarse grid a smooth field is evaluated on: at most budget samples, and no coarser than every max_step output pixels.

fnaster_blueprint::ui::fx::gradient2::field::finish

pub fn finish(field: Field, w: u32, h: u32, dither: super::dither::Dither) -> super::super::Pix

Upsample a smooth field to w x h (bicubic, premultiplied), dither and quantise. A field already of that size is only quantised.

fnaster_blueprint::ui::fx::gradient2::field::finish_rows

pub fn finish_rows(field: Field, w: u32, h: u32, y0: u32, y1: u32, dither: super::dither::Dither) -> super::super::Pix

Rows y0..y1 of [finish]'s picture, dithered exactly as there (the picture of a band of a field: the rows of the full picture, nothing else computed).

fnaster_blueprint::ui::fx::gradient2::field::shade

pub fn shade(w: u32, h: u32, dither: super::dither::Dither, shade: impl Fn(u32, &mut [[f32; 4]]) + Send + Sync + 'static) -> super::super::Pix

Run shade(y, row) for every row of a w x h picture (the row arrives zeroed), then dither and quantise it.

fnaster_blueprint::ui::fx::gradient2::mesh::lush

pub fn lush(cols: &[ui::el::Col], seed: u64, aspect: f64) -> CoonsMesh

A lush organic mesh from 3-6 colours and a seed: a 4x4 (or 5x4 for wide boxes) grid whose inner nodes wander, whose boundary nodes slide along the edge, whose handles swirl, coloured so that no two neighbours share a colour and the first colour (the ground) is the most common.

fnaster_blueprint::ui::fx::gradient2::procedural::fbm

pub fn fbm(seed: u32, x: f32, y: f32, oct: u32) -> f32

Fractal sum of oct octaves (rotated each octave so the lattice never shows), about -1..1.

fnaster_blueprint::ui::fx::gradient2::procedural::noise

pub fn noise(seed: u32, x: f32, y: f32) -> f32

Gradient noise, about -1..1.

fnaster_blueprint::ui::fx::gradient2::procedural::render

pub fn render(spec: &Spec, lut: &super::ramp::Lut, w: usize, h: usize, bw: f64, bh: f64) -> super::field::Field

Evaluate spec on a w x h grid covering a box of bw x bh logical px, colouring with lut.

fnaster_blueprint::ui::fx::gradient2::ramp::hdr_rolloff

pub fn hdr_rolloff(lin: [f64; 3], g: f64) -> [f64; 3]

A colour lifted g above itself, rolled off towards white where a channel passes 1 (so a glowing stop reads as a hot core instead of clipping to a flat hue).

fnaster_blueprint::ui::fx::gradient2::ramp::lut_cached

pub fn lut_cached(stops: &Stops, th: &design::Theme) -> std::sync::Arc<Lut>

The baked ramp of stops in th, from a small per-thread cache (an animated gradient asks for the same one every frame).

fnaster_blueprint::ui::fx::gradient2::ramp::stop

pub fn stop(at: f64, col: impl Into<ui::el::Col>) -> Stop

A stop at at (0..=1).

fnaster_blueprint::ui::fx::light::alpha_mask

pub fn alpha_mask(src: &super::Pix) -> Mask

Occlusion from a picture's alpha (a silhouette drawn on a transparent clear).

fnaster_blueprint::ui::fx::light::centroid

pub fn centroid(m: &Mask) -> Option<[f64; 2]>

Weighted centroid of an emission mask in mask pixels (None if it is dark).

fnaster_blueprint::ui::fx::light::edge_fade

pub fn edge_fade(at: [f64; 2], soft: f64) -> f64

Intensity factor 0..=1 of a light at fractions (x, y) of the screen: 1 until the light is soft of the way to the edge, then a smooth fade that reaches 0 just outside the screen.

fnaster_blueprint::ui::fx::light::emission_mask

pub fn emission_mask(src: &super::Pix) -> Mask

Emission of a rendered light element: luma times alpha.

fnaster_blueprint::ui::fx::light::flare_pix

pub fn flare_pix(spec: &FlareSpec) -> super::Pix

The flare picture (straight-alpha, additive) at spec.size pixels.

fnaster_blueprint::ui::fx::light::lens_flare

pub fn lens_flare(f: Flare) -> ui::el::El

lens_flare(Flare::new()) as an element.

fnaster_blueprint::ui::fx::light::light_shafts

pub fn light_shafts(l: LightShafts) -> ui::el::El

light_shafts(LightShafts::from(0.7, 0.2)) as an element.

fnaster_blueprint::ui::fx::light::occluder_mask

pub fn occluder_mask(below: &super::Pix, sky: Option<&super::Pix>) -> Mask

What the painter (or a graph node) stands in front of the light: 1 where something sits between the light and the viewer. With a sky (the backdrop alone, same size) an occluder is any pixel that differs from it; without, from the average colour of the picture's border.

fnaster_blueprint::ui::fx::light::occluder_mask_with

pub fn occluder_mask_with(below: &super::Pix, sky: Option<&super::Pix>, thresholds: Option<(f64, f64)>) -> Mask

[occluder_mask] with explicit (lo, hi) difference thresholds (0..1 of full scale): only a clear difference (an opaque panel, not a translucent fog) is an occluder with a high pair.

fnaster_blueprint::ui::fx::light::shaft_geometry

pub fn shaft_geometry(occ: std::sync::Arc<Mask>, emit: Option<std::sync::Arc<Mask>>, win: (i64, i64, u32, u32), s: &ShaftSpec) -> ShaftGeo

The pixels' light before ray streaks: the march of the occluder mask (and emission) toward the light.

fnaster_blueprint::ui::fx::light::shaft_shade

pub fn shaft_shade(g: &std::sync::Arc<ShaftGeo>, s: &ShaftSpec) -> super::Pix

Shade a [ShaftGeo] at the spec's time (ray streaks, colour, alpha).

fnaster_blueprint::ui::fx::light::shafts_pix

pub fn shafts_pix(occ: std::sync::Arc<Mask>, emit: Option<std::sync::Arc<Mask>>, win: (i64, i64, u32, u32), s: &ShaftSpec) -> super::Pix

The shaft picture (straight-alpha colour, additive) for the occluder occ, the optional emitter emit (a light element: rays then start from its shape) and the output window (x0, y0, w, h) in mask pixels.

fnaster_blueprint::ui::fx::light::upscale_par

pub fn upscale_par(src: &std::sync::Arc<super::Pix>, w: u32, h: u32) -> super::Pix

[Pix::upscale] (whose translucent pass already runs its output rows on the pool's workers).

fnaster_blueprint::ui::fx::math::bits

pub fn bits(v: f64) -> u64

f64 bits as a hash word (use for parameters).

fnaster_blueprint::ui::fx::math::blur_rgba

pub fn blur_rgba(buf: &mut [[f32; 4]], w: usize, h: usize, sigma: f64)

Integer 3-pass box blur approximating a Gaussian of sigma px on a premultiplied f32 RGBA buffer (w x h), edges clamped.

fnaster_blueprint::ui::fx::math::clamp01

pub fn clamp01(v: f64) -> f64

fnaster_blueprint::ui::fx::math::hash

pub fn hash(words: &[u64]) -> u64

Hash several words into one key.

fnaster_blueprint::ui::fx::math::lerp

pub fn lerp(a: f64, b: f64, t: f64) -> f64

fnaster_blueprint::ui::fx::math::mix64

pub fn mix64(x: u64) -> u64

SplitMix64 finaliser: a well-mixed 64-bit hash of x.

fnaster_blueprint::ui::fx::math::rand

pub fn rand(seed: u64, index: u64, lane: u64) -> f64

The laneth independent uniform [0, 1) for (seed, index).

fnaster_blueprint::ui::fx::math::rrect_coverage

pub fn rrect_coverage(x: f64, y: f64, w: f64, h: f64, r: f64) -> f64

Coverage 0..=1 of pixel centre (x, y) inside a w x h rounded rectangle of radius r.

fnaster_blueprint::ui::fx::math::rrect_sdf

pub fn rrect_sdf(x: f64, y: f64, w: f64, h: f64, r: f64) -> f64

Signed distance (px, negative inside) to a rounded rectangle centred in w x h.

fnaster_blueprint::ui::fx::math::saturate

pub fn saturate(c: [f32; 3], sat: f32) -> [f32; 3]

Scale saturation of an sRGB triple (1 = unchanged), Rec.709 luma.

fnaster_blueprint::ui::fx::math::smoothstep

pub fn smoothstep(e0: f64, e1: f64, x: f64) -> f64

fnaster_blueprint::ui::fx::math::unit

pub fn unit(h: u64) -> f64

A uniform value in [0, 1) from a hash.

fnaster_blueprint::ui::fx::neu::aurora_at

pub fn aurora_at(a: &Aurora, st: f64, x: f64, y: f64) -> [f64; 3]

The aurora at a point of the page (x, y in logical px from the top-left, st the strength): the page colour with the colour washes of the open lower page, three wide blobs and a handful of small crisp orbs on top. The backdrop paints it sharp; the glass that frosts it samples it blurred, so the orbs go soft exactly where a panel covers them and stay crisp where the page shows: the blur is visible at the edge of every card.

Everything is laid out in logical px from the top-left of a 1440 x 900 page (not as fractions of the window), so the picture behind a panel does not depend on the window size: a resize moves no bake. The upper page, where headings and text sit, stays dim; the lower page, where it is usually open, carries the light.

fnaster_blueprint::ui::fx::neu::backdrop_layer

pub fn backdrop_layer(th: &design::Theme, view: [f64; 2], strength: f64) -> super::Layer

The page backdrop: the aurora, baked once per size (the picture is small and stretched back, so it costs little and never changes). It is painted under the content, so the glass panels have something rich to frost.

fnaster_blueprint::ui::fx::neu::frost_layer

pub fn frost_layer(th: &design::Theme, view: [f64; 2], strength: f64, saturation: f64) -> super::Layer

A frosted glass face: the page aurora under the panel, blurred over a 30 px radius (the crisp orbs of the page go soft), more saturated, a specular band along the top and a soft glow along the edge, so the blur and the lit edge read at the rim of every card.

The backdrop is a still that the skin itself paints, so the face is a pure function of the panel's place on the page: it caches like any static picture and a still screen repaints nothing. (Text and panels under a glass layer are not blurred: glass_below does that, at the cost of a re-render below.)

fnaster_blueprint::ui::fx::neu::grain_layer

pub fn grain_layer(amount: f64) -> super::Layer

A static film grain over a face: baked once, never flickering (a grain that changes would repaint the whole screen every frame).

fnaster_blueprint::ui::fx::neu::inset_layer

pub fn inset_layer(tag: u64, dark: aster_ui::Srgb8, light: aster_ui::Srgb8, blur: f64, offset: f64) -> super::Layer

The debossed inner shadow of a well: dark along the top-left edge, light along the bottom-right one, both fading over blur px.

The band starts inset px inside the shape, so the hairline edge of the well (the one that carries it for WCAG 1.4.11) stays crisp.

fnaster_blueprint::ui::fx::neu::open_page_peak

pub fn open_page_peak(th: &design::Theme, view: [f64; 2], strength: f64) -> aster_ui::Srgb8

The colour the bare page shows in its open lower part that is hardest on an edge: the lightest on a dark theme, the darkest on a light one (the contrast holds of the skin measure an edge against it).

fnaster_blueprint::ui::fx::neu::raised_layer

pub fn raised_layer(light: aster_ui::Srgb8, dark: aster_ui::Srgb8, offset: f64, sigma: f64) -> super::Layer

The extruded shadow pair of a raised surface: a light shadow up-left and a dark one down-right, both in the surface's own hue, both blurred by sigma.

The pair is one effect drawing, so a raised surface costs one bake and one node. The shape knocks the shadows out, so the surface reads as extruded from the page rather than painted on it.

fnaster_blueprint::ui::fx::neu::rim_layer

pub fn rim_layer(strength: f64) -> super::Layer

The 1 px lit rim of a glass face: brighter along the top edge than along the bottom one, so the panel reads as lit from above.

fnaster_blueprint::ui::fx::particles::eval

pub fn eval(p: &Particles, ramp: &super::math::Ramp, life: LifeAt, w: f64, h: f64, i: usize) -> Option<Dot>

Evaluate particle i of p in a w x h box; None when it is not alive.

fnaster_blueprint::ui::fx::particles::particles

pub fn particles(p: Particles) -> ui::el::El

An endless particle field filling its box: overlay([backdrop, particles(Particles::embers())]). Decorative (no semantic node); frozen on one populated frame under reduced motion.

fnaster_blueprint::ui::fx::particles::record_dots

pub fn record_dots(dots: &[Dot], p: &Particles, w: f64, h: f64, scale: f64, clipped: bool) -> Result<std::sync::Arc<aster_ui::Recording>, aster_ui::Error>

Draw dots as sprite commands into one recording for a w x h box at scale.

fnaster_blueprint::ui::fx::pool::bands

pub fn bands<T: Copy + Send + Default + 'static>(out: &Shared<T>, band: usize, limit: usize, f: impl Fn(usize, &mut [T]) + Send + Sync + 'static)

Run f over the bands of out (bands of band elements), at most limit of them at a time, and return when every band has run. f is given the band's index and a scratch to fill; the pool copies the scratch into out. The scratch starts zeroed: a band that writes every element.

fnaster_blueprint::ui::fx::pool::bands_keep

pub fn bands_keep<T: Copy + Send + Default + 'static>(out: &Shared<T>, band: usize, limit: usize, f: impl Fn(usize, &mut [T]) + Send + Sync + 'static)

The same, but each band starts as the output's own band: a picture that is only partly rewritten (the incremental warp) keeps the pixels it does not touch.

fnaster_blueprint::ui::fx::pool::spawn

pub fn spawn<T: Send + 'static>(f: impl FnOnce() -> T + Send + 'static) -> Job<T>

Run f on a pool worker: the caller goes on with its own work and joins the job later.

fnaster_blueprint::ui::fx::post::bands_shaded

pub fn bands_shaded() -> u64

Rows-of-tiles ("bands", 16 rows) that had at least one tile shaded, summed over calls (the older, coarser counter).

fnaster_blueprint::ui::fx::post::clear_post_cache

pub fn clear_post_cache()

Forget the remembered outputs of this thread.

fnaster_blueprint::ui::fx::post::post_below

pub fn post_below(p: Post) -> ui::el::El

Post-process everything painted before this overlay (put it last in the root overlay). It sees the screen, so it grades the HUD, the glass and the sky together.

fnaster_blueprint::ui::fx::post::report_depth

pub fn report_depth(rect: [f64; 4], z: f64)

Called by .depth(z) elements whenever they are painted: where the element is (logical screen px) and its depth. The depth of field by depth reads them when the post bakes (the post is painted after what it covers, so the list is complete by then).

fnaster_blueprint::ui::fx::post::tiles_shaded

pub fn tiles_shaded() -> u64

Tiles (16 rows x 128 px) shaded on this thread so far (a cache hit shades none; for tests and benches).

fnaster_blueprint::ui::fx::post_color::dec_table

pub fn dec_table() -> &'static [f32; 256]

sRGB byte -> linear light.

fnaster_blueprint::ui::fx::post_color::encode_fast

pub fn encode_fast(x: f32) -> f32

Linear light -> sRGB 0..=1 through a table over sqrt(x) (within 1/4000).

fnaster_blueprint::ui::fx::post_color::encode_srgb

pub fn encode_srgb(x: f64) -> f64

Linear light -> sRGB 0..=1 (exact).

fnaster_blueprint::ui::fx::post_color::luma

pub fn luma(c: [f32; 3]) -> f32

fnaster_blueprint::ui::fx::post_film::blue_noise

pub fn blue_noise() -> &'static [u16; 4096]

Fixed 64x64 void-and-cluster threshold ranks; available without first-frame synthesis.

fnaster_blueprint::ui::fx::post_film::cas_planes

pub fn cas_planes(up: &[Vec<f32>; 3], mid: &[Vec<f32>; 3], down: &[Vec<f32>; 3], out: &mut [Vec<f32>; 3], sharp: f32, edge: &[bool])

[cas_row] on planes ([r, g, b] rows of equal length). The row is copied, then the kernel runs, branch-free and so vectorisable, over each run of consecutive edge pixels only (flat stretches are not touched).

fnaster_blueprint::ui::fx::post_film::cas_row

pub fn cas_row(up: &[[f32; 3]], mid: &[[f32; 3]], down: &[[f32; 3]], out: &mut [[f32; 3]], sharp: f32, edge: &[bool])

Contrast-adaptive sharpening (the FSR 1 CAS kernel) of the middle row of three display-space rows. sharp is 0..=1; the kernel backs off where a channel is near 0 or 1, so it does not ring or clip.

fnaster_blueprint::ui::fx::post_film::dither_at

pub fn dither_at(bn: &[u16; 4096], x: usize, y: usize) -> f32

Dither threshold in [-0.5, 0.5) (units of one 8-bit step) for device pixel (x, y).

fnaster_blueprint::ui::fx::post_film::grain_offset

pub fn grain_offset(seed: u64, frame: u32) -> (usize, usize)

Offset of the grain tile for a frame number (frame 0 is the still pattern).

fnaster_blueprint::ui::fx::post_film::grain_tile

pub fn grain_tile(seed: u64) -> std::sync::Arc<Vec<f32>>

fnaster_blueprint::ui::fx::post_film::grain_weight

pub fn grain_weight(l: f32) -> f32

How strongly grain shows at display luminance l: most in the mid-tones, still a little in the shadows and highlights.

fnaster_blueprint::ui::fx::post_lens::barrel

pub fn barrel(src: &Lo, k: f32) -> Lo

Barrel (k > 0) or pincushion (k < 0) distortion that keeps the corners where they are.

fnaster_blueprint::ui::fx::post_lens::bloom_field

pub fn bloom_field(excess: &Lo, levels: usize, spread: f32) -> Lo

The bloom field at the resolution of excess: a mip chain of levels dual-filter downsamples, recombined coarse to fine as fine * (1 - spread) + up(coarse) * spread. The weights sum to one, so the field has the mean of excess: bloom never makes light.

fnaster_blueprint::ui::fx::post_lens::coc

pub fn coc(focus: [f32; 4], range: f32, x: f32, y: f32) -> f32

Circle of confusion 0..=1 of a device pixel: distance outside the focus rectangle [x, y, w, h] over range.

fnaster_blueprint::ui::fx::post_lens::depth_of_field

pub fn depth_of_field(img: &mut Lo, p: &DofParams)

fnaster_blueprint::ui::fx::post_lens::detail_map

pub fn detail_map(rgba: &[u8], w: usize, h: usize, row_hash: &[u64], prev: Option<&DCache>) -> DCache

Detail map of an RGBA8 picture on the eighth-resolution grid (ceil(w/8) x ceil(h/8)): how many strong luma steps (over 40 levels) a row or column of the cell crosses, at most; one step is an edge (a button, a panel: no detail), two or more are strokes (text).

fnaster_blueprint::ui::fx::post_lens::dilate

pub fn dilate(d: &[f32], gw: usize, gh: usize) -> Vec<f32>

Grow the detail by one cell in every direction (the glow next to a word is as harmful as the glow on it).

fnaster_blueprint::ui::fx::post_lens::dirt_cached

pub fn dirt_cached(w: usize, h: usize, seed: u64) -> std::rc::Rc<Vec<f32>>

The cached dirt mask for a size (the mask is made once per size and seed on this thread).

fnaster_blueprint::ui::fx::post_lens::dirt_mask

pub fn dirt_mask(w: usize, h: usize, seed: u64) -> Vec<f32>

Lens dirt: a procedural mask 0..=1 (soft smudges plus dust discs), w x h, deterministic in seed.

fnaster_blueprint::ui::fx::post_lens::down2

pub fn down2(src: &Lo) -> Lo

Dual-filter downsample by two (centre block x4 plus four diagonal blocks, /8): a small blur and no aliasing.

fnaster_blueprint::ui::fx::post_lens::gauss

pub fn gauss(lo: &mut Lo, sigma: f64)

Isotropic blur of a [Lo] (the crate's box-pass Gaussian).

fnaster_blueprint::ui::fx::post_lens::gauss_wide

pub fn gauss_wide(lo: &Lo, sigma: f64) -> Lo

Gaussian blur of sigma px that works at a quarter of the size when the blur is wide (two dual-filter downsamples, blur, bilinear back up).

fnaster_blueprint::ui::fx::post_lens::half_linear

pub fn half_linear(rgba: &[u8], w: usize, h: usize) -> Lo

Half-resolution linear copy of an RGBA8 picture: 2x2 blocks averaged in the encoded domain, then decoded. (Thin bright strokes such as text dilute by 4 and do not reach the bloom threshold; blobs of light do.)

fnaster_blueprint::ui::fx::post_lens::hash_f32_rows

pub fn hash_f32_rows(d: &[[f32; 3]]) -> u64

A cheap content hash of a float image's rows (for the band cache).

fnaster_blueprint::ui::fx::post_lens::hblur

pub fn hblur(lo: &mut Lo, r: usize)

Horizontal-only smoothing with a long kernel (3 box passes of radius r): the anamorphic streak.

fnaster_blueprint::ui::fx::post_lens::motion_blur

pub fn motion_blur(img: &mut Lo, rect: [f32; 4], v: [f32; 2], shutter: f32)

Blur img along v (device px per frame, scaled by shutter) inside rect grown by the blur length.

fnaster_blueprint::ui::fx::post_lens::prefilter

pub fn prefilter(src: &Lo, threshold: f32, knee: f32) -> Lo

Soft-knee luminance threshold: the part of each pixel above threshold, in the pixel's own colour. knee (0..1) widens the transition below the threshold.

fnaster_blueprint::ui::fx::post_lens::quarter_linear

pub fn quarter_linear(rgba: &[u8], w: usize, h: usize, row_hash: &[u64], prev: Option<&QCache>) -> QCache

4x4 blocks averaged in the encoded domain, then decoded. Thin strokes (text, 1-3 px) average below a bloom threshold; blobs of light do not. row_hash is a hash of every source row; q rows whose four source rows hash as in prev are copied.

fnaster_blueprint::ui::fx::post_lens::quarter_of

pub fn quarter_of(f: &Lo) -> Lo

Quarter-resolution copy of a float image (the 4x4 mean).

fnaster_blueprint::ui::fx::post_lens::up_to

pub fn up_to(src: &Lo, w: usize, h: usize) -> Lo

Bilinear upsample to w x h (mean preserving to within the edge clamp).

fnaster_blueprint::ui::fx::scene3d::scene3d

pub fn scene3d(scene: Scene3d) -> ui::el::El

A 3D scene as an element. Size it like any element (.w(..), .h(..), .grow(..)); with one side given it keeps the scene's aspect. It is decorative unless the scene has [Scene3d::alt] (or you call .alt(..) on the element).

fnaster_blueprint::ui::fx::scene3d::mesh::capsule

pub fn capsule(radius: f32, length: f32, segs: usize) -> Mesh

A capsule along y: a cylinder of length between two hemispheres of radius.

fnaster_blueprint::ui::fx::scene3d::mesh::cube

pub fn cube(size: [f32; 3]) -> Mesh

A box size wide, tall and deep with flat faces.

fnaster_blueprint::ui::fx::scene3d::mesh::cylinder

pub fn cylinder(radius: f32, height: f32, segs: usize) -> Mesh

A cylinder along y, capped, of radius and height, centred on the origin.

fnaster_blueprint::ui::fx::scene3d::mesh::extrude

pub fn extrude(contours: &[Vec<P2>], depth: f32, bevel: f32) -> Mesh

Extrude closed contours (any nesting, even-odd) into a solid of depth along z centred on the origin, with a chamfer of bevel on both faces. The 2D points are used as they are (x right, y up).

fnaster_blueprint::ui::fx::scene3d::mesh::extrude_ex

pub fn extrude_ex(contours: &[Vec<P2>], depth: f32, bevel: f32, bulge: f32) -> Mesh

[extrude] with bulge: the cap normals lean outward from the middle of the shape by that much (0.3 is a gentle dome), so a flat face sweeps its reflection across the environment like polished metal. The chamfer of a glyph shrinks where it would fold.

fnaster_blueprint::ui::fx::scene3d::mesh::fit_contours

pub fn fit_contours(contours: &[Vec<P2>], height: f32, y_down: bool) -> Vec<Vec<P2>>

Centre contours on the origin, flip them to y up when they came from pixels (y_down), and scale so the tallest side is height.

fnaster_blueprint::ui::fx::scene3d::mesh::flatten_path

pub fn flatten_path(cmds: &[ui::vector::VectorCommand], tol: f32) -> Vec<Vec<P2>>

Flatten a path (the VectorCommands a Shape is made of) to closed polylines. tol is the flatness in path units.

fnaster_blueprint::ui::fx::scene3d::mesh::mask_contours

pub fn mask_contours(alpha: &[u8], w: usize, h: usize) -> Vec<Vec<P2>>

Trace the 0.5 level of an alpha mask (w x h, row 0 on top) into closed polylines in pixel coordinates, y down.

fnaster_blueprint::ui::fx::scene3d::mesh::parse_obj

pub fn parse_obj(bytes: &[u8]) -> Option<Mesh>

Parse the common subset of Wavefront OBJ: v, vn, f (triangles, quads and polygons, v, v/t, v//n, v/t/n, negative indices). Other statements are ignored. Missing normals are computed with a 50 degree crease. None when there is no face.

fnaster_blueprint::ui::fx::scene3d::mesh::plane

pub fn plane(w: f32, d: f32, n: usize) -> Mesh

A flat plane in xz facing +y, w by d, divided n times along each side (so lights and fog sample it evenly).

fnaster_blueprint::ui::fx::scene3d::mesh::rounded_box

pub fn rounded_box(size: [f32; 3], radius: f32, segs: usize) -> Mesh

A box with rounded edges and corners; radius is clamped to half the smallest side, segs is the facets per corner.

fnaster_blueprint::ui::fx::scene3d::mesh::simplify

pub fn simplify(c: &[P2], eps: f32) -> Vec<P2>

Douglas-Peucker simplification of a closed polygon.

fnaster_blueprint::ui::fx::scene3d::mesh::smooth_contour

pub fn smooth_contour(c: &[P2], passes: usize) -> Vec<P2>

Laplacian smoothing of a closed polyline (removes the stair-steps of a traced mask).

fnaster_blueprint::ui::fx::scene3d::mesh::sphere

pub fn sphere(radius: f32, segs: usize) -> Mesh

A UV sphere of radius.

fnaster_blueprint::ui::fx::scene3d::mesh::torus

pub fn torus(major: f32, minor: f32, segs: usize) -> Mesh

A torus in the xz plane: major is the ring radius, minor the tube radius.

fnaster_blueprint::ui::fx::scene3d::mesh::track_contours

pub fn track_contours(contours: &[Vec<P2>], tracking: f32) -> Vec<Vec<P2>>

Spread the glyphs of a traced line of text: contours are grouped into glyphs (overlapping x ranges belong together, so the dot of an i stays with its stem) and glyph k moves right by k * tracking * height.

fnaster_blueprint::ui::fx::scene3d::mesh::triangulate

pub fn triangulate(outer: &[P2], holes: &[Vec<P2>]) -> (Vec<P2>, Vec<[u32; 3]>)

Triangulate outer (counter-clockwise) minus holes (clockwise). Returns the vertex list used and triangles into it.

fnaster_blueprint::ui::fx::scene3d::render::finish

pub fn finish(scene: &RScene, hdr: &[[f32; 4]], w: usize, h: usize) -> Vec<u8>

Bloom, exposure, tone mapping, sRGB and a deterministic dither: straight-alpha RGBA8. Rows are independent, so they run on scoped threads and the bytes equal a serial run.

fnaster_blueprint::ui::fx::scene3d::render::render

pub fn render(scene: &RScene, w: usize, h: usize) -> Vec<u8>

Result of a render: straight-alpha RGBA8, w * h * 4 bytes.

fnaster_blueprint::ui::fx::scene3d::render::render_hdr

pub fn render_hdr(scene: &RScene, w: usize, h: usize) -> Vec<[f32; 4]>

The scene as premultiplied linear HDR RGBA (the result before bloom and tone mapping).

fnaster_blueprint::ui::fx::scene3d::render::render_live

pub fn render_live(scene: &RScene, w: usize, h: usize, div: usize) -> Vec<u8>

An interactive frame: straight-alpha RGBA8, w x h. Visibility is found at full resolution (one sample per pixel), but shading runs once per surface per div x div cell and the cell values are spread back over the pixels that show the same surface (bilinearly between neighbouring cells that see it), so silhouettes stay as crisp as the pixel grid while the shading cost is a ninth (div 3). The floor reflection is made at the cell resolution. Tone mapping happens per cell value; bloom and dither are left to the settled frame.

fnaster_blueprint::ui::fx::scene3d::vec::add

pub fn add(a: V3, b: V3) -> V3

fnaster_blueprint::ui::fx::scene3d::vec::basis

pub fn basis(d: V3) -> (V3, V3)

An orthonormal basis (right, up) around the unit vector d.

fnaster_blueprint::ui::fx::scene3d::vec::clip

pub fn clip(m: &M4, p: V3) -> [f32; 4]

m * (p, 1) without the divide.

fnaster_blueprint::ui::fx::scene3d::vec::cross

pub fn cross(a: V3, b: V3) -> V3

fnaster_blueprint::ui::fx::scene3d::vec::det3

pub fn det3(m: &M4) -> f32

fnaster_blueprint::ui::fx::scene3d::vec::dir

pub fn dir(m: &M4, p: V3) -> V3

fnaster_blueprint::ui::fx::scene3d::vec::dot

pub fn dot(a: V3, b: V3) -> f32

fnaster_blueprint::ui::fx::scene3d::vec::len

pub fn len(a: V3) -> f32

fnaster_blueprint::ui::fx::scene3d::vec::lerp

pub fn lerp(a: f32, b: f32, t: f32) -> f32

fnaster_blueprint::ui::fx::scene3d::vec::lerp3

pub fn lerp3(a: V3, b: V3, t: f32) -> V3

fnaster_blueprint::ui::fx::scene3d::vec::look_at

pub fn look_at(eye: V3, target: V3, up: V3) -> M4

A right-handed view matrix (camera looks down -z).

fnaster_blueprint::ui::fx::scene3d::vec::matmul

pub fn matmul(a: &M4, b: &M4) -> M4

fnaster_blueprint::ui::fx::scene3d::vec::mul

pub fn mul(a: V3, k: f32) -> V3

fnaster_blueprint::ui::fx::scene3d::vec::mulv

pub fn mulv(a: V3, b: V3) -> V3

fnaster_blueprint::ui::fx::scene3d::vec::norm

pub fn norm(a: V3) -> V3

fnaster_blueprint::ui::fx::scene3d::vec::normal_matrix

pub fn normal_matrix(m: &M4) -> M4

The transform that maps normals: the inverse transpose of the upper 3x3 (as a matrix whose dir is used).

fnaster_blueprint::ui::fx::scene3d::vec::orthographic

pub fn orthographic(height: f32, aspect: f32, near: f32, far: f32) -> M4

Orthographic projection of a view height tall.

fnaster_blueprint::ui::fx::scene3d::vec::perspective

pub fn perspective(fov_y_deg: f32, aspect: f32, near: f32, far: f32) -> M4

Perspective projection to clip space with z in -w..w (OpenGL convention).

fnaster_blueprint::ui::fx::scene3d::vec::point

pub fn point(m: &M4, p: V3) -> V3

fnaster_blueprint::ui::fx::scene3d::vec::reflect

pub fn reflect(i: V3, n: V3) -> V3

fnaster_blueprint::ui::fx::scene3d::vec::rot_x

pub fn rot_x(deg: f32) -> M4

fnaster_blueprint::ui::fx::scene3d::vec::rot_y

pub fn rot_y(deg: f32) -> M4

fnaster_blueprint::ui::fx::scene3d::vec::rot_z

pub fn rot_z(deg: f32) -> M4

fnaster_blueprint::ui::fx::scene3d::vec::sat

pub fn sat(x: f32) -> f32

fnaster_blueprint::ui::fx::scene3d::vec::scaling

pub fn scaling(s: V3) -> M4

fnaster_blueprint::ui::fx::scene3d::vec::smooth

pub fn smooth(e0: f32, e1: f32, x: f32) -> f32

fnaster_blueprint::ui::fx::scene3d::vec::sub

pub fn sub(a: V3, b: V3) -> V3

fnaster_blueprint::ui::fx::scene3d::vec::translation

pub fn translation(t: V3) -> M4

fnaster_blueprint::ui::fx::sky::clear_sky

pub fn clear_sky()

Drop this thread's live sky states.

fnaster_blueprint::ui::fx::sky::tiles_composed

pub fn tiles_composed() -> u64

Tiles composed on this thread so far (for tests and the benches).

fnaster_blueprint::ui::fx::surface::cursor_glow

pub fn cursor_glow(color: impl Into<ui::el::Col>, radius: f64) -> ui::el::El

A soft glow that follows the pointer across the whole screen (put it last in the root overlay). Decorative; absent under reduced motion.

fnaster_blueprint::ui::fx::surface::cursor_glow_blend

pub fn cursor_glow_blend(color: impl Into<ui::el::Col>, radius: f64, mode: aster_ui::BlendMode) -> ui::el::El

[cursor_glow] with an explicit blend mode (cursor_glow is additive).

fnaster_blueprint::ui::fx::surface::tilt_card

pub fn tilt_card(content: ui::el::El) -> ui::el::El

A tilt card around content with default settings (needs content.id(..)).

fnaster_blueprint::ui::fx::surface::tilt_warp

pub fn tilt_warp(src: &super::Pix, k: &Warp) -> super::Pix

Warp src (device px, transparent outside) by a perspective tilt.

Every output row depends only on the source, so rows are filled by a few scoped threads (the result is identical for any thread count, and falls back to one thread when none can start).

fnaster_blueprint::ui::hx::reactive

pub fn reactive(id: &str, build: impl Fn(&mut Hx<'_>) -> super::el::El + 'static) -> super::el::El

An element whose single child is build(hx), rebuilt every frame from the clock, the hover pointer and springs (see [Hx]). Needs an .id() to learn its own box. Without App (a plain Screen) build sees time 0, no pointer and settled springs.

reactive("hero", |hx| match hx.pointer_frac() {
    Some([fx, _]) => text("hovering").color(Role::Accent),
    None => text("idle"),
})

fnaster_blueprint::ui::icons::icon

pub fn icon(i: Icon) -> IconEl

A built-in icon: 20 px, Role::Text, 2-unit stroke.

fnaster_blueprint::ui::icons::icon_named

pub fn icon_named(name: &str) -> IconEl

A built-in icon by name ("search", "chevron-left", aliases close/gear/logout); an unknown name is a refusal that lists the valid ones.

fnaster_blueprint::ui::icons::icon_svg

pub fn icon_svg(path_data: &str) -> IconEl

Your own icon from SVG path data on a 24x24 viewbox (stroke style by default; .filled() fills it).

fnaster_blueprint::ui::icons::icon_svg_view

pub fn icon_svg_view(path_data: &str, viewbox: f64) -> IconEl

Your own icon from SVG path data authored in a square viewbox x viewbox space.

fnaster_blueprint::ui::icons::icon_text

pub fn icon_text(i: Icon, label: impl AsRef<str>) -> super::el::El

Icon (16 px, muted ink) followed by a label: icon_text(Icon::Settings, "Settings").

fnaster_blueprint::ui::icons::nav_icons

pub fn nav_icons<L: AsRef<str>>(items: &[(Icon, L)], selected: usize) -> super::el::El

Sidebar nav list with icons: nav_icons(&[(Icon::Home, "Overview"), ..], selected).

fnaster_blueprint::ui::icons::nav_item_icon

pub fn nav_item_icon(i: Icon, label: impl AsRef<str>, selected: bool) -> super::el::El

One nav entry with an icon instead of the dot; the selected one is accent-tinted.

fnaster_blueprint::ui::image::cached_pictures

pub fn cached_pictures() -> usize

Pictures the content cache holds right now (for tests and diagnostics).

fnaster_blueprint::ui::image::image

pub fn image(pic: &Picture) -> super::el::El

An element that paints pic into its box (see the module docs). Given no size it is as wide as the picture is, at most, and it keeps its shape (aspect) when only one side is given; size it with .w/.h/.size/.grow. Without [ImageExt::alt] it is decorative.

fnaster_blueprint::ui::image::image_png

pub fn image_png(bytes: impl AsRef<[u8]>) -> super::el::El

[image] of PNG bytes, decoded once and found again by content. A file that does not decode shows the "image unavailable" placeholder (named by the error) instead of failing the frame; use [Picture::png] to get the error.

fnaster_blueprint::ui::image::image_rgba

pub fn image_rgba(w: u32, h: u32, pixels: impl AsRef<[u8]>) -> super::el::El

[image] of straight-alpha RGBA8 pixels (w * h * 4 bytes), made once and found again by content on later frames. A size/length mismatch shows the "image unavailable" placeholder instead of failing the frame; use [Picture::rgba] to get the error.

fnaster_blueprint::ui::inputs::civil_from_days

pub fn civil_from_days(z: i64) -> Ymd

Inverse of [days_from_civil].

fnaster_blueprint::ui::inputs::date_picker

pub fn date_picker(s: &interact::Store, key: impl AsRef<str>, today: Ymd) -> DatePicker

Date field with a calendar popup. Text key holds the value ("2026-10-31" or ""), Bool <key>.open, Int <key>.hi the keyboard-highlighted day (set on open). today is passed in (nothing reads a clock). Keys on the field: Enter/Space/Down open; open: arrows move a day / a week, PageUp/PageDown a month, Home/End first/last of the month, Enter/Space picks, Esc closes. Ids: field <key>, <key>.prev/.next, days <key>.day.YYYY-MM-DD.

fnaster_blueprint::ui::inputs::days_from_civil

pub fn days_from_civil((y, m, d): Ymd) -> i64

Days since 1970-01-01 (proleptic Gregorian).

fnaster_blueprint::ui::inputs::days_in_month

pub fn days_in_month(y: i32, m: u32) -> u32

Days in month of year.

fnaster_blueprint::ui::inputs::init_number

pub fn init_number(store: interact::Store, key: &str, v: f64) -> interact::Store

Add the keys a [number_input] needs to store: key = v, <key>.txt = its text.

fnaster_blueprint::ui::inputs::iso

pub fn iso((y, m, d): Ymd) -> String

"2026-10-31".

fnaster_blueprint::ui::inputs::number_input

pub fn number_input(s: &interact::Store, key: impl AsRef<str>, label: impl AsRef<str>, min: f64, max: f64, step: f64) -> El

Editable number with - / + buttons. Scalar key is the committed value, Text <key>.txt the text being edited (initialise both, see [init_number]). The text commits on Enter, blur, the buttons and Up/Down: it is parsed, clamped to min..=max, snapped to step and re-formatted (anything unparsable reverts). Ids <key> (field), <key>.dec, <key>.inc (disabled at the bounds).

fnaster_blueprint::ui::inputs::parse_iso

pub fn parse_iso(t: &str) -> Option<Ymd>

Parse "YYYY-MM-DD".

fnaster_blueprint::ui::inputs::range_slider

pub fn range_slider(s: &interact::Store, key: impl AsRef<str>, label: impl AsRef<str>, min: f64, max: f64, step: f64) -> El

Two-thumb slider: Scalars <key>.lo and <key>.hi in min..=max (lo <= hi), Int <key>.active (0 = low thumb, 1 = high thumb).

Every thumb is a focus stop of its own: Tab reaches the low thumb (id <key>) and then the high one (id <key>.hi). The focused thumb alone moves: Left/Down and Right/Up by step, PageDown/PageUp by ten steps, Home/End to its end of the range - and it never passes the other thumb. Space/Enter swaps the focused thumb. A pointer press or drag moves the nearest thumb. Each thumb has its own label (<label> minimum / <label> maximum) and value, and the focus ring is drawn on the focused thumb. Give it a width: .w(280.).

fnaster_blueprint::ui::inputs::swatch_picker

pub fn swatch_picker(s: &interact::Store, key: impl AsRef<str>, colors: &[(&str, Col)]) -> El

Colour swatch picker: Text key holds the chosen name; colors = (name, colour) where the colour is a role or hex(..). Arrow keys move and select (roving focus), click picks. Ids <key>.<name>.

fnaster_blueprint::ui::inputs::tag_input

pub fn tag_input(s: &interact::Store, key: impl AsRef<str>, placeholder: impl AsRef<str>) -> El

Chip input: text list key holds the tags, Text <key>.draft the one being typed. Enter adds the trimmed draft (ignoring empty and duplicate ones), each chip's x (<key>.rm.<i>) removes it. Backspace in an empty draft highlights the last tag (Int <key>.hi) and a second Backspace removes it; any other key (or typing) drops the highlight without removing anything. The field is <key>.draft.

fnaster_blueprint::ui::kine::body_state

pub fn body_state(id: &str) -> Option<BodyState>

The published state of the body with element id id this frame.

fnaster_blueprint::ui::kine::body_states

pub fn body_states() -> Vec<(String, BodyState)>

Every published body (id order).

fnaster_blueprint::ui::kine::clear_joints

pub fn clear_joints()

Remove every joint declared with [joint].

fnaster_blueprint::ui::kine::drain_emitted

pub fn drain_emitted() -> Vec<Emitted>

Take every field emitted since the last call (the world calls this once per step).

fnaster_blueprint::ui::kine::emit

pub fn emit(at_ms: u64, field: std::rc::Rc<dyn Field>)

Send a field into the world. The world picks it up on its next step.

fnaster_blueprint::ui::kine::joint

pub fn joint(j: Joint)

Join two elements for as long as both exist. Declaring the same joint (same ends and kind) again replaces it.

fnaster_blueprint::ui::kine::live_fields

pub fn live_fields() -> Vec<Emitted>

The fields alive this frame, for consumers that are not bodies (particles, fluid coupling): evaluate field.force(at, None, (now_ms - at_ms) / 1000) while now_ms >= at_ms.

fnaster_blueprint::ui::kine::publish_bodies

pub fn publish_bodies(states: std::collections::BTreeMap<String, BodyState>)

Publish this frame's body states (the world calls this after it steps).

fnaster_blueprint::ui::kine::publish_fields

pub fn publish_fields(f: Vec<Emitted>)

Publish the fields that are alive this frame (the world calls this; core addition to the contract).

fnaster_blueprint::ui::kine::push

pub fn push(i: Impulse)

Queue an impulse for the world's next step.

fnaster_blueprint::ui::kine::push_body

pub fn push_body(id: &str, j: super::V2, at: Option<super::V2>)

A direct hit on one body.

fnaster_blueprint::ui::kine::push_path

pub fn push_path(points: &[super::V2], j: f64, width: f64)

Shove along a polyline (a swipe, a flying shard's path): one [Impulse::Segment] per leg.

fnaster_blueprint::ui::kine::push_radial

pub fn push_radial(at: super::V2, j: f64, radius: f64)

A radial shove (an explosion, a shard landing): see [Impulse::Radial].

fnaster_blueprint::ui::kine::set_bounds

pub fn set_bounds(r: Option<[f64; 4]>)

Keep bodies inside this rectangle [x, y, w, h] (default: the extent of the page's other elements).

fnaster_blueprint::ui::kine::unjoint

pub fn unjoint(j: &Joint)

Remove a joint declared with [joint].

fnaster_blueprint::ui::kine::body::clear_joints

pub fn clear_joints()

Remove every joint declared with [joint].

fnaster_blueprint::ui::kine::body::joint

pub fn joint(j: Joint)

Join two elements for as long as both exist. Declaring the same joint (same ends and kind) again replaces it.

fnaster_blueprint::ui::kine::body::set_bounds

pub fn set_bounds(r: Option<[f64; 4]>)

Keep bodies inside this rectangle [x, y, w, h] (default: the extent of the page's other elements).

fnaster_blueprint::ui::kine::body::unjoint

pub fn unjoint(j: &Joint)

Remove a joint declared with [joint].

fnaster_blueprint::ui::kine::couple::flow_field

pub fn flow_field(key: &str) -> Option<std::rc::Rc<FlowField>>

The flow field of the stirred fluid with key (once its layer has run a frame).

fnaster_blueprint::ui::kine::couple::reset_fluids

pub fn reset_fluids()

Forget every stirred fluid of this thread.

fnaster_blueprint::ui::kine::couple::stirred_fluid

pub fn stirred_fluid(key: &str) -> StirredFluid

A transparent smoke layer that moving elements stir. Place it in an overlay behind or over the page.

fnaster_blueprint::ui::kine::deform::active_fields

pub fn active_fields() -> Vec<super::Emitted>

The fields alive this frame (the world publishes them: [super::live_fields]); lattices, cloth and fragments sample Field::force at their nodes. Jelly::field(..), Cloth::field(..) and Shatter::field(..) add fields of their own.

fnaster_blueprint::ui::kine::deform::strain_matrix

pub fn strain_matrix(a: f64, b: f64) -> [f64; 4]

exp of the traceless symmetric strain [[a, b], [b, -a]]: det == 1 exactly (volume preserving).

fnaster_blueprint::ui::kine::effect::emit_at

pub fn emit_at(at_ms: u64, field: impl Field + 'static)

Emit field into the world at clock time at_ms (a thin wrapper over kine::emit).

fnaster_blueprint::ui::kine::effect::emit_burst_at

pub fn emit_burst_at(at_ms: u64, e: &Emission, origin: super::V2)

Emit an [Emission]'s field started at origin at clock time at_ms (no visible part: that needs the event to come through a click or emits).

fnaster_blueprint::ui::kine::effect::kine_fx

pub fn kine_fx() -> ui::el::El

The effect layer with defaults (no pointer wake).

fnaster_blueprint::ui::kine::field::dir_deg

pub fn dir_deg(deg: f64) -> super::V2

The unit vector pointing deg degrees from +x toward +y (so 90 is down, 180 is left).

fnaster_blueprint::ui::kine::push::push

pub fn push(i: Impulse)

Queue an impulse for the world's next step.

fnaster_blueprint::ui::kine::push::push_body

pub fn push_body(id: &str, j: super::V2, at: Option<super::V2>)

A direct hit on one body.

fnaster_blueprint::ui::kine::push::push_path

pub fn push_path(points: &[super::V2], j: f64, width: f64)

Shove along a polyline (a swipe, a flying shard's path): one [Impulse::Segment] per leg.

fnaster_blueprint::ui::kine::push::push_radial

pub fn push_radial(at: super::V2, j: f64, radius: f64)

A radial shove (an explosion, a shard landing): see [Impulse::Radial].

fnaster_blueprint::ui::kine::shatter::drain_dust

pub fn drain_dust() -> Vec<DustParticle>

Take the particles handed over since the last call (the swarm lane drains this once per step).

fnaster_blueprint::ui::kine::shatter::fragments

pub fn fragments(w: f64, h: f64, pattern: ShatterPattern, impact: super::V2, seed: u64) -> Vec<Fragment>

The fragments of a w x h box cut with pattern, breaking at impact (element-local px).

fnaster_blueprint::ui::kine::solve::collide

pub fn collide(a: &Obb, b: &Obb) -> (super::V2, [Pt; 2], usize)

Box-box collision: the contact normal (A to B) and up to two contact points; empty when apart.

fnaster_blueprint::ui::kine::solve::contact

pub fn contact(d: &[Dyn], a: usize, b: usize, n: super::V2, p: Pt, q: ContactParams) -> Contact

fnaster_blueprint::ui::kine::solve::project_pins

pub fn project_pins(d: &mut [Dyn], links: &[Link])

Pull pinned anchors back together by moving the bodies directly (after the projection pass has pushed bodies apart).

fnaster_blueprint::ui::kine::solve::solve

pub fn solve(d: &mut [Dyn], contacts: &mut [Contact], links: &mut [Link], dt: f64, iters: usize)

Run iters rounds of sequential impulses over contacts and links (the bodies' velocities are updated in place).

fnaster_blueprint::ui::kine::solve::sweep

pub fn sweep(boxes: &[[f64; 4]], order: &mut Vec<usize>, out: &mut Vec<(usize, usize)>, skip: impl FnMut(usize, usize) -> bool)

Candidate pairs by a sweep over x. boxes are [x0, x1, y0, y1]; order is kept between calls (nearly sorted, so the insertion sort is linear). skip(i, j) drops a pair. Pairs come out in a deterministic order.

fnaster_blueprint::ui::kine::swarm::blast

pub fn blast(at: super::V2, radius: f64, speed: f64, body_j: f64)

A blast at at: particles in the air are shoved outward, piles of snow, rain and confetti within radius are blown off the cards they sit on, and bodies get body_j of momentum through kine::push_radial (so the cards themselves jump).

fnaster_blueprint::ui::kine::swarm::burst_at

pub fn burst_at(kind: Kind, x: f64, y: f64)

A burst of kind at a point.

fnaster_blueprint::ui::kine::swarm::emit_field

pub fn emit_field(at_ms: u64, field: std::rc::Rc<dyn Field>)

A force field that moves bodies (through the world) and particles (through every swarm).

fnaster_blueprint::ui::kine::swarm::fountain

pub fn fountain(kind: Kind, x: f64, y: f64, ms: u64)

A steady jet of kind from a point for ms.

fnaster_blueprint::ui::kine::swarm::register_flow

pub fn register_flow(f: std::rc::Rc<dyn Flow>)

Register a flow with every swarm.

fnaster_blueprint::ui::kine::swarm::shower

pub fn shower(s: Shower)

Throw a shower into the page. Call it from an action handler (Action::custom(|_| shower(..))); it starts at the next frame's clock. Reduced motion drops it.

fnaster_blueprint::ui::kine::swarm::shower_at_ms

pub fn shower_at_ms(at_ms: u64, s: Shower)

Like [shower], starting at an explicit clock time (ms).

fnaster_blueprint::ui::kine::swarm_draw::reset_swarms

pub fn reset_swarms()

Forget every swarm of this thread (tests, a new scene).

fnaster_blueprint::ui::kine::swarm_draw::swarm_layer

pub fn swarm_layer() -> SwarmLayer

A full-screen layer that owns a swarm (default key kine.swarm) and paints it. Put it last in the page overlay: overlay([page(s), swarm_layer().el()]).

fnaster_blueprint::ui::kine::swarm_draw::with_swarm

pub fn with_swarm<R>(key: &str, f: impl FnOnce(&mut super::swarm::Swarm) -> R) -> R

Run f on the swarm behind the layer with key (created with the default settings if absent).

fnaster_blueprint::ui::live::nothing

pub fn nothing() -> super::el::El

An element that renders nothing (a closed dialog/popup placeholder).

fnaster_blueprint::ui::live::text_bound

pub fn text_bound(f: impl Fn(&interact::Store) -> String + 'static) -> super::el::El

A text element whose string is a function of the store, evaluated on every render.

fnaster_blueprint::ui::motion::text_number

pub fn text_number(get: impl Fn(&interact::Store) -> f64 + 'static, fmt: impl Fn(f64) -> String + 'static) -> super::el::El

A number shown as text that tweens when get(store) changes (opt-in; use .animate(Prop::Number, ..) to change the default slow/standard transition). fmt renders the in-between values.

text_number(|s| s.scalar("rps"), |v| format!("{v:.0} req/s")).id("rps")

fnaster_blueprint::ui::nav::accordion

pub fn accordion(s: &interact::Store, key: impl AsRef<str>, items: Vec<AccordionItem>) -> El

Accordion where any number of sections can be open: text list <key>.open holds the open ids. Header ids <key>.h.<id>, bodies <key>.body.<id>; Up/Down/Home/End move between headers. A body fades and slides in with the theme ENTER token.

fnaster_blueprint::ui::nav::accordion_single

pub fn accordion_single(s: &interact::Store, key: impl AsRef<str>, items: Vec<AccordionItem>) -> El

[accordion] with at most one open section.

fnaster_blueprint::ui::nav::accordion_single_smooth

pub fn accordion_single_smooth(s: &interact::Store, key: impl AsRef<str>, items: Vec<AccordionItem>) -> El

[accordion_single] that unfolds and folds, see [accordion_smooth].

fnaster_blueprint::ui::nav::accordion_smooth

pub fn accordion_smooth(s: &interact::Store, key: impl AsRef<str>, items: Vec<AccordionItem>) -> El

[accordion] whose sections unfold and fold: the space opens from 0 and closes to 0 over the theme's exit token, so the sections below ease aside instead of jumping ([El::collapse_when], wrapper <key>.fold.<id>). A closing section stays in the tree for that time (Bool <key>.shut.<id>, counted down by a .ttl like alert_dismissible); a body is only visible once its space has opened, so a script advances or settles after the click. Reduced motion is as accordion.

fnaster_blueprint::ui::nav::breadcrumbs

pub fn breadcrumbs(s: &interact::Store, key: impl AsRef<str>, items: &[&str]) -> El

Breadcrumb trail over Int key (index of the current page in items; clicking an earlier crumb sets it, the trail shows items[..=key]). Ids <key>.<i>. A trail longer than three collapses to first / … / last two at the Compact size class, and at any size once its labels (measured) do not fit the width.

fnaster_blueprint::ui::nav::command_palette

pub fn command_palette(s: &interact::Store, key: impl AsRef<str>, cmds: &[Command]) -> El

Command palette modal. Bool key = open, Text <key>.q the query, Int <key>.hi the highlight. Open it with [palette_open] (or Ctrl-K via [with_palette_shortcut]); typing filters the commands fuzzily (matches are emphasised), Up/Down move, Enter (or a click) runs the highlighted command and closes, Esc closes. Rows are <key>.cmd.<command id>, in filtered order.

fnaster_blueprint::ui::nav::fuzzy_match

pub fn fuzzy_match(query: &str, text: &str) -> Option<(i32, Vec<usize>)>

Fuzzy subsequence match of query in text (case-insensitive): Some((score, matched char indices)), higher is better (prefix, word starts and consecutive runs score more); None when some query character is missing. An empty query matches everything with score 0.

fnaster_blueprint::ui::nav::nav_icons_live

pub fn nav_icons_live(s: &interact::Store, key: impl AsRef<str>, items: &[(super::icons::Icon, &str, &str)]) -> El

[nav_live] with an icon per item (the live nav_icons): items = (icon, id, label).

fnaster_blueprint::ui::nav::nav_live

pub fn nav_live(s: &interact::Store, key: impl AsRef<str>, items: &[(&str, &str)]) -> El

Live sidebar nav: a clickable [nav]. items = (id, label). The key is a Text key holding the selected id, or an Int key holding the selected index (whichever the store already has; a missing key counts as Text). Click selects, Up/Down/Home/End move between items when one is focused, Enter/Space activate. Item ids <key>.<item id>; the a11y tree reports navigation > nav-items with their label and selected state.

fnaster_blueprint::ui::nav::palette_close

pub fn palette_close(key: &str) -> interact::Action

Action that closes palette key.

fnaster_blueprint::ui::nav::palette_open

pub fn palette_open(key: &str) -> interact::Action

Action that opens palette key with an empty query (focus goes into its search field).

fnaster_blueprint::ui::nav::tab_bar_live

pub fn tab_bar_live(s: &interact::Store, key: impl AsRef<str>, items: &[(&str, &str)]) -> El

Live bottom/top strip: a clickable tab_bar, equal-width cells, items = (id, label), same key rules as [nav_live]. Left/Right/Home/End move between cells.

fnaster_blueprint::ui::nav::tree_view

pub fn tree_view(s: &interact::Store, key: impl AsRef<str>, roots: &[TreeNode]) -> El

Tree with expandable branches: Text key is the selected node id, text list <key>.open the expanded ids. Click selects (and toggles a branch); with a row focused: Down/Up move, Right expands then enters, Left collapses then goes to the parent, Home/End, Enter/Space toggles. Row ids <key>.n.<node id>.

fnaster_blueprint::ui::nav::with_palette_shortcut

pub fn with_palette_shortcut(root: El, key: impl AsRef<str>) -> El

Make Ctrl-K open palette key app-wide: the shortcut the root declares runs even when nothing has focus, and a modifier chord still reaches it while a text field has focus (needs .id() for hit routing: one is given when missing).

fnaster_blueprint::ui::nav::wizard

pub fn wizard(s: &interact::Store, key: impl AsRef<str>, steps: Vec<WizardStep>) -> Wizard

Start a [Wizard].

fnaster_blueprint::ui::noise::aurora

pub fn aurora<C: Into<super::el::Col>>(colors: impl IntoIterator<Item = C>) -> super::el::El

A slowly drifting aurora of colors (low to high; two to four look best), animated by the clock. Put it behind content: overlay([aurora([..]).cover(), content]).

fnaster_blueprint::ui::noise::grain

pub fn grain(amount: f64) -> super::el::El

A film-grain overlay (0..=1, subtle at 0.08). It flickers at 24 fps while the app animates and holds one frame under reduced motion. Decorative.

fnaster_blueprint::ui::noise::noise_fill

pub fn noise_fill(spec: NoiseSpec) -> super::el::El

Fill the box layout gives it with the noise field. Size it like any element (.h(220), .size(w, h), .grow(1.), or .cover() inside an overlay).

Decorative: not in the UiTree, no label.

fnaster_blueprint::ui::prelude::accordion

pub fn accordion(s: &interact::Store, key: impl AsRef<str>, items: Vec<AccordionItem>) -> El

Accordion where any number of sections can be open: text list <key>.open holds the open ids. Header ids <key>.h.<id>, bodies <key>.body.<id>; Up/Down/Home/End move between headers. A body fades and slides in with the theme ENTER token.

fnaster_blueprint::ui::prelude::accordion_single

pub fn accordion_single(s: &interact::Store, key: impl AsRef<str>, items: Vec<AccordionItem>) -> El

[accordion] with at most one open section.

fnaster_blueprint::ui::prelude::accordion_single_smooth

pub fn accordion_single_smooth(s: &interact::Store, key: impl AsRef<str>, items: Vec<AccordionItem>) -> El

[accordion_single] that unfolds and folds, see [accordion_smooth].

fnaster_blueprint::ui::prelude::accordion_smooth

pub fn accordion_smooth(s: &interact::Store, key: impl AsRef<str>, items: Vec<AccordionItem>) -> El

[accordion] whose sections unfold and fold: the space opens from 0 and closes to 0 over the theme's exit token, so the sections below ease aside instead of jumping ([El::collapse_when], wrapper <key>.fold.<id>). A closing section stays in the tree for that time (Bool <key>.shut.<id>, counted down by a .ttl like alert_dismissible); a body is only visible once its space has opened, so a script advances or settles after the click. Reduced motion is as accordion.

fnaster_blueprint::ui::prelude::alert

pub fn alert(role: design::Role, title: impl AsRef<str>, body: impl AsRef<str>) -> El

Inline callout for a message about the page: an icon by role (Success a check, Warning a triangle, Danger a cross, anything else an "i"), a bold title and a muted body, on a tint of the role. Heard as an alert (Warning, Danger) or a status (the rest). Append a retry or a link with .child(..); see [alert_dismissible].

fnaster_blueprint::ui::prelude::alert_dismissible

pub fn alert_dismissible(s: &interact::Store, key: impl AsRef<str>, role: design::Role, title: impl AsRef<str>, body: impl AsRef<str>) -> El

[alert] with a close button, shown while Bool key is true (.with(key, true)); the button is <key>.close (label "Dismiss") and dismisses it. Escape on the focused button does the same. It fades out and lifts a few px (the theme's exit token, a <key>.ttl countdown on the injected clock: App::advance/settle_all play it out, then key turns false) while the space it held folds shut ([El::collapse_when], wrapper <key>.fold), so the siblings close up instead of jumping; with reduced motion, or without an App, it goes at once. <key>.ttl > 0 means it is leaving.

fnaster_blueprint::ui::prelude::app_bar

pub fn app_bar(title: impl AsRef<str>, subtitle: impl AsRef<str>, right: impl IntoIterator<Item = El>) -> El

Top app bar: title + subtitle on the left, right elements on the right. Optional slots, any order: .logo(logo_tile("A", Role::Warning, Role::Secondary)) before the title and .rule(Role::Accent, Role::Secondary) for a 2 px gradient rule along the bottom edge. The bar is rigid: a header never shrinks in a column that is too short (.shrink(1.) lifts that).

fnaster_blueprint::ui::prelude::area_chart

pub fn area_chart(series: &[Series], labels: &[&str]) -> super::el::El

[line_chart] with a translucent area under every line.

fnaster_blueprint::ui::prelude::aurora

pub fn aurora<C: Into<super::el::Col>>(colors: impl IntoIterator<Item = C>) -> super::el::El

A slowly drifting aurora of colors (low to high; two to four look best), animated by the clock. Put it behind content: overlay([aurora([..]).cover(), content]).

fnaster_blueprint::ui::prelude::autocomplete

pub fn autocomplete(s: &interact::Store, key: impl AsRef<str>, input: super::text_input::TextInput, suggestions: &[&str]) -> El

Wrap a configured [TextInput] (.label(..), .rule(..), ...) so that typing lists the suggestions that fuzzy-match the text, best first, at most six, in a list under the field (<key>.menu, rows <key>.opt.<i>, role option). Down / Up move the highlight (<key>.hi, 1-based, 0 = none; typing drops it; Down also brings the list back after Escape), Enter takes the highlighted one (with none highlighted Enter is left to the field, for a form's submit), Escape closes the list (<key>.shut holds the text it was closed at, so typing opens it again), a click takes a row and the field keeps the focus. Free text stays: the value is whatever is in the field. The field has the flag open while the list shows.

fnaster_blueprint::ui::prelude::avatar

pub fn avatar(initials: impl AsRef<str>, role: design::Role) -> El

Avatar: gradient circle with initials.

fnaster_blueprint::ui::prelude::avatar_group

pub fn avatar_group(people: &[(&str, design::Role)], max: usize) -> El

Overlapping avatars; more than max collapse into a +N bubble. people = (initials, role). The group is labelled with the count and initials for assistive tech (override with .a11y_label(..)).

fnaster_blueprint::ui::prelude::badge

pub fn badge(label: impl AsRef<str>, role: design::Role) -> El

Soft status badge: translucent role fill, role-coloured text.

fnaster_blueprint::ui::prelude::bar_chart

pub fn bar_chart<V: Copy + Into<f64>>(values: &[V], labels: &[&str]) -> super::el::El

Bar chart: values to gradient bars with category labels, a nice 0..max axis with 5 ticks and gridlines, the peak highlighted in Warning with a glow. Negative values hang down from a zero line in Danger (the axis then covers the range and zero, with nice steps). It fills the height its parent gives it (min 120 px); labels may be empty. Add .values() ([ChartExt]) for a value label above every bar.

fnaster_blueprint::ui::prelude::bloom

pub fn bloom(source: &ui::el::El) -> Bloom

fnaster_blueprint::ui::prelude::breadcrumbs

pub fn breadcrumbs(s: &interact::Store, key: impl AsRef<str>, items: &[&str]) -> El

Breadcrumb trail over Int key (index of the current page in items; clicking an earlier crumb sets it, the trail shows items[..=key]). Ids <key>.<i>. A trail longer than three collapses to first / … / last two at the Compact size class, and at any size once its labels (measured) do not fit the width.

fnaster_blueprint::ui::prelude::canvas

pub fn canvas(draw: impl Fn(&design::Theme, f64, f64) -> Vec<Shape> + 'static) -> super::el::El

A custom-paint element: the same as [vector], named for what it is used for. draw(theme, width, height) runs at render time with the box the layout gave the element and returns the shapes (paths, lines, circles, rects; fills and strokes) in logical px inside it; the shapes are prepared once per distinct path and shared by every frame that draws the same bits. Text and bitmaps are separate elements (draw them as siblings in a stack).

fnaster_blueprint::ui::prelude::caption

pub fn caption(title: impl AsRef<str>) -> El

Muted, bold, small uppercase caption for a section inside a card or page (caption("Fleet status")). Use it for a label that introduces a group; plain text(..).style(Type::Caption) is body-sized-down running text (a subtitle, a timestamp), not a heading. Sidebar sections use [nav_title] (the same look).

fnaster_blueprint::ui::prelude::card

pub fn card(children: impl IntoIterator<Item = El>) -> El

Elevated surface: raised fill, large radius, theme elevation 2 (shadow, hairline edge, Mission accent glow), padding and gap from tokens.

fnaster_blueprint::ui::prelude::card_compact

pub fn card_compact(children: impl IntoIterator<Item = El>) -> El

A tighter [card] for two-up grids on a phone: medium radius, one elevation step down, 12 px padding and 8 px gap instead of 20 and 12, so a 150 px column still holds a title, a caption and a meter. Same Card kind: .on_click(..) etc. work alike.

fnaster_blueprint::ui::prelude::checkbox

pub fn checkbox(s: &interact::Store, key: impl AsRef<str>, label: impl AsRef<str>) -> El

Checkbox bound to Bool key.

fnaster_blueprint::ui::prelude::checkbox_mixed

pub fn checkbox_mixed(s: &interact::Store, key: impl AsRef<str>, label: impl AsRef<str>, mixed: bool) -> El

[checkbox] with a third, mixed state for a parent box ("select all") over children the app counts itself: while mixed is true it shows a dash and assistive tech hears "mixed"; a press then sets Bool key to true (select everything), otherwise it toggles. key stays the plain Bool.

fnaster_blueprint::ui::prelude::chip

pub fn chip(label: impl AsRef<str>) -> El

Neutral chip.

fnaster_blueprint::ui::prelude::civil_from_days

pub fn civil_from_days(z: i64) -> Ymd

Inverse of [days_from_civil].

fnaster_blueprint::ui::prelude::clickable

pub fn clickable(id: impl AsRef<str>, label: impl Into<El>) -> El

A clickable action in one call: a padded, rounded, accent-tinted row around label (a &str becomes bold text; an icon or any element works too) with .id(id), .role("button"), .focusable() and the theme's hover, pressed and focus layers. Attach the effect with [El::action], restyle with [El::tone] / [El::ghost]:

clickable("save", "Save").action(Action::set("saved", true))
clickable("del", "Delete").tone(Role::Danger).action(Action::clear("rows"))
clickable("close", icon(Icon::X).size(18).color(Role::TextMuted)).ghost().label("Close").action(..)

This is a convenience wrapper, not a stock Button; .disabled_if(..) and .selected_if(..) apply as usual.

fnaster_blueprint::ui::prelude::col

pub fn col(children: impl IntoIterator<Item = El>) -> El

Vertical stack. Children stretch across the width by default.

fnaster_blueprint::ui::prelude::col_w

pub fn col_w(items: impl IntoIterator<Item = (f64, El)>) -> El

A column whose children split its height by weight with no magic basis: col_w([(10., a), (11., b)]) gives a 10/21 and b 11/21 of the height (after gaps). Each child gets .h(0.).grow(weight), so the share does not depend on content size (a bare .grow(10.) only splits the free space on top of each child's natural height). Content taller than its share overflows it, so keep shares generous. Add .gap(n), .pad(n) as usual.

fnaster_blueprint::ui::prelude::command_palette

pub fn command_palette(s: &interact::Store, key: impl AsRef<str>, cmds: &[Command]) -> El

Command palette modal. Bool key = open, Text <key>.q the query, Int <key>.hi the highlight. Open it with [palette_open] (or Ctrl-K via [with_palette_shortcut]); typing filters the commands fuzzily (matches are emphasised), Up/Down move, Enter (or a click) runs the highlighted command and closes, Esc closes. Rows are <key>.cmd.<command id>, in filtered order.

fnaster_blueprint::ui::prelude::conic

pub fn conic(cols: impl IntoIterator<Item = impl Into<ui::el::Col>>) -> Conic

fnaster_blueprint::ui::prelude::count_up

pub fn count_up(get: impl Fn(&interact::Store) -> f64 + 'static) -> super::el::El

A number that counts up to its value when it first appears (a stat). The value is shown as a whole number with thousands separators.

fnaster_blueprint::ui::prelude::count_up_fmt

pub fn count_up_fmt(get: impl Fn(&interact::Store) -> f64 + 'static, fmt: impl Fn(f64) -> String + 'static) -> super::el::El

A number that counts up to its value when it first appears, shown with your own format.

fnaster_blueprint::ui::prelude::cover

pub fn cover(seed: &str) -> ui::el::El

Generated cover art for a card: a seeded gradient with a motif over it (a sphere, hills, rings or arches).

The seed is usually a title or an id, so every item of a list gets its own picture and the list looks like a shelf of albums instead of a column of grey boxes.

fnaster_blueprint::ui::prelude::cursor_glow

pub fn cursor_glow(color: impl Into<ui::el::Col>, radius: f64) -> ui::el::El

A soft glow that follows the pointer across the whole screen (put it last in the root overlay). Decorative; absent under reduced motion.

fnaster_blueprint::ui::prelude::cursor_glow_blend

pub fn cursor_glow_blend(color: impl Into<ui::el::Col>, radius: f64, mode: aster_ui::BlendMode) -> ui::el::El

[cursor_glow] with an explicit blend mode (cursor_glow is additive).

fnaster_blueprint::ui::prelude::data_table

pub fn data_table(s: &interact::Store, key: impl AsRef<str>, cols: &[(&str, f64)], count: usize, row_h: impl Into<f64>, view_h: impl Into<f64>, cell: impl Fn(usize, usize) -> String + 'static) -> El

Virtualised table: header + [list]. cols = (header, width px); cell(row, col) gives the text.

fnaster_blueprint::ui::prelude::data_view

pub fn data_view(s: &interact::Store, key: impl AsRef<str>, count: usize, view: impl FnOnce() -> El + 'static) -> DataView

See [DataView].

fnaster_blueprint::ui::prelude::date_picker

pub fn date_picker(s: &interact::Store, key: impl AsRef<str>, today: Ymd) -> DatePicker

Date field with a calendar popup. Text key holds the value ("2026-10-31" or ""), Bool <key>.open, Int <key>.hi the keyboard-highlighted day (set on open). today is passed in (nothing reads a clock). Keys on the field: Enter/Space/Down open; open: arrows move a day / a week, PageUp/PageDown a month, Home/End first/last of the month, Enter/Space picks, Esc closes. Ids: field <key>, <key>.prev/.next, days <key>.day.YYYY-MM-DD.

fnaster_blueprint::ui::prelude::days_from_civil

pub fn days_from_civil((y, m, d): Ymd) -> i64

Days since 1970-01-01 (proleptic Gregorian).

fnaster_blueprint::ui::prelude::days_in_month

pub fn days_in_month(y: i32, m: u32) -> u32

Days in month of year.

fnaster_blueprint::ui::prelude::delta

pub fn delta(value: impl Into<f64>, unit: impl AsRef<str>) -> El

Change indicator: green ▲ 6.4% for positive, red ▼ 3.1% for negative, muted – 0% flat for zero.

fnaster_blueprint::ui::prelude::delta_fmt

pub fn delta_fmt(value: impl Into<f64>, decimals: usize, unit: impl AsRef<str>, role: design::Role) -> El

[delta_role] with a fixed number of decimals instead of 2 significant digits: delta_fmt(9., 0, " ms over target", Role::Danger) prints ▲ 9 ms over target (delta_role(9., ..) would print 9.0); delta_fmt(6.43, 1, "%", Role::Success) prints ▲ 6.4%.

fnaster_blueprint::ui::prelude::delta_role

pub fn delta_role(value: impl Into<f64>, unit: impl AsRef<str>, role: design::Role) -> El

[delta] with an explicit colour role (a rising latency is bad: Role::Danger). A zero change is always the neutral – 0% flat in muted ink, whatever the role: nothing moved, so there is no news. The number shows 2 significant digits (9.0); use [delta_fmt] for fixed decimals (9 ms) or [delta_text] for a string you formatted yourself.

fnaster_blueprint::ui::prelude::delta_text

pub fn delta_text(shown: impl AsRef<str>, direction: impl Into<f64>, role: design::Role) -> El

A delta whose text you formatted yourself (delta_text("9 ms over target", 9., Role::Danger)): shown is printed after the arrow, direction only picks the arrow (positive ▲, negative ▼, zero a neutral –).

fnaster_blueprint::ui::prelude::dialog

pub fn dialog(s: &interact::Store, key: impl AsRef<str>, title: impl AsRef<str>, body: impl IntoIterator<Item = El>, actions: impl IntoIterator<Item = El>) -> El

Modal dialog shown while Bool key is true: scrim, centred panel, focus trap, Esc/scrim close it. actions are your own clickable elements (e.g. .on_click(Action::set("confirm", false))).

fnaster_blueprint::ui::prelude::distort_below

pub fn distort_below(d: Distort) -> ui::el::El

Distort everything painted before this overlay (put it last in the root overlay to take the whole HUD). A shockwave needs .on(key): a store counter some control bumps; the ring starts at the pointer, or at .at(..).

fnaster_blueprint::ui::prelude::divider

pub fn divider() -> El

Horizontal rule across the parent column.

fnaster_blueprint::ui::prelude::donut_chart

pub fn donut_chart<L: AsRef<str>, V: Copy + Into<f64>>(items: &[(L, V)], centre: &str) -> super::el::El

Donut chart: ring slices (clockwise from 12 o'clock), a centre label (empty for none; a \n starts a muted caption line) and a legend with value and percent. Values must be >= 0 and not all 0.

fnaster_blueprint::ui::prelude::drawer

pub fn drawer(s: &interact::Store, key: impl AsRef<str>, title: impl AsRef<str>) -> Collapse

The compact-screen sidebar replacement with a menu button: Bool key toggles the sidebar open.

fnaster_blueprint::ui::prelude::edge_drawer

pub fn edge_drawer(s: &interact::Store, key: impl AsRef<str>, title: impl AsRef<str>, body: impl IntoIterator<Item = El>) -> El

Edge drawer: a panel at the screen edge, shown while Bool key is true. It has the [crate::ui::controls::dialog] behaviour - a scrim over the page, a focus trap, Esc (or the scrim) closes it and the focus goes back where it was - but it sits on an edge of the screen and slides in from it (reduced motion: it is simply there). On Compact screens it becomes a full-width bottom sheet.

body is your own content; put a [clickable] in it to close the drawer.

edge_drawer(s, "detail", "Machine atlas", [text("Debian 12"), clickable("detail.close", "Close")])

fnaster_blueprint::ui::prelude::edge_drawer_at

pub fn edge_drawer_at(s: &interact::Store, key: impl AsRef<str>, title: impl AsRef<str>, body: impl IntoIterator<Item = El>, place: super::live::Place) -> El

[edge_drawer] at a chosen edge: [Place::Start] (left), [Place::End] (right) or [Place::Bottom] (a full-width bottom sheet). Compact screens always use the bottom sheet.

fnaster_blueprint::ui::prelude::edge_drawer_full

pub fn edge_drawer_full(s: &interact::Store, key: impl AsRef<str>, title: impl AsRef<str>, body: impl IntoIterator<Item = El>) -> El

[edge_drawer] for a long detail: the panel keeps the full screen height (also as the Compact bottom sheet) and its body scrolls inside it (wheel offset in Scalar <key>.body.scroll, list node <key>.body), so a tall body never leaves the screen. Wide screens still get the right-edge panel.

fnaster_blueprint::ui::prelude::empty_art

pub fn empty_art(kind: EmptyState) -> ui::el::El

A generated empty-state illustration, in the theme's colours.

The picture is drawn as vectors, so it is crisp at any size and costs one path per shape.

use aster_blueprint::ui::prelude::*;
let art = empty_art(EmptyState::Search).size(160., 160.);

fnaster_blueprint::ui::prelude::empty_state

pub fn empty_state(glyph: impl AsRef<str>, title: impl AsRef<str>, hint: impl AsRef<str>) -> El

"Nothing here yet" panel; append a call to action with .child(..).

fnaster_blueprint::ui::prelude::empty_state_icon

pub fn empty_state_icon(glyph: super::icons::Icon, title: impl AsRef<str>, hint: impl AsRef<str>) -> El

[empty_state] with a built-in [Icon] in the circle instead of a text glyph: empty_state_icon(Icon::Search, "No matches", "Try another word").

fnaster_blueprint::ui::prelude::ensure_text_contrast_over

pub fn ensure_text_contrast_over(text: ui::el::Col, g: &Grad, th: &design::Theme, size: (u32, u32), region: [f64; 4], ratio: f64) -> aster_ui::Srgb8

A text colour readable over gradient g under region: text itself when its worst contrast is already ratio, else text moved in lightness (or white / black) until it is.

fnaster_blueprint::ui::prelude::error_state

pub fn error_state(title: impl AsRef<str>, detail: impl AsRef<str>) -> El

Error panel; append a retry with .child(..).

fnaster_blueprint::ui::prelude::field

pub fn field(s: &interact::Store, key: impl AsRef<str>, control: impl Into<El>) -> Field

Frame control (a select, date picker, stepper, number input, slider, ...) with .label(..), .hint(..), .required(), .validate(..) and .error(..). key is the id of the control's focusable element, which is the key every one of those controls is built with ("tags.draft" for a tag_input(s, "tags", ..), whose required then means "has a tag"). Text fields have the same options on text_input itself.

fnaster_blueprint::ui::prelude::filter_chip

pub fn filter_chip(s: &interact::Store, key: impl AsRef<str>, label: impl AsRef<str>) -> El

Filter chip bound to Bool key: a [toggle_chip] that flips it on a press or Space/Enter, is focusable and is heard as a checkbox ("checked" when on). Several chips are several keys; see [filter_chips].

fnaster_blueprint::ui::prelude::filter_chips

pub fn filter_chips(s: &interact::Store, prefix: impl AsRef<str>, opts: &[(&str, &str)]) -> El

A wrapping row of [filter_chip]s: each (id, label) option is the Bool <prefix>.<id>. Heard as a group: name it with .label("Kind").

fnaster_blueprint::ui::prelude::flow

pub fn flow(cols: impl IntoIterator<Item = impl Into<ui::el::Col>>) -> Flow

fnaster_blueprint::ui::prelude::fluid

pub fn fluid(s: &interact::Store, key: &str, spec: FluidSpec) -> super::el::El

An interactive fluid: fills its box with a simulation that the pointer stirs (drag or hover, see [FluidSpec::pointer]) and that the App clock animates. Give it a size (.h(240.), .grow(1.), .cover() inside an overlay) and a unique key, which is also its element id.

overlay([fluid(s, "bg", FluidSpec::ink_pool().rainbow()).cover(), content])

The pointer is read from the store (<key>.px, <key>.py, <key>.pn), so the screen stays a function of the store. Plain Screen renders a still frame.

fnaster_blueprint::ui::prelude::fluid_emitters

pub fn fluid_emitters(key: &str, spec: FluidSpec) -> super::el::El

An ambient fluid: the same simulation fed only by the spec's emitters, no pointer, no store. Meant for backgrounds (overlay([fluid_emitters("bg", FluidSpec::smoke()).cover(), content])).

fnaster_blueprint::ui::prelude::fog

pub fn fog(f: Fog) -> ui::el::El

A fog element: size it like any decorative layer (.h(..), .size(..), or let it fill an overlay).

fnaster_blueprint::ui::prelude::fold_split

pub fn fold_split(a: super::el::El, b: super::el::El) -> super::el::El

The two panes of a fold split: a on one side of the hinge, b on the other. A vertical hinge puts them side by side, a horizontal one above and below. The panes are laid out with the layout primitives (a grid with named areas): the hinge gets a band of its own, so no content is ever under it.

The hinge is measured in surface coordinates, so the split belongs at the surface origin (the root of the screen, without padding of its own); nested deeper, the panes take the space of their own box and the hinge no longer lines up.

Without a fold the panes fall back to a row (side by side); use [fold_split_or] to choose the fallback yourself.

fnaster_blueprint::ui::prelude::fold_split_or

pub fn fold_split_or(a: super::el::El, b: super::el::El, fallback: impl Fn(super::el::El, super::el::El) -> super::el::El + 'static) -> super::el::El

[fold_split], with the tree that is used when the surface has no fold. The fallback is built from the two panes, so they are not lost: |a, b| col([a, b]).

fnaster_blueprint::ui::prelude::follow_item

pub fn follow_item(st: &mut interact::Store, id: &str, old_key: impl Fn(usize) -> String, new_count: usize, new_key: impl Fn(usize) -> String) -> bool

Keep the focus on the same item when the order or the contents of a [virtual_grid] or a [shelf] change (a sort, a filter): the tiles are keyed by index, so the focus would stay on the place and meet another item. Call it from the action that changes the data, after the data changed: old_key(i) names the item that sat at index i before, new_key(j) the item at j now, over new_count items. When id ("g", or "lib.2" for the row of a [shelves] page) has the focus, the focus (and <id>.sel) moves to the tile of the same item, which the container then scrolls into view. Returns whether it moved the focus; an item that is gone (filtered out) leaves the focus alone (the container clamps it). A tile the focus is not on is not touched.

fnaster_blueprint::ui::prelude::follow_rows

pub fn follow_rows<A: AsRef<str>, B: AsRef<str>>(st: &mut interact::Store, id: &str, old_keys: &[A], new_keys: &[B]) -> bool

Keep the memory of every shelf with its row when the rows of a [shelves] page are inserted, removed or reordered: the shelves are keyed by index (<id>.<row>), so a new shelf at the top would hand its place's sideways offset, remembered column and focus to another shelf. Call it from the action that changes the rows, after they changed: old_keys[r] names the row that sat at index r before, new_keys[j] the row at j now (a name, an id). Each row that is still there takes its offset (<id>.<j>.scroll) and column (<id>.<j>.sel) with it, a new row starts at 0, and when the focus was on a tile of a shelf that is still there it moves to the same tile of the shelf's new place (the page scrolls it into view by itself). Returns whether the focus moved; a shelf that is gone leaves the focus alone (the page clamps it). The vertical offset of the page (<id>.scroll) is not touched.

fnaster_blueprint::ui::prelude::fuzzy_match

pub fn fuzzy_match(query: &str, text: &str) -> Option<(i32, Vec<usize>)>

Fuzzy subsequence match of query in text (case-insensitive): Some((score, matched char indices)), higher is better (prefix, word starts and consecutive runs score more); None when some query character is missing. An empty query matches everything with score 0.

fnaster_blueprint::ui::prelude::glitch_below

pub fn glitch_below(g: Glitch) -> ui::el::El

Glitch everything painted before this overlay (ambient flicker, or a burst on .on(key)).

fnaster_blueprint::ui::prelude::grain

pub fn grain(amount: f64) -> super::el::El

A film-grain overlay (0..=1, subtle at 0.08). It flickers at 24 fps while the app animates and holds one frame under reduced motion. Decorative.

fnaster_blueprint::ui::prelude::grid

pub fn grid(columns: usize, children: impl IntoIterator<Item = El>) -> El

columns equal 1fr columns, children placed row-major.

fnaster_blueprint::ui::prelude::grid_auto

pub fn grid_auto(min_col_w: impl Into<f64>, children: impl IntoIterator<Item = super::el::El>) -> super::el::El

A grid whose column count follows the available width: as many columns of at least min_col_w px as fit (1 at minimum, never more than there are children). .gap(n) counts.

fnaster_blueprint::ui::prelude::grid_tracks

pub fn grid_tracks(tracks: impl IntoIterator<Item = layout::Track>, children: impl IntoIterator<Item = El>) -> El

Grid with explicit tracks: grid_tracks([Track::Px(240.), Track::Fr(1.)], ..).

fnaster_blueprint::ui::prelude::grouped_bar_chart

pub fn grouped_bar_chart(series: &[Series], labels: &[&str]) -> super::el::El

Grouped bar chart: one bar per series side by side inside every category, a shared nice 0..max axis with gridlines, a legend for 2+ series. Values must be >= 0. .values() labels every bar; .no_legend(), .tick_px(..).

fnaster_blueprint::ui::prelude::hbar_chart

pub fn hbar_chart<V: Copy + Into<f64>>(values: &[V], labels: &[&str]) -> super::el::El

Horizontal bar chart: one row per value (label, bar, value). labels may be empty. Negative values hang left from a zero line in Danger.

fnaster_blueprint::ui::prelude::heading

pub fn heading(title: impl AsRef<str>, subtitle: impl AsRef<str>) -> El

Page/section heading: headline + muted subtitle.

fnaster_blueprint::ui::prelude::hex

pub const fn hex(rgb: u32) -> aster_ui::Srgb8

Opaque color from 0xRRGGBB.

fnaster_blueprint::ui::prelude::hold_button

pub fn hold_button(s: &interact::Store, key: impl AsRef<str>, label: impl AsRef<str>, ms: u32, action: interact::Action) -> El

A button that confirms only when it is held: press and keep the pointer on it (or hold Space or Enter while it has the focus) for ms, and action runs once, as the time runs out. A progress ring and a fill show the hold; letting go earlier cancels and nothing runs. For what is hard to undo (revoke a device, delete a key). Danger toned: [hold_button_role] picks another role.

  • Keys: Scalar <key>.hold (0..1, the progress; four steps under reduced motion, so nothing sweeps) and Bool <key>.holding are written by the app; no key needs initialising. The id is key.
  • Assistive tech: named label, described "Press and hold for 1.5 seconds to confirm"; the app announces "Keep holding to confirm", then "Confirmed" or "Cancelled" in the live region (App::announcements).
  • Assistive tech that only "activates" cannot hold: keyboard users hold Space or Enter, and the description says so.
  • Scripts: app.hold("Revoke", 1500) / app.hold_key(Key::Space, 1500) keep it down for that long on the app clock; a plain click on it is a cancelled press (Cancel(Released)), so click_strict fails instead of passing by accident.
hold_button(s, "revoke", "Hold to revoke", 1500, Action::set("revoked", true))

fnaster_blueprint::ui::prelude::hold_button_role

pub fn hold_button_role(s: &interact::Store, key: impl AsRef<str>, role: design::Role, label: impl AsRef<str>, ms: u32, action: interact::Action) -> El

[hold_button] in another role (Role::Warning, Role::Accent).

fnaster_blueprint::ui::prelude::hologram_below

pub fn hologram_below(h: Hologram) -> ui::el::El

A hologram / CRT look over everything painted before this overlay.

fnaster_blueprint::ui::prelude::icon

pub fn icon(i: Icon) -> IconEl

A built-in icon: 20 px, Role::Text, 2-unit stroke.

fnaster_blueprint::ui::prelude::icon_named

pub fn icon_named(name: &str) -> IconEl

A built-in icon by name ("search", "chevron-left", aliases close/gear/logout); an unknown name is a refusal that lists the valid ones.

fnaster_blueprint::ui::prelude::icon_svg

pub fn icon_svg(path_data: &str) -> IconEl

Your own icon from SVG path data on a 24x24 viewbox (stroke style by default; .filled() fills it).

fnaster_blueprint::ui::prelude::icon_svg_view

pub fn icon_svg_view(path_data: &str, viewbox: f64) -> IconEl

Your own icon from SVG path data authored in a square viewbox x viewbox space.

fnaster_blueprint::ui::prelude::icon_text

pub fn icon_text(i: Icon, label: impl AsRef<str>) -> super::el::El

Icon (16 px, muted ink) followed by a label: icon_text(Icon::Settings, "Settings").

fnaster_blueprint::ui::prelude::identicon

pub fn identicon(name: &str) -> ui::el::El

A generated identicon for name: a mirrored pattern of rounded blocks on a tile.

Cheap and crisp at any size (it is drawn as vectors, not as a picture).

fnaster_blueprint::ui::prelude::image

pub fn image(pic: &Picture) -> super::el::El

An element that paints pic into its box (see the module docs). Given no size it is as wide as the picture is, at most, and it keeps its shape (aspect) when only one side is given; size it with .w/.h/.size/.grow. Without [ImageExt::alt] it is decorative.

fnaster_blueprint::ui::prelude::image_png

pub fn image_png(bytes: impl AsRef<[u8]>) -> super::el::El

[image] of PNG bytes, decoded once and found again by content. A file that does not decode shows the "image unavailable" placeholder (named by the error) instead of failing the frame; use [Picture::png] to get the error.

fnaster_blueprint::ui::prelude::image_rgba

pub fn image_rgba(w: u32, h: u32, pixels: impl AsRef<[u8]>) -> super::el::El

[image] of straight-alpha RGBA8 pixels (w * h * 4 bytes), made once and found again by content on later frames. A size/length mismatch shows the "image unavailable" placeholder instead of failing the frame; use [Picture::rgba] to get the error.

fnaster_blueprint::ui::prelude::init_number

pub fn init_number(store: interact::Store, key: &str, v: f64) -> interact::Store

Add the keys a [number_input] needs to store: key = v, <key>.txt = its text.

fnaster_blueprint::ui::prelude::iso

pub fn iso((y, m, d): Ymd) -> String

"2026-10-31".

fnaster_blueprint::ui::prelude::kbd

pub fn kbd(key: impl AsRef<str>) -> El

A key cap: kbd("Esc").

fnaster_blueprint::ui::prelude::kbd_combo

pub fn kbd_combo(keys: &[&str]) -> El

Several key caps in a row: kbd_combo(&["Ctrl", "K"]).

fnaster_blueprint::ui::prelude::kv_list

pub fn kv_list<K: AsRef<str>, V: AsRef<str>>(pairs: &[(K, V)]) -> El

Key/value rows with hairline dividers: label left (muted), value right.

fnaster_blueprint::ui::prelude::legend

pub fn legend<L: AsRef<str>>(items: &[(L, design::Role)]) -> El

Legend entry list: dots with labels. One line while it fits; it breaks onto more lines (a wrap) when it does not.

fnaster_blueprint::ui::prelude::lens_flare

pub fn lens_flare(f: Flare) -> ui::el::El

lens_flare(Flare::new()) as an element.

fnaster_blueprint::ui::prelude::light_leak

pub fn light_leak(color: impl Into<ui::el::Col>, at_x: f64, at_y: f64) -> LightLeak

fnaster_blueprint::ui::prelude::light_shafts

pub fn light_shafts(l: LightShafts) -> ui::el::El

light_shafts(LightShafts::from(0.7, 0.2)) as an element.

fnaster_blueprint::ui::prelude::line_chart

pub fn line_chart(series: &[Series], labels: &[&str]) -> super::el::El

Line chart: one polyline per series with a nice y axis (ticks, gridlines), category labels, a legend for 2+ series and the last value of each series highlighted. labels (one per value, or empty) are the x categories. Values may be negative. Add .markers() for a dot on every point, .no_legend().

fnaster_blueprint::ui::prelude::list

pub fn list(s: &interact::Store, key: impl AsRef<str>, count: usize, row_h: impl Into<f64>, view_h: impl Into<f64>, row_fn: impl Fn(usize) -> El) -> El

Virtualised, selectable list. Only the visible rows (plus one) are built, so count may be 100k+. Store: Int <key>.sel (-1 = none, init it), Scalar <key>.scroll (px). row(i) builds row i's content. Click selects, Up/Down/Page/Home/End move, wheel scrolls. Rows have ids <key>.row.<i>.

fnaster_blueprint::ui::prelude::list_keyed

pub fn list_keyed(s: &interact::Store, key: impl AsRef<str>, count: usize, row_h: impl Into<f64>, view_h: impl Into<f64>, item_key: impl Fn(usize) -> String + 'static, row_fn: impl Fn(usize) -> El) -> El

[list] whose rows have a key of their own (item_key(i): a record id, a file name): the selection is the Text <key>.selkey, not an index, so it follows the item when the list is filtered or re-sorted (the selected row moves, or the selection stays on an item that is filtered out until it comes back), and the rows are <key>.row.<item key>. Up/Down and Page step from the selected item's current place; Home/End pick the first/last. Keys must be unique in the list. <key>.sel still holds the index of the last pick; read the selection from <key>.selkey.

fnaster_blueprint::ui::prelude::loading_state

pub fn loading_state(msg: impl AsRef<str>) -> El

Loading panel with three graded dots.

fnaster_blueprint::ui::prelude::log_list

pub fn log_list<T: AsRef<str>, M: AsRef<str>>(entries: &[(T, M, design::Role)]) -> El

Event log: timestamp, status dot, message per entry.

fnaster_blueprint::ui::prelude::logo_tile

pub fn logo_tile(initials: impl AsRef<str>, from: design::Role, to: design::Role) -> El

A 36 px rounded gradient tile with a soft inner ring and one or two bold initials, for [El::logo]: logo_tile("A", Role::Warning, Role::Secondary). The initials use the from role's content colour, and the gradient end is fitted so they stay readable in every theme.

fnaster_blueprint::ui::prelude::menu

pub fn menu(s: &interact::Store, key: impl AsRef<str>, label: impl AsRef<str>, items: Vec<(&str, interact::Action)>) -> El

Menu opened from a text trigger; each item runs its [Action] then closes. Store key <key>.open.

fnaster_blueprint::ui::prelude::mesh

pub fn mesh(points: impl IntoIterator<Item = (f64, f64, ui::el::Col)>) -> Mesh

fnaster_blueprint::ui::prelude::meter

pub fn meter(value: impl Into<f64>, role: design::Role) -> El

Progress bar: value is a fraction in 0..=1.

fnaster_blueprint::ui::prelude::meter_row

pub fn meter_row(label: impl AsRef<str>, value: impl Into<f64>, role: design::Role) -> El

Label, right-aligned percentage and a meter underneath. Replace the right-hand text with .value("1.2 kg") (or hide it with .value("")).

fnaster_blueprint::ui::prelude::meter_value

pub fn meter_value(value_text: impl AsRef<str>, fraction: impl Into<f64>, role: design::Role) -> El

A meter that grows to fill a row with its value text on the right, no label: meter_value("62%", 0.62, Role::Success). Use it inside cards that already name the quantity.

fnaster_blueprint::ui::prelude::nav

pub fn nav<I: AsRef<str>>(items: &[I], selected: usize) -> El

Sidebar nav list; selected is the index of the active item. Items are 2 px apart (.gap(1)); loosen with .gap(n) as on any column (nav(&items, 0).gap(4) = 12 px). The list is an ordinary stretched column: it fills the width of its parent inside the parent's padding, so inset it with .pad(n) on the sidebar, not on the nav.

fnaster_blueprint::ui::prelude::nav_icons

pub fn nav_icons<L: AsRef<str>>(items: &[(Icon, L)], selected: usize) -> super::el::El

Sidebar nav list with icons: nav_icons(&[(Icon::Home, "Overview"), ..], selected).

fnaster_blueprint::ui::prelude::nav_icons_live

pub fn nav_icons_live(s: &interact::Store, key: impl AsRef<str>, items: &[(super::icons::Icon, &str, &str)]) -> El

[nav_live] with an icon per item (the live nav_icons): items = (icon, id, label).

fnaster_blueprint::ui::prelude::nav_item

pub fn nav_item(label: impl AsRef<str>, selected: bool) -> El

One nav entry: dot + label; the selected one is accent-tinted.

fnaster_blueprint::ui::prelude::nav_live

pub fn nav_live(s: &interact::Store, key: impl AsRef<str>, items: &[(&str, &str)]) -> El

Live sidebar nav: a clickable [nav]. items = (id, label). The key is a Text key holding the selected id, or an Int key holding the selected index (whichever the store already has; a missing key counts as Text). Click selects, Up/Down/Home/End move between items when one is focused, Enter/Space activate. Item ids <key>.<item id>; the a11y tree reports navigation > nav-items with their label and selected state.

fnaster_blueprint::ui::prelude::nav_title

pub fn nav_title(title: impl AsRef<str>) -> El

Sidebar section caption (see [caption]).

fnaster_blueprint::ui::prelude::node_box

pub fn node_box(title: impl AsRef<str>, detail: impl AsRef<str>, role: design::Role) -> El

A pipeline stage box: role accent bar, title, detail line.

fnaster_blueprint::ui::prelude::noise_fill

pub fn noise_fill(spec: NoiseSpec) -> super::el::El

Fill the box layout gives it with the noise field. Size it like any element (.h(220), .size(w, h), .grow(1.), or .cover() inside an overlay).

Decorative: not in the UiTree, no label.

fnaster_blueprint::ui::prelude::nothing

pub fn nothing() -> super::el::El

An element that renders nothing (a closed dialog/popup placeholder).

fnaster_blueprint::ui::prelude::notify

pub fn notify(key: impl AsRef<str>, msg: impl AsRef<str>, ttl_ms: i64) -> interact::Action

Action that raises toast key with msg for ttl_ms (see [toast], App::advance).

fnaster_blueprint::ui::prelude::number_input

pub fn number_input(s: &interact::Store, key: impl AsRef<str>, label: impl AsRef<str>, min: f64, max: f64, step: f64) -> El

Editable number with - / + buttons. Scalar key is the committed value, Text <key>.txt the text being edited (initialise both, see [init_number]). The text commits on Enter, blur, the buttons and Up/Down: it is parsed, clamped to min..=max, snapped to step and re-formatted (anything unparsable reverts). Ids <key> (field), <key>.dec, <key>.inc (disabled at the bounds).

fnaster_blueprint::ui::prelude::oklch

pub fn oklch(l: f64, c: f64, h: f64, alpha: f64) -> ui::el::Col

A colour from OKLCH (l 0..1, c chroma, h degrees), gamut mapped.

fnaster_blueprint::ui::prelude::overlay

pub fn overlay(children: impl IntoIterator<Item = El>) -> El

Children share one box, later on top. Position with .place(h, v).

fnaster_blueprint::ui::prelude::page_scroll

pub fn page_scroll(s: &interact::Store, key: impl AsRef<str>, child: super::el::El) -> super::el::El

A vertical scroll viewport driven by Scalar <key>.scroll (init it to 0.).

fnaster_blueprint::ui::prelude::pagination

pub fn pagination(s: &interact::Store, key: impl AsRef<str>, pages: usize) -> El

Page bar over Int key (0-based current page): previous, numbered pages (with … when there are many) and next. Ids <key>.prev, <key>.next, <key>.p.<n>; Left/Right while a page button is focused move one page.

fnaster_blueprint::ui::prelude::palette_close

pub fn palette_close(key: &str) -> interact::Action

Action that closes palette key.

fnaster_blueprint::ui::prelude::palette_open

pub fn palette_open(key: &str) -> interact::Action

Action that opens palette key with an empty query (focus goes into its search field).

fnaster_blueprint::ui::prelude::panel

pub fn panel(title: impl AsRef<str>, subtitle: impl AsRef<str>, body: impl IntoIterator<Item = El>) -> El

[card] with a title and optional subtitle ("" to omit) above the body.

fnaster_blueprint::ui::prelude::paragraph

pub fn paragraph(s: impl AsRef<str>) -> El

A paragraph: body text that word-wraps to the width it is given (and grows taller to fit). Same as text(s).wrap(); add .max_lines(n), .text_align(..), .style(..).

fnaster_blueprint::ui::prelude::parallax

pub fn parallax() -> Parallax

parallax().layer(stars, 0.2).layer(nebula, 0.5).layer(hero, -0.3).el().

fnaster_blueprint::ui::prelude::parse_iso

pub fn parse_iso(t: &str) -> Option<Ymd>

Parse "YYYY-MM-DD".

fnaster_blueprint::ui::prelude::particles

pub fn particles(p: Particles) -> ui::el::El

An endless particle field filling its box: overlay([backdrop, particles(Particles::embers())]). Decorative (no semantic node); frozen on one populated frame under reduced motion.

fnaster_blueprint::ui::prelude::password_field

pub fn password_field(s: &interact::Store, key: impl AsRef<str>, placeholder: impl AsRef<str>) -> TextInput

Password field: the value is masked (••••) in the render and never appears in the UiTree; copy/cut are suppressed; a Show/Hide toggle (<key>.reveal) reveals it.

fnaster_blueprint::ui::prelude::person_avatar

pub fn person_avatar(name: &str) -> ui::el::El

A generated avatar for name: the initials over a soft mesh gradient the name picks.

The gradient is built from three theme roles, so it belongs to the app. It is round, with a highlight in one corner and a fine rim of light; the initials are in the colour that role says is readable on it (the gradient never mixes past the point where they stop being). The same name always draws the same avatar.

use aster_blueprint::ui::prelude::*;
let a = person_avatar("Ada Lovelace").size(48., 48.);

fnaster_blueprint::ui::prelude::pie_chart

pub fn pie_chart<L: AsRef<str>, V: Copy + Into<f64>>(items: &[(L, V)]) -> super::el::El

Pie chart: like [donut_chart] without the hole.

fnaster_blueprint::ui::prelude::pill

pub fn pill(label: impl AsRef<str>, role: design::Role) -> El

Solid pill: role fill with its readable On* text colour.

fnaster_blueprint::ui::prelude::pipeline

pub fn pipeline(columns: Vec<Vec<El>>) -> El

Left-to-right pipeline: each inner Vec is a column of [node_box]es; links with ports and elbows join consecutive columns (1:1, 1:n, n:1, n:n fan). It fills its box by default (grow(1.) along the parent's main axis and stretched across it), so panel("Signal", "", [pipeline(..)]) needs no sizing; .h(px) / .grow(0.) opt out. Ports and wires take the role of the node they belong to (node_box("Fusion", .., Role::Secondary) gets violet ports; an elbow takes the role of the single source, or of the destination for a merge), so colouring the nodes colours the connectors. Each node is centred in an equal cell of its column and ports line up with those centres exactly; see [pipeline_with] for alignment and stagger.

fnaster_blueprint::ui::prelude::pipeline_with

pub fn pipeline_with(columns: Vec<Vec<El>>, opts: PipelineOpts) -> El

[pipeline] with [PipelineOpts]: pipeline_with(cols, PipelineOpts::new().valign(Align::Start).stagger(0.2)).

fnaster_blueprint::ui::prelude::post_below

pub fn post_below(p: Post) -> ui::el::El

Post-process everything painted before this overlay (put it last in the root overlay). It sees the screen, so it grades the HUD, the glass and the sky together.

fnaster_blueprint::ui::prelude::progress_bar

pub fn progress_bar(id: impl AsRef<str>, value: Option<f64>) -> El

Linear progress, 6 px high and as wide as its parent. Some(fraction) is determinate (the bar eases to each new value with the theme NORMAL token); None is indeterminate (a segment that bounces along the track on the injected clock, resting at the start under reduced motion). id must be unique (it tracks the tween); named "Progress" or "Loading" for assistive tech (.a11y_label(..) renames it), with the value as a 0..1 range when determinate.

progress_bar("upload", Some(0.4))
progress_bar("wait", None).a11y_label("Syncing")

fnaster_blueprint::ui::prelude::progress_bar_role

pub fn progress_bar_role(id: impl AsRef<str>, value: Option<f64>, role: design::Role) -> El

[progress_bar] in another role (Role::Success for done, Role::Danger for failing).

fnaster_blueprint::ui::prelude::progress_ring

pub fn progress_ring(id: impl AsRef<str>, value: Option<f64>) -> El

Circular progress. Some(fraction) is determinate (the arc eases to each new value with the theme NORMAL token, the centre shows the percent); None is indeterminate (an arc that spins, driven by the injected clock; still under reduced motion). 56 px by default, resize with .size(w, h); .a11y_label(..) names it. id must be unique (it tracks the tween).

progress_ring("up", Some(0.62)).size(80, 80)
progress_ring("wait", None).a11y_label("Loading")

fnaster_blueprint::ui::prelude::progress_ring_role

pub fn progress_ring_role(id: impl AsRef<str>, value: Option<f64>, role: design::Role) -> El

[progress_ring] in another role (Role::Success for done, Role::Danger for failing).

fnaster_blueprint::ui::prelude::radio_group

pub fn radio_group(s: &interact::Store, key: impl AsRef<str>, opts: &[(&str, &str)]) -> El

Radio group: Text key holds the selected value. opts = (value, label). Arrows move and select.

fnaster_blueprint::ui::prelude::range_slider

pub fn range_slider(s: &interact::Store, key: impl AsRef<str>, label: impl AsRef<str>, min: f64, max: f64, step: f64) -> El

Two-thumb slider: Scalars <key>.lo and <key>.hi in min..=max (lo <= hi), Int <key>.active (0 = low thumb, 1 = high thumb).

Every thumb is a focus stop of its own: Tab reaches the low thumb (id <key>) and then the high one (id <key>.hi). The focused thumb alone moves: Left/Down and Right/Up by step, PageDown/PageUp by ten steps, Home/End to its end of the range - and it never passes the other thumb. Space/Enter swaps the focused thumb. A pointer press or drag moves the nearest thumb. Each thumb has its own label (<label> minimum / <label> maximum) and value, and the focus ring is drawn on the focused thumb. Give it a width: .w(280.).

fnaster_blueprint::ui::prelude::reactive

pub fn reactive(id: &str, build: impl Fn(&mut Hx<'_>) -> super::el::El + 'static) -> super::el::El

An element whose single child is build(hx), rebuilt every frame from the clock, the hover pointer and springs (see [Hx]). Needs an .id() to learn its own box. Without App (a plain Screen) build sees time 0, no pointer and settled springs.

reactive("hero", |hx| match hx.pointer_frac() {
    Some([fx, _]) => text("hovering").color(Role::Accent),
    None => text("idle"),
})

fnaster_blueprint::ui::prelude::record

pub fn record<K: Into<String>, V: Into<Value>>(fields: impl IntoIterator<Item = (K, V)>) -> Value

A record value: record([("who", Value::from(2)), ("body", Value::from("hi"))]).

fnaster_blueprint::ui::prelude::rect

pub fn rect(w: impl Into<f64>, h: impl Into<f64>) -> El

Exact-size empty box (px), rigid: flex shrink never squashes it (dots, bars, spacers of known size). Use .fill(..) to paint it.

fnaster_blueprint::ui::prelude::render

pub fn render(theme: &design::Theme, size: (u32, u32), scale: f64, root: &super::el::El) -> Result<headless::Image, super::error::UiError>

One call: ui::render(&theme, (w, h), scale, &root) -> Image.

fnaster_blueprint::ui::prelude::render_png

pub fn render_png(theme: &design::Theme, size: (u32, u32), scale: f64, root: &super::el::El, path: impl AsRef<std::path::Path>) -> Result<(), super::error::UiError>

[render] and write the PNG.

fnaster_blueprint::ui::prelude::responsive

pub fn responsive(f: impl Fn(Size) -> super::el::El + 'static) -> super::el::El

An element built from the size class: responsive(|size| grid(size.pick(1, 2, 3, 4), cards())). Layout modifiers chained on it (.grow(1.), .pad(4)) wrap the result in a column carrying them.

fnaster_blueprint::ui::prelude::responsive_gauge

pub fn responsive_gauge(f: impl Fn(Ctx, &Gauge<'_>) -> super::el::El + 'static) -> super::el::El

[responsive_w] that is also given a [Gauge]: the theme and a measurer for the real width of a text in the face the screen sets it in, so a builder can choose between a long and a short text, or a size, by what fits instead of by a per-letter guess.

fnaster_blueprint::ui::prelude::responsive_vp

pub fn responsive_vp(f: impl Fn(&Viewport) -> super::el::El + 'static) -> super::el::El

An element built from the viewport: responsive_vp(|vp| ...).

fnaster_blueprint::ui::prelude::responsive_w

pub fn responsive_w(f: impl Fn(Ctx) -> super::el::El + 'static) -> super::el::El

Like [responsive], also given the estimated available width.

fnaster_blueprint::ui::prelude::rgba

pub fn rgba(r: u8, g: u8, b: u8, a: u8) -> Col

A raw colour with alpha (escape hatch): rgba(255, 0, 0, 128).

fnaster_blueprint::ui::prelude::rich

pub fn rich(spans: impl IntoIterator<Item = Span>) -> El

A rich text: the inline runs of one paragraph, laid out as one text. The lines break across the runs, the runs of a line share one baseline, and every run keeps its own face, size and colour.

fnaster_blueprint::ui::prelude::row

pub fn row(children: impl IntoIterator<Item = El>) -> El

Horizontal stack. Children are centred vertically by default.

fnaster_blueprint::ui::prelude::row_w

pub fn row_w(items: impl IntoIterator<Item = (f64, El)>) -> El

A row whose children split its width by weight (row_w([(2., chart), (1., load)])) and stretch to the full row height, so side-by-side panels are equally tall. The horizontal twin of [col_w] (.w(0.).grow(weight)).

fnaster_blueprint::ui::prelude::scatter_chart

pub fn scatter_chart(series: &[XySeries]) -> super::el::El

Scatter chart: one dot per (x, y) point, a nice axis for each direction (not forced through zero), gridlines, a legend for 2+ series. Colours cycle Accent, Info, Success, Warning unless .role(..). .x_title(..) / .y_title(..), .no_legend(), .tick_px(..).

fnaster_blueprint::ui::prelude::scene3d

pub fn scene3d(scene: Scene3d) -> ui::el::El

A 3D scene as an element. Size it like any element (.w(..), .h(..), .grow(..)); with one side given it keeps the scene's aspect. It is decorative unless the scene has [Scene3d::alt] (or you call .alt(..) on the element).

fnaster_blueprint::ui::prelude::scroll

pub fn scroll(child: El) -> El

Clip + offset around one child (vertical by default, .horizontal(), .offset(x, y)).

fnaster_blueprint::ui::prelude::segmented

pub fn segmented(s: &interact::Store, key: impl AsRef<str>, opts: &[(&str, &str)]) -> El

Segmented control (pill of options): Text key holds the value.

fnaster_blueprint::ui::prelude::select

pub fn select(s: &interact::Store, key: impl AsRef<str>, opts: &[(&str, &str)], placeholder: impl AsRef<str>) -> El

Dropdown select: Text key holds the chosen value; opts = (value, label). Enter/Space/Down open, arrows move, a letter jumps to the next option that starts with it (and opens the list), Enter picks, Esc closes. Floats above the screen. The face is at least 180 px wide, so .w(160.) alone cannot make it narrower: use [select_w] for that.

fnaster_blueprint::ui::prelude::select_w

pub fn select_w(s: &interact::Store, key: impl AsRef<str>, opts: &[(&str, &str)], placeholder: impl AsRef<str>, min_w: impl Into<f64>) -> El

[select] with a chosen minimum face width in px (the default is 180): select_w(s, "sort", &opts, "Sort", 120.) for a toolbar.

fnaster_blueprint::ui::prelude::selectable_text

pub fn selectable_text(s: &interact::Store, key: impl AsRef<str>, value: impl AsRef<str>) -> TextInput

Text a person can select with the pointer or the keyboard and copy (a fingerprint, a command, an address): a read-only, outline-free field that shows value. Drag or Shift-arrows select, Ctrl-A selects all, Ctrl-C copies the selection to the app clipboard; .copy_button() adds a one-click copy of the whole text and .mono() sets it in the monospace face. .multiline(rows) wraps a longer text (a script, a certificate). Needs no store key to be initialised: the text is value. For a label that is only ever read, use text(..).

selectable_text(s, "fp", "SHA256:3f9a...").mono().copy_button().label("CA fingerprint").build()

fnaster_blueprint::ui::prelude::setting_row

pub fn setting_row(title: impl AsRef<str>, hint: impl AsRef<str>, control: El) -> El

One settings line: title + hint on the left, the control on the right.

fnaster_blueprint::ui::prelude::setting_row_wide

pub fn setting_row_wide(title: impl AsRef<str>, hint: impl AsRef<str>, control: El) -> El

[setting_row] for a wide control (a segmented control, a radio group, a slider): on Compact screens the control moves under the title and hint and takes the full width instead of squeezing the text.

fnaster_blueprint::ui::prelude::shelf

pub fn shelf(s: &interact::Store, id: impl AsRef<str>, count: usize, tile_w: impl Into<f64>, tile_h: impl Into<f64>, tile: impl Fn(usize) -> El + 'static) -> Shelf

One horizontally scrolling row of tiles.

The scroll offset is the Scalar <id>.scroll (init it to 0.); the tiles are keyed <id>.<i> and the focused index the Int <id>.sel.

fnaster_blueprint::ui::prelude::shelves

pub fn shelves(s: &interact::Store, id: impl AsRef<str>, rows: Vec<(String, usize)>, tile_w: impl Into<f64>, tile_h: impl Into<f64>, tile: impl Fn(usize, usize) -> El + 'static) -> Shelves

A vertically virtualised page of shelves (rows of tiles that scroll sideways).

The page offset is the Scalar <id>.scroll, the offset of a shelf the Scalar <id>.<row>.scroll; the tiles are keyed <id>.<row>.<i> and every shelf is a focus group that remembers its column.

fnaster_blueprint::ui::prelude::sidebar_layout

pub fn sidebar_layout(side: super::el::El, main: super::el::El, compact: Collapse) -> super::el::El

Sidebar (rigid, 224 px unless it has its own width) and main area side by side; on Compact the sidebar collapses as asked. The main area should usually be wrapped by [page_scroll] there (main.scroll_when(Size::Compact, s, "main")).

fnaster_blueprint::ui::prelude::skeleton

pub fn skeleton(w: impl Into<f64>, h: impl Into<f64>) -> El

A placeholder block (w = 0 fills the width) with a shimmer that sweeps across with the theme SLOW duration x 5 (static under reduced motion).

fnaster_blueprint::ui::prelude::skeleton_card

pub fn skeleton_card() -> El

Avatar + two lines, the usual list-row placeholder.

fnaster_blueprint::ui::prelude::skeleton_card_compact

pub fn skeleton_card_compact() -> El

[skeleton_card] sized for a [card_compact]: a smaller avatar and two text lines.

fnaster_blueprint::ui::prelude::skeleton_chart

pub fn skeleton_chart(h: impl Into<f64>) -> El

A bar chart placeholder, h px high (data_view(..).loading(skeleton_chart(200))): seven shimmering columns standing on a baseline, heard as "Loading chart".

fnaster_blueprint::ui::prelude::skeleton_circle

pub fn skeleton_circle(d: impl Into<f64>) -> El

A round placeholder (avatar): skeleton_circle(40).

fnaster_blueprint::ui::prelude::skeleton_list

pub fn skeleton_list(rows: usize) -> El

A list placeholder, rows rows of an avatar and two lines (data_view(..).loading(skeleton_list(6))), heard as "Loading list".

fnaster_blueprint::ui::prelude::skeleton_text

pub fn skeleton_text(lines: usize) -> El

lines skeleton text lines, the last one shorter.

fnaster_blueprint::ui::prelude::slider

pub fn slider(s: &interact::Store, key: impl AsRef<str>, min: impl Into<f64>, max: impl Into<f64>, step: impl Into<f64>) -> El

Horizontal slider over Scalar key in min..=max, snapped to step. Click/drag sets the value; arrows step, Page keys step x10, Home/End jump. Give it a width: slider(..).w(240.).

fnaster_blueprint::ui::prelude::spacer

pub fn spacer() -> El

Flexible gap (grow 1).

fnaster_blueprint::ui::prelude::span

pub fn span(s: impl Into<String>) -> Span

A run of text in the element's own face, size and colour.

fnaster_blueprint::ui::prelude::sparkline

pub fn sparkline<V: Copy + Into<f64>>(values: &[V], role: design::Role) -> El

Tiny column sparkline (last value highlighted), 28 px high by default.

fnaster_blueprint::ui::prelude::sparkline_line

pub fn sparkline_line<V: Copy + Into<f64>>(values: &[V], role: design::Role) -> super::el::El

Polyline sparkline: antialiased line, a soft area under it and the last value highlighted with a dot. 28 px high, as wide as its parent. Values may be negative.

fnaster_blueprint::ui::prelude::stack

pub fn stack(children: impl IntoIterator<Item = super::el::El>) -> super::el::El

A row on wide screens, a column when the class is Compact (stack_at to pick the class).

fnaster_blueprint::ui::prelude::stack_at

pub fn stack_at(collapse_to: Size, children: impl IntoIterator<Item = super::el::El>) -> super::el::El

A row that becomes a column at collapse_to and narrower.

fnaster_blueprint::ui::prelude::stacked_bar_chart

pub fn stacked_bar_chart(series: &[Series], labels: &[&str]) -> super::el::El

Stacked bar chart: the series of a category stacked bottom to top (the first series at the bottom). The axis covers the tallest stack; .values() prints the total over every stack. Values must be >= 0.

fnaster_blueprint::ui::prelude::staggered

pub fn staggered(items: impl IntoIterator<Item = super::el::El>) -> super::el::El

A vertical list whose items enter one after another.

fnaster_blueprint::ui::prelude::staggered_cards

pub fn staggered_cards(items: impl IntoIterator<Item = super::el::El>) -> super::el::El

A row of cards whose items enter one after another.

fnaster_blueprint::ui::prelude::staggered_grid

pub fn staggered_grid(columns: usize, items: impl IntoIterator<Item = super::el::El>) -> super::el::El

A grid whose items enter one after another.

fnaster_blueprint::ui::prelude::start_timer

pub fn start_timer(key: impl AsRef<str>, ms: i64) -> interact::Action

Action that sets Bool key and counts it down for ms on the app clock (<key>.ttl); it turns false by itself, and App::on_expire can run an action then. Starting it again restarts the countdown.

fnaster_blueprint::ui::prelude::stat

pub fn stat(label: impl AsRef<str>, value: impl AsRef<str>) -> El

Stat tile: caption label over a big value. Append .child(delta(..)), .child(meter(..)) or .child(sparkline(..)).

fnaster_blueprint::ui::prelude::stat_spark

pub fn stat_spark(label: impl AsRef<str>, value: impl AsRef<str>, change: f64, unit: impl AsRef<str>, series: impl IntoIterator<Item = impl SeriesValue>, role: design::Role) -> El

[stat] with its change and a trend line: stat_spark("Latency", "37 ms", -3.1, "%", &series, Role::Success). The series is any iterable of numbers: &[f64], Vec<i32>, &Vec<f32>, &[u32], an iterator... role colours both the trend line and the change (Role::Success for good news whichever way the number moved, Role::Danger for bad).

fnaster_blueprint::ui::prelude::status

pub fn status(label: impl AsRef<str>, role: design::Role) -> El

Dot + label.

fnaster_blueprint::ui::prelude::status_dot

pub fn status_dot(role: design::Role) -> El

Small glowing status dot.

fnaster_blueprint::ui::prelude::stepper

pub fn stepper(s: &interact::Store, key: impl AsRef<str>, min: i64, max: i64, step: i64) -> El

Number stepper over Int key in min..=max: [-] 3 [+]. Up/Down keys step.

fnaster_blueprint::ui::prelude::stop

pub fn stop(at: f64, col: impl Into<ui::el::Col>) -> Stop

A stop at at (0..=1).

fnaster_blueprint::ui::prelude::swatch_picker

pub fn swatch_picker(s: &interact::Store, key: impl AsRef<str>, colors: &[(&str, Col)]) -> El

Colour swatch picker: Text key holds the chosen name; colors = (name, colour) where the colour is a role or hex(..). Arrow keys move and select (roving focus), click picks. Ids <key>.<name>.

fnaster_blueprint::ui::prelude::switch

pub fn switch(s: &interact::Store, key: impl AsRef<str>, label: impl AsRef<str>) -> El

On/off switch bound to Bool key. Whole row (track + label) is the target key.

fnaster_blueprint::ui::prelude::tab_bar

pub fn tab_bar(items: &[impl AsRef<str>], selected: usize) -> super::el::El

A navigation strip: equal-width labels, the selected one accented (the compact twin of nav).

fnaster_blueprint::ui::prelude::tab_bar_live

pub fn tab_bar_live(s: &interact::Store, key: impl AsRef<str>, items: &[(&str, &str)]) -> El

Live bottom/top strip: a clickable tab_bar, equal-width cells, items = (id, label), same key rules as [nav_live]. Left/Right/Home/End move between cells.

fnaster_blueprint::ui::prelude::table

pub fn table<H: AsRef<str>>(headers: &[H], rows: Vec<Vec<El>>) -> El

Table with a header row and banded rows. Cells are elements ("text".into(), badge(..), ...); every row needs one cell per header. First column is wider.

fnaster_blueprint::ui::prelude::tabs

pub fn tabs(s: &interact::Store, key: impl AsRef<str>, opts: &[(&str, &str)]) -> El

Tab strip: Text key holds the selected tab; render the content yourself from s.text(key).

fnaster_blueprint::ui::prelude::tag_input

pub fn tag_input(s: &interact::Store, key: impl AsRef<str>, placeholder: impl AsRef<str>) -> El

Chip input: text list key holds the tags, Text <key>.draft the one being typed. Enter adds the trimmed draft (ignoring empty and duplicate ones), each chip's x (<key>.rm.<i>) removes it. Backspace in an empty draft highlights the last tag (Int <key>.hi) and a second Backspace removes it; any other key (or typing) drops the highlight without removing anything. The field is <key>.draft.

fnaster_blueprint::ui::prelude::text

pub fn text(s: impl AsRef<str>) -> El

One line of text, Body style, Role::Text. Restyle with .style(Type::..), .color(..).

fnaster_blueprint::ui::prelude::text_area

pub fn text_area(s: &interact::Store, key: impl AsRef<str>, placeholder: impl AsRef<str>, rows: usize) -> TextInput

Multi-line text area of rows visible lines: wraps, Enter inserts a newline, Up/Down move by visual line, the view scrolls to the caret (and with the wheel).

fnaster_blueprint::ui::prelude::text_bound

pub fn text_bound(f: impl Fn(&interact::Store) -> String + 'static) -> super::el::El

A text element whose string is a function of the store, evaluated on every render.

fnaster_blueprint::ui::prelude::text_field

pub fn text_field(s: &interact::Store, key: impl AsRef<str>, placeholder: impl AsRef<str>) -> El

Single-line text field: Text key holds the value, Int <key>.caret / <key>.anchor the caret and selection anchor (chars; anchor -1 = no selection). Editing runs on aster-ui's FieldEditor: typed characters, Backspace/Delete, Left/Right (Ctrl = word), Home/End, Shift extends the selection, Ctrl-A selects all, Ctrl-C/X/V use the app clipboard, Ctrl-Z / Ctrl-Shift-Z undo and redo, IME composition shows underlined, a click places the caret and a drag selects. Placeholder when empty; long text scrolls to its tail. Chain .on_key(Key::Enter, action) for submit. For passwords, text areas, max_length and validation use [text_input].

fnaster_blueprint::ui::prelude::text_input

pub fn text_input(s: &interact::Store, key: impl AsRef<str>, placeholder: impl AsRef<str>) -> TextInput

Start a [TextInput] (single line; 240 px intrinsic width that fills a stretching parent or .grow(1.); see the builder methods).

fnaster_blueprint::ui::prelude::text_number

pub fn text_number(get: impl Fn(&interact::Store) -> f64 + 'static, fmt: impl Fn(f64) -> String + 'static) -> super::el::El

A number shown as text that tweens when get(store) changes (opt-in; use .animate(Prop::Number, ..) to change the default slow/standard transition). fmt renders the in-between values.

text_number(|s| s.scalar("rps"), |v| format!("{v:.0} req/s")).id("rps")

fnaster_blueprint::ui::prelude::theme_gradient

pub fn theme_gradient(th: &design::Theme, token: GradToken) -> Grad

The theme's gradient for token, derived from its accent, secondary and background colours.

fnaster_blueprint::ui::prelude::theme_gradients

pub fn theme_gradients(th: &design::Theme) -> Vec<(GradToken, Grad)>

Every named gradient of th.

fnaster_blueprint::ui::prelude::tilt_card

pub fn tilt_card(content: ui::el::El) -> ui::el::El

A tilt card around content with default settings (needs content.id(..)).

fnaster_blueprint::ui::prelude::timeline

pub fn timeline(items: &[TimelineItem]) -> El

Vertical timeline: a rail with a status node per event, title, time and optional detail.

fnaster_blueprint::ui::prelude::toast

pub fn toast(s: &interact::Store, key: impl AsRef<str>, role: design::Role) -> El

Toast shown while Bool key is true (initialise it with .with(key, false): a Text/Int key is refused); text in Text <key>.msg. Use [notify] to raise one and App::advance(ms) to expire it.

fnaster_blueprint::ui::prelude::toast_action

pub fn toast_action(s: &interact::Store, key: impl AsRef<str>, role: design::Role, label: impl AsRef<str>, action: interact::Action) -> El

[toast] with an action button ("Undo"): <key>.action runs action and closes the toast. Raise it with [notify].

fnaster_blueprint::ui::prelude::toast_action_at

pub fn toast_action_at(s: &interact::Store, key: impl AsRef<str>, role: design::Role, place: Place, label: impl AsRef<str>, action: interact::Action) -> El

[toast_action] in a chosen corner or edge (see [toast_at]): toast_action_at(s, "t", Role::Info, Place::TopCenter, "Undo", undo) keeps a phone's toast off the bottom tab bar.

fnaster_blueprint::ui::prelude::toast_at

pub fn toast_at(s: &interact::Store, key: impl AsRef<str>, role: design::Role, place: Place) -> El

[toast] in a chosen corner or edge: [Place::BottomEnd] (the default, = BottomRight), [Place::TopEnd], [Place::BottomStart], [Place::TopStart] (the end side is the left one in a right-to-left app, the start side the right one), or the centred [Place::TopCenter] / [Place::BottomCenter]. Any other place centres the toast on the screen.

fnaster_blueprint::ui::prelude::toggle_chip

pub fn toggle_chip(label: impl AsRef<str>, on: bool) -> El

Toggle-style chip with a status dot: on highlights it in the accent.

fnaster_blueprint::ui::prelude::tooltip

pub fn tooltip(s: &interact::Store, anchor_key: impl AsRef<str>, tip: impl AsRef<str>) -> El

Tooltip above the element with id anchor_key while it is hovered or focused.

fnaster_blueprint::ui::prelude::tree_view

pub fn tree_view(s: &interact::Store, key: impl AsRef<str>, roots: &[TreeNode]) -> El

Tree with expandable branches: Text key is the selected node id, text list <key>.open the expanded ids. Click selects (and toggles a branch); with a row focused: Down/Up move, Right expands then enters, Left collapses then goes to the parent, Home/End, Enter/Space toggles. Row ids <key>.n.<node id>.

fnaster_blueprint::ui::prelude::vdivider

pub fn vdivider() -> El

Vertical rule inside a row.

fnaster_blueprint::ui::prelude::vector

pub fn vector(draw: impl Fn(&design::Theme, f64, f64) -> Vec<Shape> + 'static) -> super::el::El

An element that paints draw(theme, width, height) into its own box. Size it with .w/.h/.size/.grow; the closure is called at render time with the final size.

fnaster_blueprint::ui::prelude::vignette

pub fn vignette(strength: f64, color: impl Into<ui::el::Col>) -> ui::el::El

Darken the edges toward color (usually near-black): strength 0..1.

fnaster_blueprint::ui::prelude::virtual_grid

pub fn virtual_grid(s: &interact::Store, id: impl AsRef<str>, count: usize, tile_w: impl Into<f64>, tile_h: impl Into<f64>, tile: impl Fn(usize) -> El + 'static) -> VirtualGrid

A virtualised grid of tiles.

The columns follow the width the grid got (or .cols(n), or a minimum tile width in the foundation's units); only the rows in view (plus an overscan) are built, so count may be 100k+. The scroll offset is the Scalar <id>.scroll (init it to 0.); the tiles are keyed <id>.<i> and the focused index is the Int <id>.sel.

fnaster_blueprint::ui::prelude::with_palette_shortcut

pub fn with_palette_shortcut(root: El, key: impl AsRef<str>) -> El

Make Ctrl-K open palette key app-wide: the shortcut the root declares runs even when nothing has focus, and a modifier chord still reaches it while a text field has focus (needs .id() for hit routing: one is given when missing).

fnaster_blueprint::ui::prelude::wizard

pub fn wizard(s: &interact::Store, key: impl AsRef<str>, steps: Vec<WizardStep>) -> Wizard

Start a [Wizard].

fnaster_blueprint::ui::prelude::worst_contrast_over

pub fn worst_contrast_over(text: aster_ui::Srgb8, g: &Grad, th: &design::Theme, w: u32, h: u32, region: [f64; 4]) -> f64

The lowest WCAG contrast of text over the part of gradient g under region (box fractions [x, y, w, h]), measured on a w x h px render: the worst point under the text.

fnaster_blueprint::ui::prelude::wrap

pub fn wrap(children: impl IntoIterator<Item = El>) -> El

Horizontal stack that breaks onto new lines (.gap_xy(item, line)).

fnaster_blueprint::ui::prelude::fog::fog

pub fn fog(f: Fog) -> ui::el::El

A fog element: size it like any decorative layer (.h(..), .size(..), or let it fill an overlay).

fnaster_blueprint::ui::prelude::particles::eval

pub fn eval(p: &Particles, ramp: &super::math::Ramp, life: LifeAt, w: f64, h: f64, i: usize) -> Option<Dot>

Evaluate particle i of p in a w x h box; None when it is not alive.

fnaster_blueprint::ui::prelude::particles::particles

pub fn particles(p: Particles) -> ui::el::El

An endless particle field filling its box: overlay([backdrop, particles(Particles::embers())]). Decorative (no semantic node); frozen on one populated frame under reduced motion.

fnaster_blueprint::ui::prelude::particles::record_dots

pub fn record_dots(dots: &[Dot], p: &Particles, w: f64, h: f64, scale: f64, clipped: bool) -> Result<std::sync::Arc<aster_ui::Recording>, aster_ui::Error>

Draw dots as sprite commands into one recording for a w x h box at scale.

fnaster_blueprint::ui::prelude::rules::chars

pub fn chars(f: impl Fn(char) -> bool + 'static, msg: impl AsRef<str>) -> Rule

Every character satisfies f (an empty value passes).

fnaster_blueprint::ui::prelude::rules::email

pub fn email(msg: impl AsRef<str>) -> Rule

A plausible email address: [email protected], no spaces (an empty value passes).

fnaster_blueprint::ui::prelude::rules::max_len

pub fn max_len(n: usize, msg: impl AsRef<str>) -> Rule

At most n characters.

fnaster_blueprint::ui::prelude::rules::min_len

pub fn min_len(n: usize, msg: impl AsRef<str>) -> Rule

At least n characters (an empty value passes: combine with [required]).

fnaster_blueprint::ui::prelude::rules::number

pub fn number(min: f64, max: f64, msg: impl AsRef<str>) -> Rule

A number in min..=max (an empty value passes).

fnaster_blueprint::ui::prelude::rules::pattern

pub fn pattern(mask: impl AsRef<str>, msg: impl AsRef<str>) -> Rule

A mask over the whole value (an empty value passes): # a digit, @ a letter, * any one character, a backslash makes the next mask character literal, anything else matches itself. pattern("##-@@", ..) accepts 12-ab.

fnaster_blueprint::ui::prelude::rules::required

pub fn required(msg: impl AsRef<str>) -> Rule

Not empty after trimming.

fnaster_blueprint::ui::prelude::scene3d::scene3d

pub fn scene3d(scene: Scene3d) -> ui::el::El

A 3D scene as an element. Size it like any element (.w(..), .h(..), .grow(..)); with one side given it keeps the scene's aspect. It is decorative unless the scene has [Scene3d::alt] (or you call .alt(..) on the element).

fnaster_blueprint::ui::prelude::scene3d::mesh::capsule

pub fn capsule(radius: f32, length: f32, segs: usize) -> Mesh

A capsule along y: a cylinder of length between two hemispheres of radius.

fnaster_blueprint::ui::prelude::scene3d::mesh::cube

pub fn cube(size: [f32; 3]) -> Mesh

A box size wide, tall and deep with flat faces.

fnaster_blueprint::ui::prelude::scene3d::mesh::cylinder

pub fn cylinder(radius: f32, height: f32, segs: usize) -> Mesh

A cylinder along y, capped, of radius and height, centred on the origin.

fnaster_blueprint::ui::prelude::scene3d::mesh::extrude

pub fn extrude(contours: &[Vec<P2>], depth: f32, bevel: f32) -> Mesh

Extrude closed contours (any nesting, even-odd) into a solid of depth along z centred on the origin, with a chamfer of bevel on both faces. The 2D points are used as they are (x right, y up).

fnaster_blueprint::ui::prelude::scene3d::mesh::extrude_ex

pub fn extrude_ex(contours: &[Vec<P2>], depth: f32, bevel: f32, bulge: f32) -> Mesh

[extrude] with bulge: the cap normals lean outward from the middle of the shape by that much (0.3 is a gentle dome), so a flat face sweeps its reflection across the environment like polished metal. The chamfer of a glyph shrinks where it would fold.

fnaster_blueprint::ui::prelude::scene3d::mesh::fit_contours

pub fn fit_contours(contours: &[Vec<P2>], height: f32, y_down: bool) -> Vec<Vec<P2>>

Centre contours on the origin, flip them to y up when they came from pixels (y_down), and scale so the tallest side is height.

fnaster_blueprint::ui::prelude::scene3d::mesh::flatten_path

pub fn flatten_path(cmds: &[ui::vector::VectorCommand], tol: f32) -> Vec<Vec<P2>>

Flatten a path (the VectorCommands a Shape is made of) to closed polylines. tol is the flatness in path units.

fnaster_blueprint::ui::prelude::scene3d::mesh::mask_contours

pub fn mask_contours(alpha: &[u8], w: usize, h: usize) -> Vec<Vec<P2>>

Trace the 0.5 level of an alpha mask (w x h, row 0 on top) into closed polylines in pixel coordinates, y down.

fnaster_blueprint::ui::prelude::scene3d::mesh::parse_obj

pub fn parse_obj(bytes: &[u8]) -> Option<Mesh>

Parse the common subset of Wavefront OBJ: v, vn, f (triangles, quads and polygons, v, v/t, v//n, v/t/n, negative indices). Other statements are ignored. Missing normals are computed with a 50 degree crease. None when there is no face.

fnaster_blueprint::ui::prelude::scene3d::mesh::plane

pub fn plane(w: f32, d: f32, n: usize) -> Mesh

A flat plane in xz facing +y, w by d, divided n times along each side (so lights and fog sample it evenly).

fnaster_blueprint::ui::prelude::scene3d::mesh::rounded_box

pub fn rounded_box(size: [f32; 3], radius: f32, segs: usize) -> Mesh

A box with rounded edges and corners; radius is clamped to half the smallest side, segs is the facets per corner.

fnaster_blueprint::ui::prelude::scene3d::mesh::simplify

pub fn simplify(c: &[P2], eps: f32) -> Vec<P2>

Douglas-Peucker simplification of a closed polygon.

fnaster_blueprint::ui::prelude::scene3d::mesh::smooth_contour

pub fn smooth_contour(c: &[P2], passes: usize) -> Vec<P2>

Laplacian smoothing of a closed polyline (removes the stair-steps of a traced mask).

fnaster_blueprint::ui::prelude::scene3d::mesh::sphere

pub fn sphere(radius: f32, segs: usize) -> Mesh

A UV sphere of radius.

fnaster_blueprint::ui::prelude::scene3d::mesh::torus

pub fn torus(major: f32, minor: f32, segs: usize) -> Mesh

A torus in the xz plane: major is the ring radius, minor the tube radius.

fnaster_blueprint::ui::prelude::scene3d::mesh::track_contours

pub fn track_contours(contours: &[Vec<P2>], tracking: f32) -> Vec<Vec<P2>>

Spread the glyphs of a traced line of text: contours are grouped into glyphs (overlapping x ranges belong together, so the dot of an i stays with its stem) and glyph k moves right by k * tracking * height.

fnaster_blueprint::ui::prelude::scene3d::mesh::triangulate

pub fn triangulate(outer: &[P2], holes: &[Vec<P2>]) -> (Vec<P2>, Vec<[u32; 3]>)

Triangulate outer (counter-clockwise) minus holes (clockwise). Returns the vertex list used and triangles into it.

fnaster_blueprint::ui::prelude::scene3d::render::finish

pub fn finish(scene: &RScene, hdr: &[[f32; 4]], w: usize, h: usize) -> Vec<u8>

Bloom, exposure, tone mapping, sRGB and a deterministic dither: straight-alpha RGBA8. Rows are independent, so they run on scoped threads and the bytes equal a serial run.

fnaster_blueprint::ui::prelude::scene3d::render::render

pub fn render(scene: &RScene, w: usize, h: usize) -> Vec<u8>

Result of a render: straight-alpha RGBA8, w * h * 4 bytes.

fnaster_blueprint::ui::prelude::scene3d::render::render_hdr

pub fn render_hdr(scene: &RScene, w: usize, h: usize) -> Vec<[f32; 4]>

The scene as premultiplied linear HDR RGBA (the result before bloom and tone mapping).

fnaster_blueprint::ui::prelude::scene3d::render::render_live

pub fn render_live(scene: &RScene, w: usize, h: usize, div: usize) -> Vec<u8>

An interactive frame: straight-alpha RGBA8, w x h. Visibility is found at full resolution (one sample per pixel), but shading runs once per surface per div x div cell and the cell values are spread back over the pixels that show the same surface (bilinearly between neighbouring cells that see it), so silhouettes stay as crisp as the pixel grid while the shading cost is a ninth (div 3). The floor reflection is made at the cell resolution. Tone mapping happens per cell value; bloom and dither are left to the settled frame.

fnaster_blueprint::ui::prelude::scene3d::vec::add

pub fn add(a: V3, b: V3) -> V3

fnaster_blueprint::ui::prelude::scene3d::vec::basis

pub fn basis(d: V3) -> (V3, V3)

An orthonormal basis (right, up) around the unit vector d.

fnaster_blueprint::ui::prelude::scene3d::vec::clip

pub fn clip(m: &M4, p: V3) -> [f32; 4]

m * (p, 1) without the divide.

fnaster_blueprint::ui::prelude::scene3d::vec::cross

pub fn cross(a: V3, b: V3) -> V3

fnaster_blueprint::ui::prelude::scene3d::vec::det3

pub fn det3(m: &M4) -> f32

fnaster_blueprint::ui::prelude::scene3d::vec::dir

pub fn dir(m: &M4, p: V3) -> V3

fnaster_blueprint::ui::prelude::scene3d::vec::dot

pub fn dot(a: V3, b: V3) -> f32

fnaster_blueprint::ui::prelude::scene3d::vec::len

pub fn len(a: V3) -> f32

fnaster_blueprint::ui::prelude::scene3d::vec::lerp

pub fn lerp(a: f32, b: f32, t: f32) -> f32

fnaster_blueprint::ui::prelude::scene3d::vec::lerp3

pub fn lerp3(a: V3, b: V3, t: f32) -> V3

fnaster_blueprint::ui::prelude::scene3d::vec::look_at

pub fn look_at(eye: V3, target: V3, up: V3) -> M4

A right-handed view matrix (camera looks down -z).

fnaster_blueprint::ui::prelude::scene3d::vec::matmul

pub fn matmul(a: &M4, b: &M4) -> M4

fnaster_blueprint::ui::prelude::scene3d::vec::mul

pub fn mul(a: V3, k: f32) -> V3

fnaster_blueprint::ui::prelude::scene3d::vec::mulv

pub fn mulv(a: V3, b: V3) -> V3

fnaster_blueprint::ui::prelude::scene3d::vec::norm

pub fn norm(a: V3) -> V3

fnaster_blueprint::ui::prelude::scene3d::vec::normal_matrix

pub fn normal_matrix(m: &M4) -> M4

The transform that maps normals: the inverse transpose of the upper 3x3 (as a matrix whose dir is used).

fnaster_blueprint::ui::prelude::scene3d::vec::orthographic

pub fn orthographic(height: f32, aspect: f32, near: f32, far: f32) -> M4

Orthographic projection of a view height tall.

fnaster_blueprint::ui::prelude::scene3d::vec::perspective

pub fn perspective(fov_y_deg: f32, aspect: f32, near: f32, far: f32) -> M4

Perspective projection to clip space with z in -w..w (OpenGL convention).

fnaster_blueprint::ui::prelude::scene3d::vec::point

pub fn point(m: &M4, p: V3) -> V3

fnaster_blueprint::ui::prelude::scene3d::vec::reflect

pub fn reflect(i: V3, n: V3) -> V3

fnaster_blueprint::ui::prelude::scene3d::vec::rot_x

pub fn rot_x(deg: f32) -> M4

fnaster_blueprint::ui::prelude::scene3d::vec::rot_y

pub fn rot_y(deg: f32) -> M4

fnaster_blueprint::ui::prelude::scene3d::vec::rot_z

pub fn rot_z(deg: f32) -> M4

fnaster_blueprint::ui::prelude::scene3d::vec::sat

pub fn sat(x: f32) -> f32

fnaster_blueprint::ui::prelude::scene3d::vec::scaling

pub fn scaling(s: V3) -> M4

fnaster_blueprint::ui::prelude::scene3d::vec::smooth

pub fn smooth(e0: f32, e1: f32, x: f32) -> f32

fnaster_blueprint::ui::prelude::scene3d::vec::sub

pub fn sub(a: V3, b: V3) -> V3

fnaster_blueprint::ui::prelude::scene3d::vec::translation

pub fn translation(t: V3) -> M4

fnaster_blueprint::ui::responsive::drawer

pub fn drawer(s: &interact::Store, key: impl AsRef<str>, title: impl AsRef<str>) -> Collapse

The compact-screen sidebar replacement with a menu button: Bool key toggles the sidebar open.

fnaster_blueprint::ui::responsive::grid_auto

pub fn grid_auto(min_col_w: impl Into<f64>, children: impl IntoIterator<Item = super::el::El>) -> super::el::El

A grid whose column count follows the available width: as many columns of at least min_col_w px as fit (1 at minimum, never more than there are children). .gap(n) counts.

fnaster_blueprint::ui::responsive::page_scroll

pub fn page_scroll(s: &interact::Store, key: impl AsRef<str>, child: super::el::El) -> super::el::El

A vertical scroll viewport driven by Scalar <key>.scroll (init it to 0.).

fnaster_blueprint::ui::responsive::responsive

pub fn responsive(f: impl Fn(Size) -> super::el::El + 'static) -> super::el::El

An element built from the size class: responsive(|size| grid(size.pick(1, 2, 3, 4), cards())). Layout modifiers chained on it (.grow(1.), .pad(4)) wrap the result in a column carrying them.

fnaster_blueprint::ui::responsive::responsive_gauge

pub fn responsive_gauge(f: impl Fn(Ctx, &Gauge<'_>) -> super::el::El + 'static) -> super::el::El

[responsive_w] that is also given a [Gauge]: the theme and a measurer for the real width of a text in the face the screen sets it in, so a builder can choose between a long and a short text, or a size, by what fits instead of by a per-letter guess.

fnaster_blueprint::ui::responsive::responsive_w

pub fn responsive_w(f: impl Fn(Ctx) -> super::el::El + 'static) -> super::el::El

Like [responsive], also given the estimated available width.

fnaster_blueprint::ui::responsive::sidebar_layout

pub fn sidebar_layout(side: super::el::El, main: super::el::El, compact: Collapse) -> super::el::El

Sidebar (rigid, 224 px unless it has its own width) and main area side by side; on Compact the sidebar collapses as asked. The main area should usually be wrapped by [page_scroll] there (main.scroll_when(Size::Compact, s, "main")).

fnaster_blueprint::ui::responsive::stack

pub fn stack(children: impl IntoIterator<Item = super::el::El>) -> super::el::El

A row on wide screens, a column when the class is Compact (stack_at to pick the class).

fnaster_blueprint::ui::responsive::stack_at

pub fn stack_at(collapse_to: Size, children: impl IntoIterator<Item = super::el::El>) -> super::el::El

A row that becomes a column at collapse_to and narrower.

fnaster_blueprint::ui::responsive::tab_bar

pub fn tab_bar(items: &[impl AsRef<str>], selected: usize) -> super::el::El

A navigation strip: equal-width labels, the selected one accented (the compact twin of nav).

fnaster_blueprint::ui::scenery::cover

pub fn cover(seed: &str) -> ui::el::El

Generated cover art for a card: a seeded gradient with a motif over it (a sphere, hills, rings or arches).

The seed is usually a title or an id, so every item of a list gets its own picture and the list looks like a shelf of albums instead of a column of grey boxes.

fnaster_blueprint::ui::scenery::empty_art

pub fn empty_art(kind: EmptyState) -> ui::el::El

A generated empty-state illustration, in the theme's colours.

The picture is drawn as vectors, so it is crisp at any size and costs one path per shape.

use aster_blueprint::ui::prelude::*;
let art = empty_art(EmptyState::Search).size(160., 160.);

fnaster_blueprint::ui::scenery::identicon

pub fn identicon(name: &str) -> ui::el::El

A generated identicon for name: a mirrored pattern of rounded blocks on a tile.

Cheap and crisp at any size (it is drawn as vectors, not as a picture).

fnaster_blueprint::ui::scenery::person_avatar

pub fn person_avatar(name: &str) -> ui::el::El

A generated avatar for name: the initials over a soft mesh gradient the name picks.

The gradient is built from three theme roles, so it belongs to the app. It is round, with a highlight in one corner and a fine rim of light; the initials are in the colour that role says is readable on it (the gradient never mixes past the point where they stop being). The same name always draws the same avatar.

use aster_blueprint::ui::prelude::*;
let a = person_avatar("Ada Lovelace").size(48., 48.);

fnaster_blueprint::ui::skin::nested_radius

pub fn nested_radius(outer: f64, padding: f64) -> f64

The nested radius: the outer radius less the padding, never negative.

fnaster_blueprint::ui::text_input::password_field

pub fn password_field(s: &interact::Store, key: impl AsRef<str>, placeholder: impl AsRef<str>) -> TextInput

Password field: the value is masked (••••) in the render and never appears in the UiTree; copy/cut are suppressed; a Show/Hide toggle (<key>.reveal) reveals it.

fnaster_blueprint::ui::text_input::selectable_text

pub fn selectable_text(s: &interact::Store, key: impl AsRef<str>, value: impl AsRef<str>) -> TextInput

Text a person can select with the pointer or the keyboard and copy (a fingerprint, a command, an address): a read-only, outline-free field that shows value. Drag or Shift-arrows select, Ctrl-A selects all, Ctrl-C copies the selection to the app clipboard; .copy_button() adds a one-click copy of the whole text and .mono() sets it in the monospace face. .multiline(rows) wraps a longer text (a script, a certificate). Needs no store key to be initialised: the text is value. For a label that is only ever read, use text(..).

selectable_text(s, "fp", "SHA256:3f9a...").mono().copy_button().label("CA fingerprint").build()

fnaster_blueprint::ui::text_input::text_area

pub fn text_area(s: &interact::Store, key: impl AsRef<str>, placeholder: impl AsRef<str>, rows: usize) -> TextInput

Multi-line text area of rows visible lines: wraps, Enter inserts a newline, Up/Down move by visual line, the view scrolls to the caret (and with the wheel).

fnaster_blueprint::ui::text_input::text_field

pub fn text_field(s: &interact::Store, key: impl AsRef<str>, placeholder: impl AsRef<str>) -> El

Single-line text field: Text key holds the value, Int <key>.caret / <key>.anchor the caret and selection anchor (chars; anchor -1 = no selection). Editing runs on aster-ui's FieldEditor: typed characters, Backspace/Delete, Left/Right (Ctrl = word), Home/End, Shift extends the selection, Ctrl-A selects all, Ctrl-C/X/V use the app clipboard, Ctrl-Z / Ctrl-Shift-Z undo and redo, IME composition shows underlined, a click places the caret and a drag selects. Placeholder when empty; long text scrolls to its tail. Chain .on_key(Key::Enter, action) for submit. For passwords, text areas, max_length and validation use [text_input].

fnaster_blueprint::ui::text_input::text_input

pub fn text_input(s: &interact::Store, key: impl AsRef<str>, placeholder: impl AsRef<str>) -> TextInput

Start a [TextInput] (single line; 240 px intrinsic width that fills a stretching parent or .grow(1.); see the builder methods).

fnaster_blueprint::ui::text_input::rules::chars

pub fn chars(f: impl Fn(char) -> bool + 'static, msg: impl AsRef<str>) -> Rule

Every character satisfies f (an empty value passes).

fnaster_blueprint::ui::text_input::rules::email

pub fn email(msg: impl AsRef<str>) -> Rule

A plausible email address: [email protected], no spaces (an empty value passes).

fnaster_blueprint::ui::text_input::rules::max_len

pub fn max_len(n: usize, msg: impl AsRef<str>) -> Rule

At most n characters.

fnaster_blueprint::ui::text_input::rules::min_len

pub fn min_len(n: usize, msg: impl AsRef<str>) -> Rule

At least n characters (an empty value passes: combine with [required]).

fnaster_blueprint::ui::text_input::rules::number

pub fn number(min: f64, max: f64, msg: impl AsRef<str>) -> Rule

A number in min..=max (an empty value passes).

fnaster_blueprint::ui::text_input::rules::pattern

pub fn pattern(mask: impl AsRef<str>, msg: impl AsRef<str>) -> Rule

A mask over the whole value (an empty value passes): # a digit, @ a letter, * any one character, a backslash makes the next mask character literal, anything else matches itself. pattern("##-@@", ..) accepts 12-ab.

fnaster_blueprint::ui::text_input::rules::required

pub fn required(msg: impl AsRef<str>) -> Rule

Not empty after trimming.

fnaster_blueprint::ui::vector::canvas

pub fn canvas(draw: impl Fn(&design::Theme, f64, f64) -> Vec<Shape> + 'static) -> super::el::El

A custom-paint element: the same as [vector], named for what it is used for. draw(theme, width, height) runs at render time with the box the layout gave the element and returns the shapes (paths, lines, circles, rects; fills and strokes) in logical px inside it; the shapes are prepared once per distinct path and shared by every frame that draws the same bits. Text and bitmaps are separate elements (draw them as siblings in a stack).

fnaster_blueprint::ui::vector::vector

pub fn vector(draw: impl Fn(&design::Theme, f64, f64) -> Vec<Shape> + 'static) -> super::el::El

An element that paints draw(theme, width, height) into its own box. Size it with .w/.h/.size/.grow; the closure is called at render time with the final size.

fnaster_blueprint::ui::viewport::fold_split

pub fn fold_split(a: super::el::El, b: super::el::El) -> super::el::El

The two panes of a fold split: a on one side of the hinge, b on the other. A vertical hinge puts them side by side, a horizontal one above and below. The panes are laid out with the layout primitives (a grid with named areas): the hinge gets a band of its own, so no content is ever under it.

The hinge is measured in surface coordinates, so the split belongs at the surface origin (the root of the screen, without padding of its own); nested deeper, the panes take the space of their own box and the hinge no longer lines up.

Without a fold the panes fall back to a row (side by side); use [fold_split_or] to choose the fallback yourself.

fnaster_blueprint::ui::viewport::fold_split_or

pub fn fold_split_or(a: super::el::El, b: super::el::El, fallback: impl Fn(super::el::El, super::el::El) -> super::el::El + 'static) -> super::el::El

[fold_split], with the tree that is used when the surface has no fold. The fallback is built from the two panes, so they are not lost: |a, b| col([a, b]).

fnaster_blueprint::ui::viewport::responsive_vp

pub fn responsive_vp(f: impl Fn(&Viewport) -> super::el::El + 'static) -> super::el::El

An element built from the viewport: responsive_vp(|vp| ...).

fnaster_blueprint::ui::virtual_grid::follow_item

pub fn follow_item(st: &mut interact::Store, id: &str, old_key: impl Fn(usize) -> String, new_count: usize, new_key: impl Fn(usize) -> String) -> bool

Keep the focus on the same item when the order or the contents of a [virtual_grid] or a [shelf] change (a sort, a filter): the tiles are keyed by index, so the focus would stay on the place and meet another item. Call it from the action that changes the data, after the data changed: old_key(i) names the item that sat at index i before, new_key(j) the item at j now, over new_count items. When id ("g", or "lib.2" for the row of a [shelves] page) has the focus, the focus (and <id>.sel) moves to the tile of the same item, which the container then scrolls into view. Returns whether it moved the focus; an item that is gone (filtered out) leaves the focus alone (the container clamps it). A tile the focus is not on is not touched.

fnaster_blueprint::ui::virtual_grid::follow_rows

pub fn follow_rows<A: AsRef<str>, B: AsRef<str>>(st: &mut interact::Store, id: &str, old_keys: &[A], new_keys: &[B]) -> bool

Keep the memory of every shelf with its row when the rows of a [shelves] page are inserted, removed or reordered: the shelves are keyed by index (<id>.<row>), so a new shelf at the top would hand its place's sideways offset, remembered column and focus to another shelf. Call it from the action that changes the rows, after they changed: old_keys[r] names the row that sat at index r before, new_keys[j] the row at j now (a name, an id). Each row that is still there takes its offset (<id>.<j>.scroll) and column (<id>.<j>.sel) with it, a new row starts at 0, and when the focus was on a tile of a shelf that is still there it moves to the same tile of the shelf's new place (the page scrolls it into view by itself). Returns whether the focus moved; a shelf that is gone leaves the focus alone (the page clamps it). The vertical offset of the page (<id>.scroll) is not touched.

fnaster_blueprint::ui::virtual_grid::shelf

pub fn shelf(s: &interact::Store, id: impl AsRef<str>, count: usize, tile_w: impl Into<f64>, tile_h: impl Into<f64>, tile: impl Fn(usize) -> El + 'static) -> Shelf

One horizontally scrolling row of tiles.

The scroll offset is the Scalar <id>.scroll (init it to 0.); the tiles are keyed <id>.<i> and the focused index the Int <id>.sel.

fnaster_blueprint::ui::virtual_grid::shelves

pub fn shelves(s: &interact::Store, id: impl AsRef<str>, rows: Vec<(String, usize)>, tile_w: impl Into<f64>, tile_h: impl Into<f64>, tile: impl Fn(usize, usize) -> El + 'static) -> Shelves

A vertically virtualised page of shelves (rows of tiles that scroll sideways).

The page offset is the Scalar <id>.scroll, the offset of a shelf the Scalar <id>.<row>.scroll; the tiles are keyed <id>.<row>.<i> and every shelf is a focus group that remembers its column.

fnaster_blueprint::ui::virtual_grid::virtual_grid

pub fn virtual_grid(s: &interact::Store, id: impl AsRef<str>, count: usize, tile_w: impl Into<f64>, tile_h: impl Into<f64>, tile: impl Fn(usize) -> El + 'static) -> VirtualGrid

A virtualised grid of tiles.

The columns follow the width the grid got (or .cols(n), or a minimum tile width in the foundation's units); only the rows in view (plus an overscan) are built, so count may be 100k+. The scroll offset is the Scalar <id>.scroll (init it to 0.); the tiles are keyed <id>.<i> and the focused index is the Int <id>.sel.

Constants

constaster_blueprint::ui::LONG_PRESS_MS

pub const LONG_PRESS_MS: u64

The long press that lifts an item on a touch screen (ms).

constaster_blueprint::ui::a11y::FIELD_KINDS

pub const FIELD_KINDS: [&str; 6]

The kinds of input whose boundary is what identifies them (an empty field shows only its edge), the ones [UiTree::audit_a11y] holds to [MIN_COMPONENT_CONTRAST].

constaster_blueprint::ui::a11y::MIN_COMPONENT_CONTRAST

pub const MIN_COMPONENT_CONTRAST: f64

Minimum contrast of the visible boundary of an interactive element against its surroundings (WCAG 1.4.11).

constaster_blueprint::ui::a11y::MIN_TARGET

pub const MIN_TARGET: f64

Minimum interactive target, logical px (WCAG 2.2 AA, 2.5.8).

constaster_blueprint::ui::charts::MAX_BAR_SERIES

pub const MAX_BAR_SERIES: usize

Most series a grouped or stacked bar chart takes (the colours cycle Accent, Info, Success, Warning).

constaster_blueprint::ui::charts::MAX_POINTS

pub const MAX_POINTS: usize

Most points one series may have (bounded by the vector renderer's command budget).

constaster_blueprint::ui::deco::paint::LUT

pub const LUT: usize

constaster_blueprint::ui::deco::presets::NAMES

pub const NAMES: [&str; 7]

The names of the presets.

constaster_blueprint::ui::fx::MAX_PIXELS

pub const MAX_PIXELS: usize

Largest picture one layer may make (pixels); bigger asks are refused by the layer.

constaster_blueprint::ui::fx::gradient2::mesh::EAST

pub const EAST: usize

constaster_blueprint::ui::fx::gradient2::mesh::NORTH

pub const NORTH: usize

constaster_blueprint::ui::fx::gradient2::mesh::SOUTH

pub const SOUTH: usize

constaster_blueprint::ui::fx::gradient2::mesh::WEST

pub const WEST: usize

constaster_blueprint::ui::fx::gradient2::ramp::LUT_N

pub const LUT_N: usize

Entries in a baked ramp: 2048 is 8x finer than 8-bit output, and the lookup interpolates.

constaster_blueprint::ui::fx::neu::TAG_BACKDROP

pub const TAG_BACKDROP: u64

The key tag of the page backdrop ("BD").

constaster_blueprint::ui::fx::neu::TAG_FROST

pub const TAG_FROST: u64

The key tag of the frosted face ("FR").

constaster_blueprint::ui::fx::neu::TAG_GRAIN

pub const TAG_GRAIN: u64

The key tag of the grain ("GR").

constaster_blueprint::ui::fx::neu::TAG_INSET

pub const TAG_INSET: u64

The key tag of the debossed inner shadow ("IN").

constaster_blueprint::ui::fx::neu::TAG_MASK

pub const TAG_MASK: u64

The tag bits of a key: the state pass finds the layers it owns by them.

constaster_blueprint::ui::fx::neu::TAG_PRESS

pub const TAG_PRESS: u64

The key tag of the debossed band of a pressed button ("PR"): the state pass fades it in with the press.

constaster_blueprint::ui::fx::neu::TAG_RAISED

pub const TAG_RAISED: u64

The key tag of the raised shadow pair ("RA").

constaster_blueprint::ui::fx::neu::TAG_RIM

pub const TAG_RIM: u64

The key tag of the glass rim ("RI").

constaster_blueprint::ui::fx::post_film::BN

pub const BN: usize

Side of the blue-noise tile.

constaster_blueprint::ui::fx::post_film::GRAIN

pub const GRAIN: usize

A tile of approximately gaussian grain, unit variance, 0-mean.

constaster_blueprint::ui::fx::scene3d::vec::IDENTITY

pub const IDENTITY: M4

constaster_blueprint::ui::hx::STILL_SECONDS

pub const STILL_SECONDS: f64

The frozen clock under reduced motion: late enough that emitters are in steady state.

constaster_blueprint::ui::kine::swarm::DEFAULT_KEY

pub const DEFAULT_KEY: &str

The default key of the swarm layer.

constaster_blueprint::ui::kine::swarm::G

pub const G: f64

Gravity, px/s^2.

constaster_blueprint::ui::kine::swarm::SUB

pub const SUB: f64

Fixed simulation step, seconds.

constaster_blueprint::ui::motion::FRAME_MS

pub const FRAME_MS: u64

Milliseconds between frames a host should render while animating.

constaster_blueprint::ui::noise::CYCLE_SECS

pub const CYCLE_SECS: f64

Seconds covered by one cycle at the default theme motion tokens.

constaster_blueprint::ui::prelude::LONG_PRESS_MS

pub const LONG_PRESS_MS: u64

The long press that lifts an item on a touch screen (ms).

constaster_blueprint::ui::prelude::scene3d::vec::IDENTITY

pub const IDENTITY: M4

constaster_blueprint::ui::scenery::DEFAULT_SEED

pub const DEFAULT_SEED: u64

The seed a preset uses when the caller does not name one.

constaster_blueprint::ui::viewport::FOLD_MARGIN

pub const FOLD_MARGIN: f64

The room a fold split keeps around the hinge (logical px): the panes do not touch the crease and nothing is drawn under it.