Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more.
0

Shapes error in clue
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Shapes error in clue

by Teddygag on Wed Mar 25, 2020 12:12 pm

Can someone please help me. I ran the following code on the clue and got the error that the fill attribute is not right. Run it yourself to see the error. If you remove the fill=clue.RED, the program displays the pentagram.
Code: Select all | TOGGLE FULL SIZE

"""CLUE Polygon-pentagon"""
import board
from adafruit_clue import clue
from adafruit_display_shapes.polygon import Polygon
import displayio

display = board.DISPLAY

clue_group = displayio.Group(max_size=2)

a_polygon = Polygon([(119, 0), (233, 80), (191, 214), (48, 214), (6, 80), (119,0)], outline=clue.GREEN, fill=clue.RED)

clue_group.append(a_polygon)

while True:
    display.show(clue_group)


Teddygag
 
Posts: 12
Joined: Thu Feb 20, 2020 5:31 pm

Re: Shapes error in clue

by adafruit_support_carter on Thu Mar 26, 2020 2:10 pm

The polygon shape only has an outline option:
https://github.com/adafruit/Adafruit_Ci ... gon.py#L58
so there is currently no fill option.

adafruit_support_carter
 
Posts: 14872
Joined: Tue Nov 29, 2016 2:45 pm

Re: Shapes error in clue

by Teddygag on Fri Mar 27, 2020 7:31 pm

Thank you. I got this info from reading through the shapes library. I downloaded the raw files so I could scroll through them. That way I can get the parameters for a command. Evidently the fill attribute was never implemented. Strange as the rectangle, circle,triangle,rounded rectangle shapes do have the attribute.

Either way I am a user not a developer so I accept your answer as fact. Thank you.

Teddygag
 
Posts: 12
Joined: Thu Feb 20, 2020 5:31 pm

Please be positive and constructive with your questions and comments.