feat(ui_component): add lerp on multicolor
This commit is contained in:
		
							parent
							
								
									5c34528b3d
								
							
						
					
					
						commit
						7880293723
					
				@ -42,4 +42,14 @@ class MultiColor {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  bool get isGradient =>
 | 
					  bool get isGradient =>
 | 
				
			||||||
      (_colors?.isNotEmpty ?? false) && (_colors?.length ?? 0) > 1;
 | 
					      (_colors?.isNotEmpty ?? false) && (_colors?.length ?? 0) > 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  static MultiColor? lerp(MultiColor? a, MultiColor? b, double t) {
 | 
				
			||||||
 | 
					    if (a == null && b == null) {
 | 
				
			||||||
 | 
					      return null;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    if (b == null) {
 | 
				
			||||||
 | 
					      return a;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return b;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user