Add color inverting support
This commit is contained in:
		
					parent
					
						
							
								675f627c9c
							
						
					
				
			
			
				commit
				
					
						24e4af85ff
					
				
			
		
					 1 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
					@ -247,13 +247,13 @@ impl TextRenderer {
 | 
				
			||||||
                        None => text_area.default_color,
 | 
					                        None => text_area.default_color,
 | 
				
			||||||
                    };
 | 
					                    };
 | 
				
			||||||
                    let color = Color::rgba(
 | 
					                    let color = Color::rgba(
 | 
				
			||||||
                        ((text_area.invert - color.r() as f32).abs() * text_area.opacity + 0.5)
 | 
					                        (text_area.invert - (color.r() as f32 * text_area.opacity + 0.5).abs())
 | 
				
			||||||
                            as u8,
 | 
					                            as u8,
 | 
				
			||||||
                        ((text_area.invert - color.g() as f32).abs() * text_area.opacity + 0.5)
 | 
					                        (text_area.invert - (color.g() as f32 * text_area.opacity + 0.5).abs())
 | 
				
			||||||
                            as u8,
 | 
					                            as u8,
 | 
				
			||||||
                        ((text_area.invert - color.b() as f32).abs() * text_area.opacity + 0.5)
 | 
					                        (text_area.invert - (color.b() as f32 * text_area.opacity + 0.5).abs())
 | 
				
			||||||
                            as u8,
 | 
					                            as u8,
 | 
				
			||||||
                        ((text_area.invert - color.a() as f32).abs() * text_area.opacity + 0.5)
 | 
					                        (text_area.invert - (color.a() as f32 * text_area.opacity + 0.5).abs())
 | 
				
			||||||
                            as u8,
 | 
					                            as u8,
 | 
				
			||||||
                    );
 | 
					                    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue