fn create_border_box(x: u16, y: u16, width: u16, height: u16, fg: Color, bg: Color) {
    
    let mut stdout = stdout();

    // Create the top of the box
    execute!(
        stdout,
        cursor::MoveTo(x, y),
        SetForegroundColor(fg),
        SetBackgroundColor(bg),
        Print(chars::TOP_LEFT),
        Print(chars::HORIZONTAL.repeat((width - 2) as usize)),
        Print(chars::TOP_RIGHT),
        ResetColor
    ).unwrap();

    // Create all the sides
    for i in 0..(height - 2) {
        execute!(
            stdout,
            cursor::MoveTo(x, y + (i + 1)),
            SetForegroundColor(fg),
            SetBackgroundColor(bg),
            Print(chars::VERTICAL),
            Print(chars::EMPTY.repeat((width - 2) as usize)),
            Print(chars::VERTICAL),
            ResetColor
        ).unwrap();
    }

    // Create the bottom of the box
    execute!(
        stdout,
        cursor::MoveTo(x, y + height - 1),
        SetForegroundColor(fg),
        SetBackgroundColor(bg),
        Print(chars::BOTTOM_LEFT),
        Print(chars::HORIZONTAL.repeat((width - 2) as usize)),
        Print(chars::BOTTOM_RIGHT),
        ResetColor
    ).unwrap();
}
/// A function that creates a border box
A function that creates a border box
A function that creates a border box
fn create_border_box(x: u16, y: u16, width: u16, height: u16, fg: Color, bg: Color) {
    let mut stdout = stdout();
    // Create the top of the box
    execute!(
        stdout,
        cursor::MoveTo(x, y),
        SetForegroundColor(fg),
        SetBackgroundColor(bg),
        Print(chars::TOP_LEFT),
        Print(chars::HORIZONTAL.repeat((width - 2) as usize)),
        Print(chars::TOP_RIGHT),
        ResetColor
    ).unwrap();
    // Create all the sides
    for i in 0..(height - 2) {
        execute!(
            stdout,
            cursor::MoveTo(x, y + (i + 1)),
            SetForegroundColor(fg),
            SetBackgroundColor(bg),
            Print(chars::VERTICAL),
            Print(chars::EMPTY.repeat((width - 2) as usize)),
            Print(chars::VERTICAL),
            ResetColor
        ).unwrap();
    }
    // Create the bottom of the box
    execute!(
        stdout,
        cursor::MoveTo(x, y + height - 1),
        SetForegroundColor(fg),
        SetBackgroundColor(bg),
        Print(chars::BOTTOM_LEFT),
        Print(chars::HORIZONTAL.repeat((width - 2) as usize)),
        Print(chars::BOTTOM_RIGHT),
        ResetColor
    ).unwrap();
}
fn create_border_box ( x : u16 , y : u16 , width : u16 , height : u16 , fg : Color , bg : Color ) { let mut stdout = stdout ( ) ; // Create the top of the box execute ! ( stdout cursor MoveTo ( x y ) SetForegroundColor ( fg ) SetBackgroundColor ( bg ) Print ( chars TOP_LEFT ) Print ( chars HORIZONTAL repeat ( ( width 2 ) as usize ) ) Print ( chars TOP_RIGHT ) ResetColor ) . unwrap ( ) ; // Create all the sides for i in 0 .. ( height - 2 ) { execute ! ( stdout cursor MoveTo ( x y ( i 1 ) ) SetForegroundColor ( fg ) SetBackgroundColor ( bg ) Print ( chars VERTICAL ) Print ( chars EMPTY repeat ( ( width 2 ) as usize ) ) Print ( chars VERTICAL ) ResetColor ) . unwrap ( ) ; } // Create the bottom of the box execute ! ( stdout cursor MoveTo ( x y height 1 ) SetForegroundColor ( fg ) SetBackgroundColor ( bg ) Print ( chars BOTTOM_LEFT ) Print ( chars HORIZONTAL repeat ( ( width 2 ) as usize ) ) Print ( chars BOTTOM_RIGHT ) ResetColor ) . unwrap ( ) ; }
A function that creates a border box
A function that creates a border box
x
u16
y
u16
width
u16
height
u16
fg
Color
bg
Color
x
u16
y
u16
width
u16
height
u16
fg
Color
bg
Color