Extensions to GPUI
Independent paint, presentation, text and SVG extensions.
Downstream extensions to GPUI. Paints, window color presentation, text backends and SVG rendering are independent opt-in capabilities.
Browser extension demos → · Demo source
Color tasks
Color and wide-gamut workflows →
Start here: wide gamut versus Display P3; choose a practical task.
Display supplied pixels correctly →
Supply pixels, transfer, alpha and storage explicitly.
Use a supplied RGB ICC profile →
Use a supplied RGB matrix/TRC profile within the supported subset.
Explore and verify color behavior →
Browser previews, native presentation and what the measurements prove.
1. Paints and shaders
use xgpui_shader::{painted, SolidColor};
use std::sync::Arc;
painted().bg_paint(Arc::new(SolidColor::new([1.0, 0.2, 0.0, 1.0])?));xgpui-shader: gradients, meshes and portable WGSL. Metal, wgpu and native D3D11 adapters; ordinary programs use sRGB. Explicit linear-P3 programs require a native wide-gamut window.
Shader paints and instanced shaders →
Choose shader paints or instanced shaders; migrate existing names.
Paint and shader extension →
Start here: dependencies, containers, borders, paths and interaction.
Selectable typography →
Gradient fills, glyph glow/shadows, typewriter, wave and scramble with stable selection and native accessibility.
Main-pass brushes →
Universal brushes, glyphs, paths, mesh gradients and cached layer effects.
Shader producer reference →
Mesh sources, parameters, limits and caches.
Paint preparation and failure contracts →
Preparation, recording and failure behavior.
Shader paints (experimental) →
Rust parameters + portable WGSL source.
Instanced shaders (experimental) →
Typed main-pass instances, ordered batching, native app and WASM companion.
Portable wgpu paints →
wgpu support and validation.
Native D3D11 paints →
Native D3D11 adapter and Windows acceptance.
just --justfile apps/xgpui-ext-lab/paint-lab/justfile radial
just --justfile apps/xgpui-ext-lab/paint-lab/justfile --listInstanced shaders · native app first
Typed fragment instances, ordered batching, configurable gradient shadows, soft animated borders and direct main-pass rendering. Experimental SDR subset; Windows runtime acceptance remains outstanding.
just --justfile apps/xgpui-ext-lab/shader-examples/justfile ui
just --justfile apps/xgpui-ext-lab/shader-examples/justfile compositionAPI, examples and implementation status → · WASM companion → · Demo source
2. Wide-gamut presentation
use gpui::WindowColorMode;
// During window construction or an update outside drawing:
window.set_color_mode(WindowColorMode::WideGamutSdr)?;
let status = window.color_status();
// Explicit producer output; legacy paints and controls remain sRGB:
MetalWideSdrOutput::from_linear_p3_premultiplied(context, texture, commands)?;xgpui-gamut produces bounded linear-P3 SDR surfaces. GPUI backends own window negotiation and composition; Metal and native D3D11 presentation are implemented. Windows native execution/display validation remains outstanding; Linux is deferred.
just --justfile apps/xgpui-ext-lab/gamut-lab/justfile ui
just --justfile apps/xgpui-ext-lab/gamut-lab/justfile testColor comparison · browser and native desktop
Open Chromaticity & gamut ↗Demo source
Open Pixels + metadata ↗Demo source
Open Color & gamut ↗Demo source
Start with a color task → · What each lab proves →
The browser compares interpolation and gamut mapping as an sRGB preview. Its runtime panel reports source space, mapping, actual canvas color space (or unknown) and browser-reported wide-gamut capability (at least P3).
cargo run --locked --config .cargo/validation.toml --manifest-path apps/xgpui-ext-lab/Cargo.toml --bin color-labThe native companion pairs mapped sRGB and Display P3 swatches using the same 32 reference samples per row. Check effective WideGamutSdr and display support, then compare on your wide-gamut monitor. Display capability does not verify calibration.
3. Parley text
Shared text backend with flat-LTR compatibility, BiDi paragraph layout and editing/IME geometry. Precise font axes and feature inspection use existing GPUI caches and the glyph atlas. Font-controls labs/tests are verified on macOS and Windows; Linux acceptance remains separate.
xgpui-parley →
Construction, paragraphs, precise axes, preview policy, cache and face identity, supported subset and validation.
Variable fonts and OpenType inspection →
Weight, width, slant and optical size; inspection, native/Parley lab, backend support and core 3.0 migration.
4. Progressive SVG
Experimental full-color static SVG elements with preview/detail refinement, shared FIFO admission and aggregate image accounting. Native lab and attributed offline samples; smaller budgets reduce deep-zoom detail.
5. Standalone color math
xgpui-color provides color conversions, gamut mapping, OkLab/OkLCh interpolation and reusable WGSL helpers with zero runtime dependencies in its default configuration. Optional ICC parsing adds a parser dependency. Use it without GPUI or a GPU context.
6. Dedicated media images
Display large images at several sizes, adjust their colors, or show frames from a native producer. Start with small examples and the browser demos.