circle

Various common shapes for use with displayio - Circle shape!

  • Author(s): Limor Fried

Implementation Notes

Software and Dependencies:

class adafruit_display_shapes.circle.Circle(*args: Any, **kwargs: Any)

A circle.

Parameters
  • x0 – The x-position of the center.

  • y0 – The y-position of the center.

  • r – The radius of the circle.

  • fill – The color to fill the circle. Can be a hex value for a color or None for transparent.

  • outline – The outline of the circle. Can be a hex value for a color or None for no outline.

  • stroke – Used for the outline. Will not change the radius.

property x0

The x-position of the center of the circle.

property y0

The y-position of the center of the circle.

rect

Various common shapes for use with displayio - Rectangle shape!

  • Author(s): Limor Fried

Implementation Notes

Software and Dependencies:

class adafruit_display_shapes.rect.Rect(*args: Any, **kwargs: Any)

A rectangle.

Parameters
  • x – The x-position of the top left corner.

  • y – The y-position of the top left corner.

  • width – The width of the rectangle.

  • height – The height of the rectangle.

  • fill – The color to fill the rectangle. Can be a hex value for a color or None for transparent.

  • outline – The outline of the rectangle. Can be a hex value for a color or None for no outline.

  • stroke – Used for the outline. Will not change the outer bound size set by width and height.

property fill

The fill of the rectangle. Can be a hex value for a color or None for transparent.

property height: int

return: the height of the rectangle in pixels

property outline

The outline of the rectangle. Can be a hex value for a color or None for no outline.

property width: int

return: the width of the rectangle in pixels

roundrect

A slightly modified version of Adafruit_CircuitPython_Display_Shapes that includes an explicit call to palette.make_opaque() in the fill color setter function.

class adafruit_display_shapes.roundrect.RoundRect(*args: Any, **kwargs: Any)

A round-corner rectangle.

Parameters
  • x – The x-position of the top left corner.

  • y – The y-position of the top left corner.

  • width – The width of the rounded-corner rectangle.

  • height – The height of the rounded-corner rectangle.

  • r – The radius of the rounded corner.

  • fill – The color to fill the rounded-corner rectangle. Can be a hex value for a color or None for transparent.

  • outline – The outline of the rounded-corner rectangle. Can be a hex value for a color or None for no outline.

  • stroke – Used for the outline. Will not change the outer bound size set by width and height.

property fill

The fill of the rounded-corner rectangle. Can be a hex value for a color or None for transparent.

property height: int

return: the height of the rounded rectangle in pixels

property outline

The outline of the rounded-corner rectangle. Can be a hex value for a color or None for no outline.

property width: int

return: the width of the rounded rectangle in pixels

triangle

Various common shapes for use with displayio - Triangle shape!

  • Author(s): Melissa LeBlanc-Williams

Implementation Notes

Software and Dependencies:

class adafruit_display_shapes.triangle.Triangle(*args: Any, **kwargs: Any)

A triangle.

Parameters
  • x0 – The x-position of the first vertex.

  • y0 – The y-position of the first vertex.

  • x1 – The x-position of the second vertex.

  • y1 – The y-position of the second vertex.

  • x2 – The x-position of the third vertex.

  • y2 – The y-position of the third vertex.

  • fill – The color to fill the triangle. Can be a hex value for a color or None for transparent.

  • outline – The outline of the triangle. Can be a hex value for a color or None for no outline.

property fill

The fill of the triangle. Can be a hex value for a color or None for transparent.

line

Various common shapes for use with displayio - Line shape!

  • Author(s): Melissa LeBlanc-Williams

Implementation Notes

Software and Dependencies:

class adafruit_display_shapes.line.Line(*args: Any, **kwargs: Any)

A line.

Parameters
  • x0 – The x-position of the first vertex.

  • y0 – The y-position of the first vertex.

  • x1 – The x-position of the second vertex.

  • y1 – The y-position of the second vertex.

  • color – The color of the line.

property color

The line color value. Can be a hex value for a color or None for no line color.

polygon

Various common shapes for use with displayio - Polygon shape!

  • Author(s): Melissa LeBlanc-Williams

Implementation Notes

Software and Dependencies:

class adafruit_display_shapes.polygon.Polygon(*args: Any, **kwargs: Any)

A polygon.

Parameters
  • points – A list of (x, y) tuples of the points

  • outline – The outline of the polygon. Can be a hex value for a color or None for no outline.

property outline

The outline of the polygon. Can be a hex value for a color or None for no outline.

sparkline

Various common shapes for use with displayio - Sparkline!

  • Author(s): Kevin Matocha

Implementation Notes

Software and Dependencies:

class adafruit_display_shapes.sparkline.Sparkline(*args: Any, **kwargs: Any)

A sparkline graph.

Parameters
  • width – Width of the sparkline graph in pixels

  • height – Height of the sparkline graph in pixels

  • max_items – Maximum number of values housed in the sparkline

  • y_min – Lower range for the y-axis. Set to None for autorange.

  • y_max – Upper range for the y-axis. Set to None for autorange.

  • x – X-position on the screen, in pixels

  • y – Y-position on the screen, in pixels

  • color – Line color, the default value is 0xFFFFFF (WHITE)

add_value(value)

Add a value to the sparkline. :param value: The value to be added to the sparkline

clear_values()

Removes all values from the _spark_list list and removes all lines in the group

update()

Update the drawing of the sparkline.

values()

Returns the values displayed on the sparkline.