feat: detect color

This commit is contained in:
PandaDEV 2024-12-18 14:15:20 +10:00
parent 345f7e3f09
commit 4ab938a3de
No known key found for this signature in database
GPG key ID: 13EFF9BAF70EE75C
3 changed files with 126 additions and 27 deletions

View file

@ -164,6 +164,11 @@ pub fn setup<R: Runtime>(app: &AppHandle<R>) {
pool,
HistoryItem::new(app_name, ContentType::Code, text, None, app_icon, Some(language))
).await;
} else if crate::utils::commands::detect_color(&text) {
let _ = db::history::add_history_item(
pool,
HistoryItem::new(app_name, ContentType::Color, text, None, app_icon, None)
).await;
} else {
let _ = db::history::add_history_item(
pool,