graphinglib.Rectangle.from_center#
- classmethod Rectangle.from_center(x: float, y: float, width: float, height: float, fill: bool = 'default', fill_color: str = 'default', edge_color: str = 'default', line_width: float | Literal['default'] = 'default', line_style: str = 'default', fill_alpha: float | Literal['default'] = 'default') Self [source]#
Creates a
Rectangle
from its center point, width and height.- Parameters:
- xfloat
The x coordinate of the center point.
- yfloat
The y coordinate of the center point.
- widthfloat
The width of the
Rectangle
.- heightfloat
The height of the
Rectangle
.- fillbool, optional
Whether the rectangle should be filled or not. Default depends on the
figure_style
configuration.- fill_colorstr, optional
The color of the rectangle’s fill. Default depends on the
figure_style
configuration.- edge_colorstr, optional
The color of the rectangle’s edge. Default depends on the
figure_style
configuration.- line_widthfloat, optional
The width of the line. Default depends on the
figure_style
configuration.- line_stylestr, optional
The style of the line. Default depends on the
figure_style
configuration.- fill_alphafloat, optional
The alpha value of the fill. Default depends on the
figure_style
configuration.