Skip to main content

Crate cotis_defaults

Crate cotis_defaults 

Source
Expand description

Default data types shared across Cotis integrations.

This crate provides concrete element config structs and render command structs used by layout managers and renderers in the Cotis ecosystem.

Typical data flow:

  1. Build an element_configs::ElementConfig.
  2. The layout crate consumes that config and produces layout output.
  3. A pipe maps layout output to render_commands values.
  4. A renderer draws those commands.

cotis-defaults depends on cotis-utils for shared primitives such as BoundingBox, Vector2, and renderer context traits.

§Features

  • serialization: enables serde support for configs/commands and also enables cotis/serialization and cotis-utils/serialization.
  • complex_color: enables layered/gradient color support through colors::ColorLayer for backgrounds in style and commands.
  • complex_colored_text: extends complex_color to text color fields.
  • child_wrapping: adds LayoutStyle::child_wrapping (currently experimental; not fully wired in all layout integrations).

§Text and fonts (evolving API)

Text config, font IDs, and measuring wiring are functional today but planned for refactoring. Treat text/font/measuring integration points as subject to change across minor versions until that refactor lands.

§Quick start

use cotis_defaults::element_configs::ElementConfig;
use cotis_defaults::element_configs::style::sizing::DoubleAxisSizing;

// Usually consumed by cotis-layout and transformed into render commands by a pipe.
let config: ElementConfig<'_, DoubleAxisSizing, (), (), ()> = ElementConfig::default();

Modules§

colors
Base color types, gradients and layered paints.
element_configs
Element configuration structs consumed by layout integrations. Element configuration data passed into Cotis layout.
generic_image
Path-based generic image wrappers used by image configs.
render_commands
Render command structs consumed by renderer integrations.

Macros§

alignment
Helper macro that creates an Alignment value.