pub fn ansi_density(s: &str) -> f64
Returns the ratio of ANSI escape characters to total string length.