skia-rs-paint

Crates.ioskia-rs-paint
lib.rsskia-rs-paint
version0.2.0
created_at2026-01-02 20:25:37.942571+00
updated_at2026-01-03 18:45:28.451533+00
descriptionPaint, shaders, and effects for skia-rs
homepagehttps://github.com/pegasusheavy/skia-rs
repositoryhttps://github.com/pegasusheavy/skia-rs
max_upload_size
id2019162
size163,901
Joseph R. Quinn (quinnjr)

documentation

https://docs.rs/skia-rs-paint

README

skia-rs-paint

Paint, shaders, and effects for skia-rs, a pure Rust implementation of the Skia 2D graphics library.

Features

  • Paint: Color, style, stroke width, anti-aliasing
  • Blend modes: All Porter-Duff and advanced blend modes
  • Shaders: Linear, radial, sweep gradients, image shaders
  • Color filters: Matrix, lighting, blend mode filters
  • Mask filters: Blur, shader-based masks
  • Image filters: Blur, drop shadow, morphology, displacement

Usage

use skia_rs_paint::{Paint, Style, BlendMode, LinearGradient};
use skia_rs_core::{Color, Point};

// Create a paint with stroke style
let mut paint = Paint::new();
paint.set_color(Color::from_rgb(255, 107, 53));
paint.set_style(Style::Stroke);
paint.set_stroke_width(4.0);
paint.set_anti_alias(true);

// Add a gradient shader
let gradient = LinearGradient::new(
    Point::new(0.0, 0.0),
    Point::new(100.0, 0.0),
    &[Color4f::RED, Color4f::BLUE],
    None,
    TileMode::Clamp,
);
paint.set_shader(gradient);

License

MIT OR Apache-2.0

See the main repository for more information.

Commit count: 0

cargo fmt