first commit
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "color-engine"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
@@ -0,0 +1,6 @@
|
||||
pub struct CMYK {
|
||||
pub c: u32,
|
||||
pub m: u32,
|
||||
pub y: u32,
|
||||
pub k: u32,
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
pub struct HSV {
|
||||
pub h: u32,
|
||||
pub s: u32,
|
||||
pub v: u32,
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
use crate::core::color_model::hsv::HSV;
|
||||
|
||||
pub struct RGB {
|
||||
pub r: u32,
|
||||
pub g: u32,
|
||||
pub b: u32,
|
||||
}
|
||||
|
||||
impl RGB {
|
||||
pub fn new_from_hsv(hsv: HSV) -> Self {
|
||||
let h = hsv.h;
|
||||
Self {
|
||||
r: 32,
|
||||
g: 32,
|
||||
b: 32,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
pub struct LayerBase {
|
||||
pub isLocked: bool,
|
||||
pub isHided: bool,
|
||||
pub optic: f32,
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
pub struct ShapeBase {
|
||||
pub width: i32,
|
||||
pub height: i32,
|
||||
pub rotation: i32,
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
pub mod core {
|
||||
pub mod color_model {
|
||||
pub mod cmyk;
|
||||
pub mod hsv;
|
||||
pub mod rgb;
|
||||
}
|
||||
}
|
||||
|
||||
pub mod tool {
|
||||
pub mod shape {
|
||||
pub mod square;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
pub struct Layer {}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "mark-engine"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
@@ -0,0 +1,14 @@
|
||||
pub fn add(left: u64, right: u64) -> u64 {
|
||||
left + right
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = add(2, 2);
|
||||
assert_eq!(result, 4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
pub struct BorderStyle(pub String);
|
||||
|
||||
impl BorderStyle {
|
||||
pub const NONE: Self = Self("None");
|
||||
pub const SOLID: Self = Self("SOLID");
|
||||
pub const DASHED: Self = Self("DASHED");
|
||||
pub const DOTTED: Self = Self("DOTTED");
|
||||
|
||||
fn check() {}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct FontSize(pub f32);
|
||||
|
||||
impl FontSize {
|
||||
pub const SMALL: Self = Self(12);
|
||||
pub const NORMAL: Self = Self(14);
|
||||
pub const MEDIUM: Self = Self(16);
|
||||
pub const LARGE: Self = Self(24);
|
||||
pub const X_LARGE: Self = Self(30);
|
||||
|
||||
pub fn as_f32(&self) -> f32 {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct FontWeight(pub f32);
|
||||
|
||||
impl FontWeight {
|
||||
pub const LIGHT: Self = Self(300);
|
||||
pub const NORMAL: Self = Self(400);
|
||||
pub const MEDIUM: Self = Self(500);
|
||||
pub const SEMIBOLD: Self = Self(600);
|
||||
pub const BOLD: Self = Self(700);
|
||||
|
||||
pub fn as_f32(&self) -> f32 {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct LineHeight(pub f32);
|
||||
|
||||
impl LineHeight {
|
||||
pub const LINE_HEIGHT_NORMAL: Self = Self(1.4);
|
||||
|
||||
pub fn as_f32(&self) -> f32 {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct Width(pub f32);
|
||||
|
||||
impl Width {
|
||||
pub const ITEM_WIDTH_SMALL: Self = Self(20);
|
||||
pub const ITEM_WIDTH_NORMAL: Self = Self(24);
|
||||
pub const ITEM_WIDTH_MEDIUM: Self = Self(28);
|
||||
pub const ITEM_WIDTH_LARGE: Self = Self(34);
|
||||
pub const ITEM_WIDTH_X_LARGE: Self = Self(44);
|
||||
pub const ITEM_WIDTH_XX_LARGE: Self = Self(56);
|
||||
pub const ITEM_WIDTH_XXX_LARGE: Self = Self(64);
|
||||
|
||||
pub const INLINE_WIDTH_SMALL: Self = Self(64);
|
||||
|
||||
pub fn as_f32(&self) -> f32 {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "text-engine"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "ui-engine"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
@@ -0,0 +1,14 @@
|
||||
pub fn add(left: u64, right: u64) -> u64 {
|
||||
left + right
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = add(2, 2);
|
||||
assert_eq!(result, 4);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user