fltk_form/utils.rs
1use color_maps::html::HTML_MAP;
2
3pub fn color_map_adaptor(html_name: &str) -> String {
4 if html_name.starts_with('#') {
5 return html_name.to_string();
6 }
7 if let Some(col) = HTML_MAP.get(html_name) {
8 format!("#{:02x}{:02x}{:02x}", col.0, col.1, col.2)
9 } else {
10 html_name.to_string()
11 }
12}