Expand description
Color conversion between cotis and wgpu representations.
Cotis cotis_defaults::colors::Color stores each channel as f32 in the 0..=255
range. This module normalizes channels to 0.0..=1.0 for GPU use.
Alpha handling differs by consumer:
cotis_color_to_ui_color— RGB only; used by the UI geometry pipeline, which forces opaque fragments in the WGSL shader.cotis_color_to_wgpu— full RGBA; suitable for swapchain clear colors andcrate::renderer::CotisWgpuRenderer::set_background.- Text rendering converts cotis colors to glyphon
Colorwith roundedu8channels, preserving alpha.
Functions§
- cotis_
color_ to_ ui_ color - Converts a cotis RGBA color (0..255 per channel) into normalized GPU color components.
- cotis_
color_ to_ wgpu - Converts a cotis RGBA color into a wgpu clear/present color (0.0..=1.0 per channel).