Python Forum
Coloring a surface with transparency
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Coloring a surface with transparency
#1
Hello all,

I am completely new here, I hope my question is correct here. I am programming a football manager game and would like to add a selection of a jersey color. The RGB colors are completely free selectable and a jersey should be colored in exactly this color.

My first approach was to load a white jersey with transparent background as Surface, and fill it with the desired color. However, I then only get a square box with the color, obviously the transparent pixels are also filled with the color. In addition, the black pixels (folds in the jersey) were also colored.

My goal is to have a jersey filled with the desired color, but still have a transparent background. I would be very happy about any hints or suggestions for solutions.

I am using Pygame.

Many greetings
Sandor
Reply


Messages In This Thread
Coloring a surface with transparency - by Sandor - Dec-29-2021, 05:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] Surface and rectangle in pygame Fabrizio_fg 7 6,923 Apr-15-2025, 05:04 PM
Last Post: jassonadder
  [PyGame] Pygame is treating blob_group as a surface, when I need it to treat it as a Sprite. Swagford 1 2,442 Jan-24-2023, 09:58 PM
Last Post: metulburr
  Drawn line shift when that surface is copied to another in pygame Leo_Red 4 4,585 Feb-11-2021, 06:33 AM
Last Post: Leo_Red
  [PyGame] pygame.Surface.fill help Shemira 3 7,855 Nov-29-2019, 12:01 AM
Last Post: Shemira
  pygame.surface Graham 10 11,317 Nov-29-2018, 04:45 PM
Last Post: nilamo
  [PyGame] PLEASE HELP! TypeError: unsupported operand type(s) for +: 'pygame.Surface' and 'int' keyfive 1 6,480 Jun-19-2018, 01:20 PM
Last Post: volcano63

Forum Jump:

User Panel Messages

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