mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-20 03:18:06 +08:00
14 lines
329 B
Rust
14 lines
329 B
Rust
use graphite_editor_core::Color as InnerColor;
|
|
use wasm_bindgen::prelude::*;
|
|
|
|
#[wasm_bindgen]
|
|
pub struct Color(InnerColor);
|
|
|
|
#[wasm_bindgen]
|
|
impl Color {
|
|
#[wasm_bindgen(constructor)]
|
|
pub fn new(red: f32, green: f32, blue: f32, alpha: f32) -> Self {
|
|
Self(InnerColor::from_rgbaf32(red, green, blue, alpha).unwrap_throw())
|
|
}
|
|
}
|