Fix alpha mixing as suggested in #75
This commit is contained in:
		
							
								
								
									
										6
									
								
								bar.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								bar.c
									
									
									
									
									
								
							| @@ -169,9 +169,9 @@ parse_color (const char *str, char **end, const uint32_t def) | |||||||
|         unsigned int b = (tmp&0x000000ff); |         unsigned int b = (tmp&0x000000ff); | ||||||
|  |  | ||||||
|         if (a) { |         if (a) { | ||||||
|             r = (r * 255) / a; |             r = (r * a) / 255; | ||||||
|             g = (g * 255) / a; |             g = (g * a) / 255; | ||||||
|             b = (b * 255) / a; |             b = (b * a) / 255; | ||||||
|  |  | ||||||
|             /* Clamp on overflow */ |             /* Clamp on overflow */ | ||||||
|             if (r > 255) r = 255; |             if (r > 255) r = 255; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user