/// ANSI escape codes used for terminal output coloring.
pub struct Colors {
    pub green: &'static str,
    pub cyan: &'static str,
    pub red: &'static str,
    pub yellow: &'static str,
    pub bold: &'static str,
    pub reset: &'static str,
}

/// Returns a [`Colors`] instance with ANSI codes when `enabled` is true,
/// or empty strings when false (e.g. when `color = false` in sbpkg.toml).
pub fn get_colors(enabled: bool) -> Colors {
    if enabled {
        Colors {
            green: "\x1b[32m",
            cyan: "\x1b[96m",
            red: "\x1b[91m",
            yellow: "\x1b[93m",
            bold: "\x1b[1m",
            reset: "\x1b[0m",
        }
    } else {
        Colors {
            green: "",
            cyan: "",
            red: "",
            yellow: "",
            bold: "",
            reset: "",
        }
    }
}
