pub(crate) fn with_bg_color(&self, width: usize, height: usize,
                                resources: Rc<Option<ResourceTable>>,
                                bg_color: color::Rgb) -> Cell {
        match self {
            Cell::Empty =>
                Cell::Content(
                    format!("{}{}", color::Bg(bg_color), ' '.to_string().repeat(width * height))),
            Cell::Char(c) =>
                Cell::Content(
                    format!("{}{}", color::Bg(bg_color), (*c).to_string().repeat(width * height))),
            Cell::ResourceId(id) => {
                if let Some(rt) = resources.as_ref() {
                    let content = &rt[id];
                    Cell::Content(format!("{}{}", color::Bg(bg_color), content))
                } else {
                    panic!(RESOURCE_TABLE_ERR_MSG);
                }
            },
            Cell::Content(content) => Cell::Content(format!("{}{}", color::Bg(bg_color), content))
        }
    }
// Create new cell from this one by adding background color. Used by Cursor.
Create new cell from this one by adding background color. Used by Cursor.
Create new cell from this one by adding background color . Used by Cursor .
pub(crate) fn with_bg_color(&self, width: usize, height: usize,
                                resources: Rc<Option<ResourceTable>>,
                                bg_color: color::Rgb) -> Cell {
        match self {
            Cell::Empty =>
                Cell::Content(
                    format!("{}{}", color::Bg(bg_color), ' '.to_string().repeat(width * height))),
            Cell::Char(c) =>
                Cell::Content(
                    format!("{}{}", color::Bg(bg_color), (*c).to_string().repeat(width * height))),
            Cell::ResourceId(id) => {
                if let Some(rt) = resources.as_ref() {
                    let content = &rt[id];
                    Cell::Content(format!("{}{}", color::Bg(bg_color), content))
                } else {
                    panic!(RESOURCE_TABLE_ERR_MSG);
                }
            },
            Cell::Content(content) => Cell::Content(format!("{}{}", color::Bg(bg_color), content))
        }
    }
pub ( crate ) fn with_bg_color ( & self , width : usize , height : usize , resources : Rc < Option < ResourceTable > > , bg_color : color :: Rgb ) -> Cell { match self { Cell :: Empty => Cell :: Content ( format ! ( " " color Bg ( bg_color ) ' ' to_string ( ) repeat ( width height ) ) ) , Cell :: Char ( c ) => Cell :: Content ( format ! ( " " color Bg ( bg_color ) ( c ) to_string ( ) repeat ( width height ) ) ) , Cell :: ResourceId ( id ) => { if let Some ( rt ) = resources . as_ref ( ) { let content = & rt [ id ] ; Cell :: Content ( format ! ( " " color Bg ( bg_color ) content ) ) } else { panic ! ( RESOURCE_TABLE_ERR_MSG ) ; } } , Cell :: Content ( content ) => Cell :: Content ( format ! ( " " color Bg ( bg_color ) content ) ) } }
Create new cell from this one by adding background color.
Create new cell from this one by adding background color .
&self
width
usize
height
usize
resources
Rc<Option<ResourceTable>>
bg_color
color::Rgb
&self
width
usize
height
usize
resources
Rc<Option<ResourceTable>>
bg_color
color::Rgb