增加构建QScheme设置的构造函数。

This commit is contained in:
徐涛
2025-02-06 06:19:15 +08:00
parent 838f0c0fa0
commit 56a4786675
6 changed files with 93 additions and 21 deletions

View File

@@ -13,6 +13,14 @@ pub struct ColorShifting {
pub lightness: f32,
}
#[wasm_bindgen]
impl ColorShifting {
#[wasm_bindgen(constructor)]
pub fn new(chroma: f32, lightness: f32) -> Self {
ColorShifting { chroma, lightness }
}
}
impl Mul<ColorShifting> for Oklch<f32> {
type Output = Oklch<f32>;
@@ -143,3 +151,27 @@ impl Default for SchemeSetting {
}
}
}
#[wasm_bindgen]
impl SchemeSetting {
#[wasm_bindgen(constructor)]
pub fn new(
hover: ColorShifting,
active: ColorShifting,
focus: ColorShifting,
disabled: ColorShifting,
dark_convert: ColorShifting,
expand_method: ColorExpand,
wacg_follows: WACGSetting,
) -> Self {
SchemeSetting {
hover,
active,
focus,
disabled,
dark_convert,
expand_method,
wacg_follows,
}
}
}