function pageFillColor(page) {
  const sizeAndFilename = page.size_and_filenames[0];
  if (!sizeAndFilename) return "lightgrey";

  let dominantFilename = sizeAndFilename[1];
  if (dominantFilename.startsWith("obj/")) {
    dominantFilename = dominantFilename.substring(4);
  }
  for (let i = 0; i < COLOR_MAPPING.length; i++) {
    const prefixes = COLOR_MAPPING[i][0];
    const color = COLOR_MAPPING[i][1];
    for (let j = 0; j < prefixes.length; j++) {
      if (dominantFilename.startsWith(prefixes[j])) return color;
    }
  }
  return "darkgrey";
}
/**
 * @return the fill color for an item representing a code page.
 */
@return the fill color for an item representing a code page.
@return the fill color for an item representing a code page .
function pageFillColor(page) {
  const sizeAndFilename = page.size_and_filenames[0];
  if (!sizeAndFilename) return "lightgrey";
  let dominantFilename = sizeAndFilename[1];
  if (dominantFilename.startsWith("obj/")) {
    dominantFilename = dominantFilename.substring(4);
  }
  for (let i = 0; i < COLOR_MAPPING.length; i++) {
    const prefixes = COLOR_MAPPING[i][0];
    const color = COLOR_MAPPING[i][1];
    for (let j = 0; j < prefixes.length; j++) {
      if (dominantFilename.startsWith(prefixes[j])) return color;
    }
  }
  return "darkgrey";
}
function pageFillColor ( page ) { const sizeAndFilename = page . size_and_filenames [ 0 ] ; if ( ! sizeAndFilename ) return "lightgrey" ; let dominantFilename = sizeAndFilename [ 1 ] ; if ( dominantFilename . startsWith ( "obj/" ) ) { dominantFilename = dominantFilename . substring ( 4 ) ; } for ( let i = 0 ; i < COLOR_MAPPING . length ; i ++ ) { const prefixes = COLOR_MAPPING [ i ] [ 0 ] ; const color = COLOR_MAPPING [ i ] [ 1 ] ; for ( let j = 0 ; j < prefixes . length ; j ++ ) { if ( dominantFilename . startsWith ( prefixes [ j ] ) ) return color ; } } return "darkgrey" ; }
@return the fill color for an item representing a code page.
@return the fill color for an item representing a code page .