Add triangle shapes to display component (#3544)

This commit is contained in:
mathieu-mp 2024-01-16 07:38:12 +01:00 committed by GitHub
parent 215e8f6eb0
commit b5f9550cf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,6 +95,12 @@ and circles:
// ... and the same thing filled again
it.filled_circle(25, 25, 10);
// Triangles... Let's draw the outline of a triangle from the [x,y] coordinates of its three points
// [25,5], [5,25], [50,50]
it.triangle(25, 5, 5, 25, 50, 50);
// and a filled triangle !
it.filled_triangle(125, 5, 105, 25, 150, 50);
All the above methods can optionally also be called with an argument at the end which specifies in which
color to draw. For monochrome displays, only ``COLOR_ON`` (the default if color is not given) and ``COLOR_OFF`` are supported.