增加Swatch Scheme主题的生成和导出。

This commit is contained in:
徐涛
2025-01-23 09:34:34 +08:00
parent 3ad637e1fa
commit 2d91f45809
5 changed files with 307 additions and 0 deletions

View File

@@ -70,6 +70,13 @@ macro_rules! parse_to_oklch {
.into_format::<f32>(),
)
};
($origin: expr) => {
palette::Oklch::from_color(
palette::Srgb::from_str($origin)
.map_err(|_| crate::errors::ColorError::UnrecogniazedRGB($origin.to_string()))?
.into_format::<f32>(),
)
};
}
#[macro_export]