mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-01 01:25:27 +08:00 
			
		
		
		
	 Patrik Svensson
					Patrik Svensson
				
			
				
					committed by
					
						 Phil Scott
						Phil Scott
					
				
			
			
				
	
			
			
			 Phil Scott
						Phil Scott
					
				
			
						parent
						
							9c9eb04f91
						
					
				
				
					commit
					e86f9d3c5a
				
			| @@ -96,6 +96,21 @@ namespace Spectre.Console | ||||
|                                 return null; | ||||
|                             } | ||||
|                         } | ||||
|                         else if (int.TryParse(part, out var number)) | ||||
|                         { | ||||
|                             if (number < 0) | ||||
|                             { | ||||
|                                 error = $"Color number must be greater than or equal to 0 (was {number})"; | ||||
|                                 return null; | ||||
|                             } | ||||
|                             else if (number > 255) | ||||
|                             { | ||||
|                                 error = $"Color number must be less than or equal to 255 (was {number})"; | ||||
|                                 return null; | ||||
|                             } | ||||
|  | ||||
|                             color = number; | ||||
|                         } | ||||
|                         else | ||||
|                         { | ||||
|                             error = !foreground | ||||
|   | ||||
		Reference in New Issue
	
	Block a user