spreadsheet_intelligence.models.common package#
Submodules#
spreadsheet_intelligence.models.common.common_data module#
- class spreadsheet_intelligence.models.common.common_data.Color(hex_code: str | None = None, r: int | None = None, g: int | None = None, b: int | None = None, alpha: float = 1.0)[source]#
Bases:
object
Represents a color with RGBA values.
- hex_code#
The hexadecimal color code.
- Type:
str
- r#
The red component of the color.
- Type:
int
- g#
The green component of the color.
- Type:
int
- b#
The blue component of the color.
- Type:
int
- alpha#
The alpha component of the color.
- Type:
float
- _validate_alpha(alpha: float) float [source]#
Validates the alpha value and raises an exception if it is out of range.
- Parameters:
alpha (float) – The alpha value to validate.
- Returns:
The valid alpha value.
- Return type:
float
- _hex_to_rgb(hex_code: str) tuple [source]#
Converts a hexadecimal color code to an RGB tuple.
- Parameters:
hex_code (str) – The hexadecimal color code.
- Returns:
The RGB tuple.
- Return type:
tuple
- Raises:
ValueError – If the hex_code is not 6 characters long.
- adjust_color(lum_mod: int | None, lum_off: int | None, shade: int | None) Color [source]#
Adjusts the color based on the given parameters.
- Parameters:
lum_mod (Optional[int]) – The luminance adjustment value.
lum_off (Optional[int]) – The luminance adjustment value.
shade (Optional[int]) – The hue adjustment value.
- Returns:
The adjusted 16-bit color code.
- Return type:
str
spreadsheet_intelligence.models.common.enums module#
- class spreadsheet_intelligence.models.common.enums.FourDirection(*values)[source]#
Bases:
Enum
Enum representing four cardinal directions.
- UP = 0#
- RIGHT = 1#
- DOWN = 2#
- LEFT = 3#
- flip_h(rotation: int)[source]#
Flip the direction horizontally based on the rotation.
- Parameters:
rotation (int) – The rotation angle in degrees.
- Returns:
The flipped direction.
- Return type:
- flip_v(rotation: int)[source]#
Flip the direction vertically based on the rotation.
- Parameters:
rotation (int) – The rotation angle in degrees.
- Returns:
The flipped direction.
- Return type:
- rotate(num_of_ninty: int)[source]#
Rotate the direction by a multiple of 90 degrees.
- Parameters:
num_of_ninty (int) – The number of 90-degree rotations.
- Returns:
The rotated direction.
- Return type:
- class spreadsheet_intelligence.models.common.enums.ConnectorType(*values)[source]#
Bases:
Enum
Enum representing types of connectors.
- BENT_CONNECTOR_3 = 1#
- STRAIGHT_CONNECTOR_1 = 2#
- class spreadsheet_intelligence.models.common.enums.ShapeType(*values)[source]#
Bases:
Enum
Enum representing types of shapes.
- RECT = 1#
- ROUND_RECT = 2#