use super::types::MunsellSpec;
use super::parsing::parse_munsell_notation;
#[deprecated(
since = "1.2.0",
note = "Use ColorClassifier for unified color naming. Access semantic names via ColorDescriptor::semantic_name. This function will be removed in v2.0.0."
)]
pub fn semantic_overlay(color: &MunsellSpec) -> Option<&'static str> {
let registry = crate::semantic_overlay_data::get_registry();
registry.best_match(color).map(|o| o.name)
}
#[deprecated(
since = "1.2.0",
note = "Use ColorClassifier for unified color naming. Access semantic matches via ColorDescriptor::semantic_name and semantic_alternates. This function will be removed in v2.0.0."
)]
pub fn matching_overlays(color: &MunsellSpec) -> Vec<&'static str> {
let registry = crate::semantic_overlay_data::get_registry();
registry.matching_overlays(color)
.into_iter()
.map(|o| o.name)
.collect()
}
#[deprecated(
since = "1.2.0",
note = "Use ColorClassifier for unified color naming. Access ranked matches via ColorDescriptor::nearest_semantic_descriptor(). This function will be removed in v2.0.0."
)]
pub fn matching_overlays_ranked(color: &MunsellSpec) -> Vec<(&'static str, f64)> {
let registry = crate::semantic_overlay_data::get_registry();
registry.matching_overlays_ranked(color)
.into_iter()
.map(|(o, d)| (o.name, d))
.collect()
}
#[deprecated(
since = "1.2.0",
note = "Use ColorClassifier for unified color naming. Check semantic matches via ColorDescriptor. This function will be removed in v2.0.0."
)]
pub fn matches_overlay(color: &MunsellSpec, overlay_name: &str) -> bool {
let registry = crate::semantic_overlay_data::get_registry();
registry.matches(color, overlay_name)
}
#[deprecated(
since = "1.2.0",
note = "Use ColorClassifier for unified color naming. Access nearest overlay via ColorDescriptor::nearest_semantic. This function will be removed in v2.0.0."
)]
pub fn closest_overlay(color: &MunsellSpec) -> Option<(&'static str, f64)> {
let registry = crate::semantic_overlay_data::get_registry();
registry.closest_overlay(color).map(|(o, d)| (o.name, d))
}
#[deprecated(
since = "1.2.0",
note = "Use ColorClassifier::classify_munsell() for unified color naming. This function will be removed in v2.0.0."
)]
#[allow(deprecated)]
pub fn semantic_overlay_from_notation(notation: &str) -> Option<&'static str> {
let spec = parse_munsell_notation(notation)?;
semantic_overlay(&spec)
}