use std::io::Write;
use crate::theme::GhosttyConfig;
pub fn apply_osc_preview(theme: &GhosttyConfig) {
let mut stdout = std::io::stdout();
let _ = write!(stdout, "\x1b]10;{}\x07", theme.foreground);
let _ = write!(stdout, "\x1b]11;{}\x07", theme.background);
if let Some(ref cursor) = theme.cursor_color {
let _ = write!(stdout, "\x1b]12;{}\x07", cursor);
}
for (i, color) in theme.palette.iter().enumerate() {
let _ = write!(stdout, "\x1b]4;{};{}\x07", i, color);
}
let _ = stdout.flush();
}
pub fn save_current_colors() -> SavedColors {
SavedColors
}
pub fn restore_colors(_saved: &SavedColors) {
let mut stdout = std::io::stdout();
let _ = write!(stdout, "\x1b]110\x07");
let _ = write!(stdout, "\x1b]111\x07");
let _ = write!(stdout, "\x1b]112\x07");
let _ = write!(stdout, "\x1b]104\x07");
let _ = stdout.flush();
}
pub struct SavedColors;