ooodev.format.inner.direct.structs.gradient_struct module
Module for Gradient struct.
New in version 0.9.0.
- class ooodev.format.inner.direct.structs.gradient_struct.GradientStruct(*, style=GradientStyle.LINEAR, step_count=0, x_offset=50, y_offset=50, angle=0, border=0, start_color=0, start_intensity=100, end_color=16777215, end_intensity=100)[source]
Bases:
StructBaseRepresents UNO
Gradientstruct.New in version 0.9.0.
- __init__(*, style=GradientStyle.LINEAR, step_count=0, x_offset=50, y_offset=50, angle=0, border=0, start_color=0, start_intensity=100, end_color=16777215, end_intensity=100)[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.x_offset (Intensity, int, optional) – Specifies the X-coordinate, where the gradient begins. This is effectively the center of the
RADIAL,ELLIPTICAL,SQUAREandRECTstyle gradients. Defaults to50.y_offset (Intensity, int, optional) – Specifies the Y-coordinate, where the gradient begins. See:
x_offset. Defaults to50.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.
start_color (
Color, optional) – Specifies the color at the start point of the gradient. Defaults toColor(0).start_intensity (Intensity, int, optional) – Specifies the intensity at the start point of the gradient. Defaults to
100.end_color (
Color, optional) – Specifies the color at the end point of the gradient. Defaults toColor(16777215).end_intensity (Intensity, int, optional) – Specifies the intensity at the end point of the gradient. Defaults to
100.
- Raises:
ValueError – If
step_countis less than zero.- Return type:
None
- apply(obj: Any)[source]
- apply(obj, **kwargs)
Applies tab properties to
obj- Parameters:
obj (object) – UNO object.
- Return type:
None
- classmethod from_obj(obj)[source]
- classmethod from_obj(obj, **kwargs)
- classmethod from_obj(obj, **kwargs)
Gets instance from object
- Parameters:
obj (object) – UNO object
- Raises:
PropertyNotFoundError – If
objdoes not have required property- Returns:
GradientStructinstance that representsobjgradient properties.- Return type:
- classmethod from_preset(preset)[source]
- classmethod from_preset(preset, **kwargs)
- classmethod from_preset(preset, **kwargs)
Gets instance from preset.
- Parameters:
preset (PresetGradientKind) – Preset.
- Returns:
Gradient from a preset.
- Return type:
New in version 0.10.2.
- classmethod from_uno_struct(value)[source]
- classmethod from_uno_struct(value, **kwargs)
- classmethod from_uno_struct(value, **kwargs)
Converts a
Gradientinstance to aGradientStruct.- Parameters:
value (Gradient) – UNO
Gradient.- Returns:
GradientStructset withGradientproperties.- Return type:
- get_attrs()[source]
Gets the attributes that are slated for change in the current instance
- Returns:
Tuple of attributes
- Return type:
Tuple(str, …)
- get_json()[source]
Get Gradient represented as a json string for use with dispatch commands.
- Returns:
Json string.
- Return type:
str
- property prop_border: Intensity
Gets/Sets percent of the total width where just the start color is used.
- Return type:
- property prop_end_color: Color
Gets/Sets the color at the end point of the gradient.
- Return type:
NewType()(Color,int)
- property prop_end_intensity: Intensity
Gets/Sets the intensity at the end point of the gradient.
- Return type:
- property prop_format_kind: FormatKind
Gets the kind of style
- Return type:
- property prop_start_color: Color
Gets/Sets the color at the start point of the gradient.
- Return type:
NewType()(Color,int)
- property prop_start_intensity: Intensity
Gets/Sets the intensity at the start point of the gradient.
- Return type:
- property prop_step_count: int
Gets/Sets the number of steps of change color.
- Return type:
int
- property prop_style: GradientStyle
Gets/Sets the style of the gradient.
- Return type:
GradientStyle