colorConverter.format: use color.type by default
This commit is contained in:
		
							parent
							
								
									8cad7d61eb
								
							
						
					
					
						commit
						58f4fbec41
					
				| 
						 | 
					@ -16,7 +16,8 @@ const colorConverter = (() => {
 | 
				
			||||||
    // NAMED_COLORS is added below
 | 
					    // NAMED_COLORS is added below
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  function format(color, type, hexUppercase) {
 | 
					  function format(color = '', type = color.type, hexUppercase) {
 | 
				
			||||||
 | 
					    if (!color || !type) return '';
 | 
				
			||||||
    const a = formatAlpha(color.a);
 | 
					    const a = formatAlpha(color.a);
 | 
				
			||||||
    const hasA = Boolean(a);
 | 
					    const hasA = Boolean(a);
 | 
				
			||||||
    if (type === 'rgb' && color.type === 'hsl') {
 | 
					    if (type === 'rgb' && color.type === 'hsl') {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user