Skip to main content

NINE_LEVELS

Constant NINE_LEVELS 

Source
pub const NINE_LEVELS: [char; 9];
Expand description

The nine bar levels from empty to full, indexed 0..=8: a blank cell, then ONE_EIGHTH through FULL in order.

Indexing this directly by round(fraction * 8.0) as usize turns a 0.0..=1.0 magnitude into the right glyph for one bar column. Six of these eight are outside CP437 (only ’ ’ and FULL are covered); a pixel backend resolving glyphs through a CP437 table draws the other six as its fallback solid block, which erases the ramp’s granularity. For a bar that has to stay legible on a CP437-only tileset/sprite path, use SHADE_LEVELS instead.