Skip to main content

Module paint

Module paint 

Source
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.
ImagePattern
A preloaded static image sampled in local pixel coordinates, without I/O.
LinearGradient
A linear gradient in f64 authoring coordinates.
PatternImage
Shared image sampling contract captured by a paint, independent of content decoders.
RadialGradient
A circular radial gradient; object bounds can stretch it elliptically.
SweepGradient
A clockwise angular gradient in radians.
WeakPatternImage
Weak identity of a PatternImage’s shared pixel storage.

Enums§

Geometry
Gradient geometry in the coordinate system selected by GradientUnits.
GradientExtend
Behavior outside a gradient’s normalized interval.
GradientSpace
Color interpolation space for gradients.
GradientUnits
Coordinates used by gradient geometry.
Paint
Floating paint retained without implicit gamut clipping or byte quantization.