Post Reply 
How to use graphic.draw_filled_polygon?
11-29-2021, 10:04 AM
Post: #10
RE: How to use graphic.draw_filled_polygon?
(11-29-2021 12:42 AM)StephenG1CMZ Wrote:  
(09-04-2021 07:43 PM)jfelten Wrote:  Here is what I got:
>from graphic import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can't convert tuple to int
Just a thought, if it can't convert tuple to int, is it expecting #nnn for colour instead of (255 255 255)?

Yes, an integer is required, be it decimal or hex. A little "lambda" may be of help to create it rather than calculate it by hand. E.g:

RGB=lambda red, green, blue: (((red*256)+green)*256)+blue

gets you a grey triangle

Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: How to use graphic.draw_filled_polygon? - Guenter Schink - 11-29-2021 10:04 AM

User(s) browsing this thread: 1 Guest(s)