ooodev.format.inner.modify.write.para.area.gradient module

class ooodev.format.inner.modify.write.para.area.gradient.Gradient(*, style=GradientStyle.LINEAR, step_count=0, offset=Offset(x=50, y=50), angle=0, border=0, grad_color=ColorRange(start=0, end=16777215), grad_intensity=IntensityRange(start=100, end=100), name='', style_name=StyleParaKind.STANDARD, style_family='ParagraphStyles')[source]

Bases: ParaStyleBaseMulti

Paragraph Style Gradient Color

New in version 0.9.0.

__init__(*, style=GradientStyle.LINEAR, step_count=0, offset=Offset(x=50, y=50), angle=0, border=0, grad_color=ColorRange(start=0, end=16777215), grad_intensity=IntensityRange(start=100, end=100), name='', style_name=StyleParaKind.STANDARD, style_family='ParagraphStyles')[source]

Constructor

Parameters:
  • style (GradientStyle, optional) – Specifies the style of the gradient. Defaults to GradientStyle.LINEAR.

  • step_count (int, optional) – Specifies the number of steps of change color. Defaults to 0.

  • offset (Offset, int, optional) – Specifies the X and Y coordinate, where the gradient begins. X is effectively the center of the RADIAL, ELLIPTICAL, SQUARE and RECT style gradients. Defaults to Offset(50, 50).

  • angle (Angle, int, optional) – Specifies angle of the gradient. Defaults to 0.

  • border (int, optional) – Specifies percent of the total width where just the start color is used. Defaults to 0.

  • grad_color (ColorRange, optional) – Specifies the color at the start point and stop point of the gradient. Defaults to ColorRange(Color(0), Color(16777215)).

  • grad_intensity (IntensityRange, optional) – Specifies the intensity at the start point and stop point of the gradient. Defaults to IntensityRange(100, 100).

  • name (str, optional) – Specifies the Fill Gradient Name.

  • style_name (StyleParaKind, str, optional) – Specifies the Paragraph Style that instance applies to. Default is Default Paragraph Style.

  • style_family (str, optional) – Style family. Default ParagraphStyles.

Return type:

None

static from_preset(preset, style_name=StyleParaKind.STANDARD, style_family='ParagraphStyles')[source]

Gets instance from preset

Parameters:
Returns:

Gradient from a preset.

Return type:

Gradient

classmethod from_style(doc, style_name=StyleParaKind.STANDARD, style_family='ParagraphStyles')[source]

Gets instance from Document.

Parameters:
  • doc (Any) – UNO Document Object.

  • style_name (StyleParaKind, str, optional) – Specifies the Paragraph Style that instance applies to. Default is Default Paragraph Style.

  • style_family (str, optional) – Style family. Default ParagraphStyles.

Returns:

Alignment instance from document properties.

Return type:

Alignment

property prop_inner: Gradient

Gets Inner Gradient instance

Return type:

Gradient

property prop_style_name: str

Gets/Sets property Style Name

Return type:

str