Expand description
Design tokens: default spacing, sizing, rounding, stroke, shadow and engine colour values. UI chrome reads the applied theme.
All values live in the single static DESIGN_TOKENS, a plain struct
literal evaluated at compile time, so reading a token costs a memory load and
nothing is parsed or allocated at startup.
§Usage
use egui_charts::tokens::DESIGN_TOKENS;
// Spacing
let gap = DESIGN_TOKENS.spacing.md;
let padding = DESIGN_TOKENS.spacing.lg;
// Colors
let bullish = DESIGN_TOKENS.semantic.chart.bullish;
let accent = DESIGN_TOKENS.semantic.brand.accent;
// Sizing
let btn_height = DESIGN_TOKENS.sizing.button_md;
// Strokes
let thin = DESIGN_TOKENS.stroke.hairline;Structs§
- Annotation
Sizing Tokens - Annotation sizing defaults in egui logical points.
- Brand
Semantic Tokens - Brand accent colors (consistent across light/dark themes).
- Candle
Sizing Tokens - Candlestick rendering dimensions (body width ratio, wick width, min body height).
- Chart
Semantic Tokens - Chart area color tokens for default and fallback rendering.
- Charts
ExtSizing Tokens - Charts additional sizing defaults in egui logical points.
- Command
Palette Sizing Tokens - Command palette sizing defaults in egui logical points.
- Context
Menu Sizing Tokens - Context menu sizing defaults in egui logical points.
- Crosshair
Sizing Tokens - Crosshair sizing defaults in egui logical points.
- Design
Tokens - Shared spacing, dimensions and color defaults for chart controls.
- Dialog
Sizing Tokens - Dialog sizing defaults in egui logical points.
- Drawing
Semantic Tokens - Drawing label and Fibonacci level colors.
- Drawing
Sizing Tokens - Drawing sizing defaults in egui logical points.
- Drawing
Toolbar ExtSizing Tokens - Drawing toolbar additional sizing defaults in egui logical points.
- Extended
Semantic Tokens - Extended semantic tokens providing flat access to commonly used colors.
- Floating
Toolbar Sizing Tokens - Floating toolbar sizing defaults in egui logical points.
- Footprint
Semantic Tokens - Footprint (order flow) chart colors.
- Indicator
Semantic Tokens - Legacy moving average colours still used by drawing defaults. Studies use
studies::palette. - Layout
Tokens - Layout tokens for menu shadows and label offsets.
- Media
Sizing Tokens - Media sizing defaults in egui logical points.
- Menu
Sizing Tokens - Menu sizing defaults in egui logical points.
- Notification
Sizing Tokens - Notification sizing defaults in egui logical points.
- Panel
Sizing Tokens - Panel dimensions (bottom panel heights, widget default sizes).
- Position
Tool Sizing Tokens - Position tool sizing defaults in egui logical points.
- Replay
Sizing Tokens - Replay sizing defaults in egui logical points.
- Rounding
Tokens - Corner rounding tokens for consistent border-radius across components.
- Semantic
Tokens - Complete set of semantic color tokens, organized by domain.
- Settings
Dialog Sizing Tokens - Settings dialog sizing defaults in egui logical points.
- Shadow
Tokens - Shadow offset tokens for drop shadows on floating panels and menus.
- Sizing
Tokens - Root sizing tokens containing icon sizes, button sizes, and sub-module sizing.
- Spacing
Tokens - Spacing tokens defining consistent gaps, padding, and margins.
- Status
Semantic Tokens - Status and feedback colors (error, info, disabled, caution).
- Stroke
Tokens - Stroke width tokens for lines, borders, and outlines.
- Symbol
Header Sizing Tokens - Symbol header sizing defaults in egui logical points.
- Technical
Labels Sizing Tokens - Technical labels sizing defaults in egui logical points.
- Toolbar
Sizing Tokens - Toolbar dimensions (left, bottom and right panels and button sizes).
- Tooltip
Sizing Tokens - Tooltip sizing defaults in egui logical points.
- TpoSemantic
Tokens - TPO (Market Profile) chart colors
- UiSemantic
Tokens - Neutral fallback still used by volume bubbles. UI chrome reads the applied theme.
Statics§
- DESIGN_
TOKENS - The crate’s design tokens.