diff --git a/src/nodes/drawable/lines.rs b/src/nodes/drawable/lines.rs index 86359ff..7d236a8 100644 --- a/src/nodes/drawable/lines.rs +++ b/src/nodes/drawable/lines.rs @@ -21,7 +21,7 @@ static LINES_REGISTRY: Registry = Registry::new(); struct LinePointRaw { point: Vector3, thickness: f32, - color: [u8; 4], + color: [f32; 4], } #[derive(Debug, Clone)] @@ -61,7 +61,7 @@ impl Lines { .map(|p| SkLinePoint { point: transform_mat.transform_point3a(Vec3A::from(p.point)).into(), thickness: p.thickness, - color: Color32::from_slice(&p.color), + color: Color32::from_slice(p.color.map(|c| (c / 255.0) as u8).as_slice()), }) .collect(); if data.cyclic && !points.is_empty() {