Expand description
Gradient and static image-pattern descriptions.
use motion_core::prelude::*;
use motion_core::{
DisplayList, RasterLimits, ResourceStore, ValidatedDisplayList, MAX_PATH_VERBS,
MAX_STROKE_VERBS, MAX_SVG_PATH_BYTES, sample_offsets,
};
let brush = LinearGradient::new(Point::ORIGIN, Point::new(1.0, 0.0))
.stop(0.0, Color::from_hex(0x1080c0))
.stop(1.0, Color::WHITE)
.space(GradientSpace::Oklab);
Node::from(Rect::new(0.0, 0.0, 8.0, 8.0).fill(brush)).compile(
Size::new(8.0, 8.0),
PixelSize::new(8, 8),
ValidationLimits::default(),
)?;Structs§
- Gradient
- Shared gradient description retained by paint and validated before preparation.
- Image
Pattern - A preloaded static image sampled in local pixel coordinates, without I/O.
- Linear
Gradient - A linear gradient in f64 authoring coordinates.
- Pattern
Image - Shared image sampling contract captured by a paint, independent of content decoders.
- Radial
Gradient - A circular radial gradient; object bounds can stretch it elliptically.
- Sweep
Gradient - A clockwise angular gradient in radians.
- Weak
Pattern Image - Weak identity of a
PatternImage’s shared pixel storage.
Enums§
- Geometry
- Gradient geometry in the coordinate system selected by
GradientUnits. - Gradient
Extend - Behavior outside a gradient’s normalized interval.
- Gradient
Space - Color interpolation space for gradients.
- Gradient
Units - Coordinates used by gradient geometry.
- Paint
- Floating paint retained without implicit gamut clipping or byte quantization.