openpyxl.styles.fills module¶
-
class
openpyxl.styles.fills.
Fill
[source]¶ Bases:
openpyxl.descriptors.serialisable.Serialisable
Base class
-
tagname
= 'fill'¶
-
-
class
openpyxl.styles.fills.
GradientFill
(type='linear', degree=0, left=0, right=0, top=0, bottom=0, stop=())[source]¶ Bases:
openpyxl.styles.fills.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
¶ Values must be of type <class ‘float’>
-
degree
¶ Values must be of type <class ‘float’>
-
fill_type
¶ Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptive name is desired (eg. “underline” for “u”)
-
left
¶ Values must be of type <class ‘float’>
-
right
¶ Values must be of type <class ‘float’>
-
stop
¶
-
tagname
= 'gradientFill'¶
-
top
¶ Values must be of type <class ‘float’>
-
type
¶ Value must be one of {‘path’, ‘linear’}
-
class
openpyxl.styles.fills.
PatternFill
(patternType=None, fgColor=<openpyxl.styles.colors.Color object> Parameters: rgb='00000000', indexed=None, auto=None, theme=None, tint=0.0, type='rgb', bgColor=<openpyxl.styles.colors.Color object> Parameters: rgb='00000000', indexed=None, auto=None, theme=None, tint=0.0, type='rgb', fill_type=None, start_color=None, end_color=None)[source]¶ Bases:
openpyxl.styles.fills.Fill
Area fill patterns for use in styles. Caution: if you do not specify a fill_type, other attributes will have no effect !
-
bgColor
¶ Values must be of type <class ‘openpyxl.styles.colors.Color’>
-
end_color
¶ Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptive name is desired (eg. “underline” for “u”)
-
fgColor
¶ Values must be of type <class ‘openpyxl.styles.colors.Color’>
-
fill_type
¶ Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptive name is desired (eg. “underline” for “u”)
-
patternType
¶ Value must be one of {‘darkGray’, ‘darkTrellis’, ‘lightUp’, ‘lightDown’, ‘darkHorizontal’, ‘lightGray’, ‘lightGrid’, ‘solid’, ‘darkGrid’, ‘darkDown’, ‘darkVertical’, ‘lightVertical’, ‘darkUp’, ‘lightHorizontal’, ‘mediumGray’, ‘gray125’, ‘gray0625’, ‘lightTrellis’}
-
start_color
¶ Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptive name is desired (eg. “underline” for “u”)
-
tagname
= 'patternFill'¶
-
-
class
openpyxl.styles.fills.
Stop
(color, position)[source]¶ Bases:
openpyxl.descriptors.serialisable.Serialisable
-
color
¶ Values must be of type <class ‘openpyxl.styles.colors.Color’>
-
position
¶ Values must be of type <class ‘float’>
-
tagname
= 'stop'¶
-