def circle(self, row: int, col: int, radius: float,
color: ColorType, fill: bool=False, alpha=1.0) -> 'Layer':
"""
Draw a circle centered on the specified row and column,
with the given radius.
:param row: Center row of circle
:param col: Center column of circle
:param radius: Radius of circle
:param color: Color to draw with
:param fill: True if the circle should be filled
:return: This frame instance
"""
if fill:
rr, cc = draw.circle(row, col, round(radius), shape=self.matrix.shape)
self._draw(rr, cc, color, alpha)
else:
rr, cc, aa = draw.circle_perimeter_aa(row, col, round(radius), shape=self.matrix.shape)
self._draw(rr, cc, color, aa)
return self
评论列表
文章目录