Python Forum
How do you set the alpha of a color???
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do you set the alpha of a color???
#8
Pygame draw rect does not use alpha. It will accept the color values. But it will always ignore alpha.

You can also darken colors with hsla.
import pygame
orange = pygame.Color("orange")
print(orange)
darken = orange.hsla
darken = darken[0], darken[1], darken[2] - 5, darken[3]
orange.hsla = darken
print(orange)
99 percent of computer problems exists between chair and keyboard.
Reply


Messages In This Thread
RE: How do you set the alpha of a color??? - by Windspar - Jan-15-2020, 11:24 AM

Forum Jump:

User Panel Messages

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