// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Android
try {
    String root = Environment.getExternalStorageDirectory().toString();
    File myDir = new File(root + File.separator + "Aspose");
    String filePath = myDir.getCanonicalPath();

    //Instantiating a Workbook object
    Workbook workbook = new Workbook();

    //Adding custom color to the palette at 55th index
    Color color = Color.fromArgb(212,213,0);
    workbook.changePalette(color,55);

    //Obtaining the reference of the newly added worksheet by passing its sheet index
    int sheetIndex = workbook.getWorksheets().add();
    Worksheet worksheet = workbook.getWorksheets().get(sheetIndex);

    //Accessing the "A1" cell from the worksheet
    Cell cell = worksheet.getCells().get("A1");

    //Adding some value to the "A1" cell
    cell.setValue("Hello Aspose!");

    //Setting the custom color to the font
    Style style = cell.getStyle();
    Font font = style.getFont();
    font.setColor(color);

    cell.setStyle(style);

    //Saving the Excel file
    workbook.save(filePath + File.separator + "AddCustomColorsToPalette_Out.xls");
} catch(Exception e) {
    Log.e(TAG, "Add Custom Colors to Palette", e);
}