Python Forum
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
t.fillcolor
#1
please give a runnable sample of your code with the full error text or a clear description of the problem
I want to use colors in the order they are listed in the -- colors=["red","blue",etc.etc] specification.
The code I would use is:

for x in range (6)
code
more code
t.fillcolor(x) # This doesn't work. Is there a way to uses colors in the order they are in the colors specification?
code
more code


Dick
Reply
#2
Please write [python] before you paste your code into a post, and then write [/python] after your code is pasted.

(If you prefer, you can paste your code, select it, and then click the python icon in the formatting bar of the post entry dialogue box to enter the start and finish tags for you.)

This will preserve the layout of your code as written in your text editor / IDE, with all the indentations that are critical to python displayed normally.

Without this, the indentations are messed up when you paste code, and we are not as easily able to see where problems might be.



With fillcolor() aren't you supposed to specify either R, G, B (reg, green, blue) colour values (integers), so not just your single x OR provide a colour string, 'red' or 'green' etc, or a hex value string?

If you have a list of colours in a variable called colours, then you can index it using: for colour in colours:, and on each pass through he loop colour will contain each successive colour string.
I am trying to help you, really, even if it doesn't always seem that way
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020