增加构建QScheme设置的构造函数。
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user