Add colors in Rust (#78)

* 🎨 Add colors in Rust

* 🌿 Use an option for the properties and #[repr(C)]

*  Remove WASM dependency on document.

* 😎 Wrap Fill and stroke in a style struct.

* 📦 Use crate::Color

* Merge Add transactions for temporary modifications to the document

* Run cargo fmt

* Color without a 'U'
This commit is contained in:
0HyperCube
2021-05-07 02:47:34 -07:00
committed by Keavon Chambers
parent 9ffbb4ce39
commit c04a0227f1
26 changed files with 689 additions and 407 deletions
+5 -1
View File
@@ -1,4 +1,4 @@
use crate::LayerId;
use crate::{layers::style, LayerId};
#[derive(Debug, Clone, PartialEq)]
pub enum Operation {
@@ -8,6 +8,7 @@ pub enum Operation {
cx: f64,
cy: f64,
r: f64,
style: style::PathStyle,
},
AddRect {
path: Vec<LayerId>,
@@ -16,6 +17,7 @@ pub enum Operation {
y0: f64,
x1: f64,
y1: f64,
style: style::PathStyle,
},
AddLine {
path: Vec<LayerId>,
@@ -24,6 +26,7 @@ pub enum Operation {
y0: f64,
x1: f64,
y1: f64,
style: style::PathStyle,
},
AddShape {
path: Vec<LayerId>,
@@ -33,6 +36,7 @@ pub enum Operation {
x1: f64,
y1: f64,
sides: u8,
style: style::PathStyle,
},
DeleteLayer {
path: Vec<LayerId>,