| Crates.io | skia-rs-paint |
| lib.rs | skia-rs-paint |
| version | 0.2.0 |
| created_at | 2026-01-02 20:25:37.942571+00 |
| updated_at | 2026-01-03 18:45:28.451533+00 |
| description | Paint, shaders, and effects for skia-rs |
| homepage | https://github.com/pegasusheavy/skia-rs |
| repository | https://github.com/pegasusheavy/skia-rs |
| max_upload_size | |
| id | 2019162 |
| size | 163,901 |
Paint, shaders, and effects for skia-rs, a pure Rust implementation of the Skia 2D graphics library.
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);
MIT OR Apache-2.0
See the main repository for more information.