/* Calculates a 4 or 16 color lookup table between the specified bg and fore colors for use with anti-aliased fonts.  */
void aafontsCalculateColorTable(uint16_t bgColor, uint16_t foreColor, uint16_t *colorTable, size_t tableSize)
/* Calculates a 4 or 16 color lookup table between the specified bg and fore colors for use with anti-aliased fonts.  */
void aafontsCalculateColorTable(uint16_t bgColor, uint16_t foreColor, uint16_t *colorTable, size_t tableSize)
{
  uint16_t i, stepsize;
  if ((tableSize != 4) && (tableSize != 16))
    return;
  colorTable[0] = bgColor;
  colorTable[tableSize - 1] = foreColor;
  stepsize = 100/(tableSize-1);
  for (i = 1; i < tableSize - 1; i++)
  {
    colorTable[i] = colorsAlphaBlend(bgColor, foreColor, 100-i*stepsize);
  }
}