Ignore:
Timestamp:
May 10, 2011, 1:56:59 PM (14 years ago)
Author:
rick
Message:

Rounding errors, colour cannot be more than 255

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/django_gheat/website/tile.py

    r9172 r9174  
    5858    alpha_per_radius = float(2.55 * (100 - transparancy)) / radius
    5959    for r in range(radius,1,-1):
    60       alpha = int((radius - r) * alpha_per_radius)
    61       pygame.draw.circle(new_surf,colour + (alpha,),center,r,0)
     60      alpha = min(255,int((radius - r) * alpha_per_radius))
     61      combined_colour = colour + (alpha,)
     62      pygame.draw.circle(new_surf,combined_colour,center,r,0)
    6263    self.surf.blit(new_surf,(0,0),special_flags=pygame.BLEND_RGBA_MAX)
    6364
Note: See TracChangeset for help on using the changeset viewer.