In the config file I have the variable defined as
BackgroundColor = 0,0,0
Which should work for the screen.fill settings for Pygame or any color argument for that matter. Where I can just do screen.fill(0,0,0)
The problem I think is with this is that for integers read through a configfile I have to put int() to convert the string to an int. For something like colors int doesnt work and I have no idea what should be used.
TypeError: invalid color argument
That’s the error from python.
You’ve got a string representing the color, e.g.
'0,0,0'. Usesplit(',')to split it into separate fields, then convert each one.e.g.
Or if you want to do it in one step and the comprehensions don’t bother you: