Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using color in python
#9
You really don't need that 'color' thing. You could also just do it like that:

WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
DARKGREY = (40, 40, 40)
LIGHTGREY = (100, 100, 100)
GREEN = (0, 255, 0)
RED = (255, 0, 0)
YELLOW = (255, 255, 0)
BROWN = (106, 55, 5)
DARKGREEN = (0, 100, 0, 255)
ORANGE = (255,100,10)
Then if you want to use the colour somewhere, e.g.

BGCOLOR = DARKGREEN
screen.fill(BGCOLOR)
That's the way I am doing it in my game.
Reply


Messages In This Thread
Using color in python - by Help_me_Please - Sep-14-2019, 03:39 PM
RE: Using color in python - by ndc85430 - Sep-14-2019, 03:45 PM
RE: Using color in python - by Help_me_Please - Sep-14-2019, 03:47 PM
RE: Using color in python - by ndc85430 - Sep-14-2019, 03:50 PM
RE: Using color in python - by Help_me_Please - Sep-14-2019, 04:13 PM
RE: Using color in python - by ndc85430 - Sep-14-2019, 04:16 PM
RE: Using color in python - by SheeppOSU - Sep-14-2019, 07:59 PM
RE: Using color in python - by Windspar - Sep-15-2019, 11:21 AM
RE: Using color in python - by Piethon - Sep-22-2019, 10:56 AM
RE: Using color in python - by Windspar - Sep-22-2019, 10:54 PM
RE: Using color in python - by adt - Sep-23-2019, 04:06 PM
RE: Using color in python - by Windspar - Sep-23-2019, 10:27 PM
RE: Using color in python - by adt - Sep-24-2019, 05:19 AM
RE: Using color in python - by SheeppOSU - Sep-28-2019, 04:09 PM
RE: Using color in python - by adt - Sep-29-2019, 04:13 AM
RE: Using color in python - by Windspar - Sep-30-2019, 10:39 AM
RE: Using color in python - by adt - Sep-30-2019, 02:58 PM

Forum Jump:

User Panel Messages

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