function fillPalette(times) {
  var resultPalette = palette.slice(0, 3);
  for (var i = 0; i < times; i++) {
    resultPalette.push('FAFAFA');
  }
  resultPalette.push('828282', 'CCCCCC');
  return resultPalette;
}
Demonstrates a mobile friendly user interface with ui.root.onResize().