fastpyxl.styles.fills module

class fastpyxl.styles.fills.Fill(**kwargs: Any)[source]

Bases: Serialisable

Base class

classmethod from_tree(el)[source]
tagname = 'fill'
class fastpyxl.styles.fills.GradientFill(type='linear', degree=0, left=0, right=0, top=0, bottom=0, stop=())[source]

Bases: Fill

Fill areas with gradient

Two types of gradient fill are supported:

  • A type=’linear’ gradient interpolates colours between a set of specified Stops, across the length of an area. The gradient is left-to-right by default, but this orientation can be modified with the degree attribute. A list of Colors can be provided instead and they will be positioned with equal distance between them.

  • A type=’path’ gradient applies a linear gradient from each edge of the area. Attributes top, right, bottom, left specify the extent of fill from the respective borders. Thus top=”0.2” will fill the top 20% of the cell.

bottom: float | None
degree: float | None
property fill_type
left: float | None
right: float | None
stop: list[Stop]
tagname = 'gradientFill'
to_tree(tagname=None, namespace=None, idx=None)[source]
top: float | None
type: str | None
class fastpyxl.styles.fills.PatternFill(patternType=None, fgColor=<fastpyxl.styles.colors.Color object>, bgColor=<fastpyxl.styles.colors.Color object>, fill_type=None, start_color=None, end_color=None)[source]

Bases: Fill

Area fill patterns for use in styles. Caution: if you do not specify a fill_type, other attributes will have no effect !

bgColor: Color | None
property end_color
fgColor: Color | None
property fill_type
patternType: str | None
property start_color
tagname = 'patternFill'
to_tree(tagname=None, idx=None)[source]
class fastpyxl.styles.fills.Stop(color, position)[source]

Bases: Serialisable

color: Color | None
position: float | None
tagname = 'stop'