diff --git a/tinted-builder-rust/src/operations/build.rs b/tinted-builder-rust/src/operations/build.rs index 8645840..da44f6d 100644 --- a/tinted-builder-rust/src/operations/build.rs +++ b/tinted-builder-rust/src/operations/build.rs @@ -110,9 +110,30 @@ pub fn build( .clone() .unwrap_or(vec![SchemeSystem::default()]); + // Render list, otherwise generate if supported_systems.contains(&SchemeSystem::List) { + let supported_systems = &[SchemeSystem::Base16, SchemeSystem::Base24]; render_list( &theme_template_path, + supported_systems, + (template_item_config_name, template_item_config_value), + all_scheme_files.clone(), + is_quiet, + )?; + } else if supported_systems.contains(&SchemeSystem::ListBase16) { + let supported_systems = &[SchemeSystem::Base16]; + render_list( + &theme_template_path, + supported_systems, + (template_item_config_name, template_item_config_value), + all_scheme_files.clone(), + is_quiet, + )?; + } else if supported_systems.contains(&SchemeSystem::ListBase24) { + let supported_systems = &[SchemeSystem::Base24]; + render_list( + &theme_template_path, + supported_systems, (template_item_config_name, template_item_config_value), all_scheme_files.clone(), is_quiet, @@ -144,14 +165,11 @@ pub fn build( fn render_list( template_path: impl AsRef, + supported_systems: &[SchemeSystem], (config_name, config_value): (&str, &TemplateConfig), all_scheme_files: Vec<(PathBuf, Scheme)>, is_quiet: bool, ) -> Result<()> { - let supported_systems = config_value - .supported_systems - .clone() - .unwrap_or(vec![SchemeSystem::default()]); let filename = get_filename(config_value, is_quiet)?; let mustache_template_path = template_path .as_ref() diff --git a/tinted-builder/src/scheme.rs b/tinted-builder/src/scheme.rs index 30444fe..d5e3fb7 100644 --- a/tinted-builder/src/scheme.rs +++ b/tinted-builder/src/scheme.rs @@ -80,6 +80,8 @@ pub enum SchemeSystem { /// Base24 scheme system. Base24, List, + ListBase16, + ListBase24, } impl SchemeSystem { @@ -89,6 +91,8 @@ impl SchemeSystem { SchemeSystem::Base16 => "base16", SchemeSystem::Base24 => "base24", SchemeSystem::List => "list", + SchemeSystem::ListBase16 => "listbase16", + SchemeSystem::ListBase24 => "listbase24", } } pub fn variants() -> &'static [SchemeSystem] { diff --git a/tinted-builder/src/scheme/base16.rs b/tinted-builder/src/scheme/base16.rs index bf1fd29..86da325 100644 --- a/tinted-builder/src/scheme/base16.rs +++ b/tinted-builder/src/scheme/base16.rs @@ -102,7 +102,7 @@ impl<'de> Deserialize<'de> for Base16Scheme { ))); } } - SchemeSystem::List => { + _ => { return Err(serde::de::Error::custom(format!( "{} is not a valid Scheme system for a specific scheme", wrapper.system