@@ -385,11 +385,13 @@ function displayPalette(colors) {
385385 const paletteContainer = document . createElement ( 'div' ) ;
386386 paletteContainer . className = 'palette-container' ;
387387 paletteContainer . style . display = 'flex' ;
388- paletteContainer . style . gap = '10px' ;
388+ paletteContainer . style . gap = '8px' ; // Reduced gap
389389 paletteContainer . style . justifyContent = 'center' ;
390390 paletteContainer . style . flexWrap = 'wrap' ;
391391 paletteContainer . style . alignItems = 'center' ;
392- paletteContainer . style . marginTop = '10px' ;
392+ paletteContainer . style . marginTop = '5px' ; // Reduced margin
393+ paletteContainer . style . maxHeight = '100px' ; // Limit height
394+ paletteContainer . style . overflow = 'hidden' ; // Prevent overflow
393395
394396 colors . forEach ( ( color , index ) => {
395397 // Validate that color is a valid hex code
@@ -398,26 +400,29 @@ function displayPalette(colors) {
398400 swatchContainer . style . display = 'flex' ;
399401 swatchContainer . style . flexDirection = 'column' ;
400402 swatchContainer . style . alignItems = 'center' ;
401- swatchContainer . style . margin = '5px' ;
403+ swatchContainer . style . margin = '3px' ; // Reduced margin
402404
403- // Create a rectangle shape for the color
405+ // Create a rectangle shape for the color (smaller size)
404406 const colorSwatch = document . createElement ( 'div' ) ;
405407 colorSwatch . style . backgroundColor = color ;
406- colorSwatch . style . width = '40px' ;
407- colorSwatch . style . height = '40px' ;
408+ colorSwatch . style . width = '30px' ; // Smaller width
409+ colorSwatch . style . height = '30px' ; // Smaller height
408410 colorSwatch . style . border = '2px solid #fff' ;
409411 colorSwatch . style . borderRadius = '4px' ;
410412 colorSwatch . style . boxSizing = 'border-box' ;
411413 colorSwatch . title = color ;
412414
413- // Add a label with the hex code
415+ // Add a label with the hex code (smaller font)
414416 const colorLabel = document . createElement ( 'div' ) ;
415417 colorLabel . textContent = color ;
416418 colorLabel . style . color = '#fff' ;
417- colorLabel . style . fontSize = '10px' ;
418- colorLabel . style . marginTop = '4px' ;
419+ colorLabel . style . fontSize = '8px' ; // Smaller font
420+ colorLabel . style . marginTop = '2px' ; // Reduced margin
419421 colorLabel . style . fontFamily = 'Courier New, monospace' ;
420422 colorLabel . style . textAlign = 'center' ;
423+ colorLabel . style . maxWidth = '30px' ;
424+ colorLabel . style . overflow = 'hidden' ;
425+ colorLabel . style . textOverflow = 'ellipsis' ;
421426
422427 swatchContainer . appendChild ( colorSwatch ) ;
423428 swatchContainer . appendChild ( colorLabel ) ;
0 commit comments