Changeset - 91cbbc91596a
[Not reviewed]
0 1 0
Brett Smith - 3 years ago 2021-01-23 15:22:42
brettcsmith@brettcsmith.org
reports.core: Add BaseODS.bgcolor_style() method.
1 file changed with 12 insertions and 0 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/reports/core.py
Show inline comments
...
 
@@ -896,6 +896,18 @@ class BaseODS(BaseSpreadsheet[RT, ST], metaclass=abc.ABCMeta):
 

	
 
    ### Styles
 

	
 
    def bgcolor_style(self, color: str) -> odf.style.Style:
 
        key =f'BGColor{color.lstrip("#")}'
 
        try:
 
            retval = self._style_cache[key]
 
        except KeyError:
 
            props = odf.style.TableCellProperties(backgroundcolor=color)
 
            retval = odf.style.Style(name=key, family='table-cell')
 
            retval.addElement(props)
 
            self.document.styles.addElement(retval)
 
            self._style_cache[key] = retval
 
        return retval
 

	
 
    def border_style(self,
 
                     edges: int,
 
                     width: str='1px',
0 comments (0 inline, 0 general)